You are not logged in.
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
Last edited by PattPatel (2014-04-04 13:17:25)
Offline
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
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
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
Don't worry about that 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
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
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
Offline
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
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 ' |
Offline