You are not logged in.

#1 2014-04-04 10:48:41

PattPatel
Member
From: Milan, Italy
Registered: 2014-04-04
Posts: 4
Website

Bridge with netctl not coming up if "enabled" without making brctl

Hi,
I made a Bridge with Netctl to use it with LXC (Linux Containers).
My configuration /etc/netctl/nat looks like this:

Description="NAT"
Interface=nat
Connection=bridge
BindsToInterfaces=()
IP=static
Address=10.0.0.254/24
FwdDelay=0

If I do

netctl enable nat

and then I reboot the machine, the interface fails to start.
Even if I try to do

netctl start nat

it fails to start because "nat" interface does not exists.
To make it working I have to manually do

brctl addbr nat

After doing this everything works fine.

At the same time, if I keep nat disabled from netctl and I start it manually, the interface comes up creating the bridge automatically.
How could I automize the all thing at boot time with a clean solution? Everything has to be up before LXC start script (I could write a custom bash script, but I'd like to avoid it)
Thanks for answering smile

Last edited by PattPatel (2014-04-04 13:17:25)

Offline

#2 2014-04-04 15:43:20

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Bridge with netctl not coming up if "enabled" without making brctl

You need to specify your physical interface in BindsToInterfaces=(), as without that it would default to the value from Interface=.. as the name of the physical device. See man:netctl.profile

Last edited by teekay (2014-04-04 15:50:10)

Offline

#3 2014-04-04 18:11:27

PattPatel
Member
From: Milan, Italy
Registered: 2014-04-04
Posts: 4
Website

Re: Bridge with netctl not coming up if "enabled" without making brctl

Thanks for answering.
I took that snippet from https://wiki.archlinux.org/index.php/Li … vice_setup to make a nat device instead of normal bridge. In fact, everything works fine if I start it manually. The bridge is created correctly through the ip tool.
But if I want the network interface to be up at boot time, there is no way to make it working. Systemd gets hanged for a while, then it goes timeout and skips the interface.

Offline

#4 2014-04-04 19:33:29

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Bridge with netctl not coming up if "enabled" without making brctl

Oh, I didn't know of that method yet. So please ignore my comment above.. until now I thought passing an empty BindsToInterfaces=() and not specifying it at all means the same thing, but I obviously just misread the manpage.

Offline

#5 2014-04-04 21:06:02

PattPatel
Member
From: Milan, Italy
Registered: 2014-04-04
Posts: 4
Website

Re: Bridge with netctl not coming up if "enabled" without making brctl

Don't worry about that smile I tried to look at bash scripts that manage the networking service, without success.
There is no reason for which it shouldn't work... but it doesn't and I'm going crazy sad
I think I'll build my own boot script to get it working... but it's a dirty solution because Arch Linux already provides the tools to do it, and they are simply awesome for the most.

Offline

#6 2014-04-05 10:12:12

PattPatel
Member
From: Milan, Italy
Registered: 2014-04-04
Posts: 4
Website

Re: Bridge with netctl not coming up if "enabled" without making brctl

I solved by manually remove

BindsTo=sys-subsystem-net-devices-nat.device

line from the autogenerated

/etc/systemd/system/netctl@nat.service

I think it could be considered as a bug, what do you think about that?
Thanks however for everything smile

Offline

#7 2014-04-05 18:07:48

teekay
Member
Registered: 2011-10-26
Posts: 271

Re: Bridge with netctl not coming up if "enabled" without making brctl

I would open a bug on netctl github and ask if above is supposed to work, yes. Looking at netctl's lib/connections/bridge it should work, indeed.

Offline

#8 2014-04-05 18:28:32

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: Bridge with netctl not coming up if "enabled" without making brctl

If you want an BindsToInterfaces to be empty, then leave it an empty string, not an empty array:

 # do it in bash just like netctl
test_a=
[[ -v test_a ]] || test_a=(value)
echo test_a: ${test_a[@]}

test_b=()
[[ -v test_b ]] || test_b=(value)
echo test_b: ${test_b[@]}

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

Board footer

Powered by FluxBB