You are not logged in.

#1 2013-10-22 14:49:05

masque
Member
Registered: 2013-02-24
Posts: 25

can't start bridge at boot with netctl (dhcp timeout?)

Hi I'm tryng to setup a bridge connection at boot with netctl to use it with
qemu.
I followed the wiki and came up with with a simple netctl profile

Description="Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0)
IP=dhcp
## Ignore (R)STP and immediately activate the bridge
#SkipForwardingDelay=yes

It works only when I start it (netctl start bridge) after my eth0 is alredy up.

~ > ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:01:80:77:9c:4c brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.103/24 brd 192.168.10.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::201:80ff:fe77:9c4c/64 scope link 
       valid_lft forever preferred_lft forever
~ > su
Password: 
root:~ > netctl start bridge 
root:~ > netctl status bridge
netctl@bridge.service - Networking for netctl profile bridge
   Loaded: loaded (/usr/lib/systemd/system/netctl@.service; static)
   Active: active (exited) since Tue 2013-10-22 15:45:45 CEST; 4s ago
     Docs: man:netctl.profile(5)
  Process: 812 ExecStart=/usr/lib/network/network start %I (code=exited, status=0/SUCCESS)
 Main PID: 812 (code=exited, status=0/SUCCESS)

Oct 22 15:45:38 fkup dhcpcd[832]: version 6.0.5 starting
Oct 22 15:45:38 fkup dhcpcd[832]: br0: waiting for carrier
Oct 22 15:45:39 fkup dhcpcd[832]: br0: carrier acquired
Oct 22 15:45:39 fkup dhcpcd[832]: br0: rebinding lease of 192.168.10.152
Oct 22 15:45:44 fkup dhcpcd[832]: br0: leased 192.168.10.152 for 4320 seconds
Oct 22 15:45:44 fkup dhcpcd[832]: br0: adding host route to 192.168.10.152 via 127.0.0.1
Oct 22 15:45:44 fkup dhcpcd[832]: br0: adding route to 192.168.10.0/24
Oct 22 15:45:44 fkup dhcpcd[832]: br0: adding default route via 192.168.10.1
Oct 22 15:45:45 fkup network[812]: Started network profile 'bridge'
Oct 22 15:45:45 fkup systemd[1]: Started Networking for netctl profile bridge.

...but if I disable my ethernet-dhcp profile at boot to enable the bridge, it
fails:

root:~ > netctl status bridge 
netctl@bridge.service - Bridge connection
   Loaded: loaded (/etc/systemd/system/netctl@bridge.service; enabled)
   Active: failed (Result: exit-code) since Tue 2013-10-22 15:36:20 CEST; 20s ago
     Docs: man:netctl.profile(5)
  Process: 298 ExecStart=/usr/lib/network/network start %I (code=exited, status=1/FAILURE)
 Main PID: 298 (code=exited, status=1/FAILURE)

Oct 22 15:36:10 fkup dhcpcd[323]: br0: waiting for carrier
Oct 22 15:36:12 fkup dhcpcd[323]: br0: carrier acquired
Oct 22 15:36:13 fkup dhcpcd[323]: br0: rebinding lease of 192.168.10.152
Oct 22 15:36:20 fkup dhcpcd[323]: timed out
Oct 22 15:36:20 fkup dhcpcd[323]: exited
Oct 22 15:36:20 fkup network[298]: DHCP IP lease attempt failed on interface 'br0'
Oct 22 15:36:20 fkup network[298]: Failed to bring the network up for profile 'bridge'
Oct 22 15:36:20 fkup systemd[1]: netctl@bridge.service: main process exited, code=exited, status=1/FAILURE
Oct 22 15:36:20 fkup systemd[1]: Failed to start Bridge connection.
Oct 22 15:36:20 fkup systemd[1]: Unit netctl@bridge.service entered failed state.
root:~ > systemctl list-unit-files |grep netctl
netctl-auto@.service                   disabled
netctl-ifplugd@.service                disabled
netctl-sleep.service                   disabled
netctl.service                         disabled
netctl@.service                        static  
netctl@bridge.service                  enabled

It looks like dhcp is responding too slowly. Anyway, this doesn't happen when
I'm using my ethernet-dhcp profile.

Anyway, after the failed bridge start, i can lanunch dhcpcd manually, obtaining
an address.

root:~ > dhcpcd 
dhcpcd[1069]: version 6.0.5 starting
dhcpcd[1069]: eth0: soliciting an IPv6 router
dhcpcd[1069]: eth0: rebinding lease of 192.168.10.103
dhcpcd[1069]: br0: soliciting an IPv6 router
dhcpcd[1069]: br0: rebinding lease of 192.168.10.152
dhcpcd[1069]: br0: leased 192.168.10.152 for 4320 seconds
dhcpcd[1069]: br0: adding host route to 192.168.10.152 via 127.0.0.1
dhcpcd[1069]: br0: adding route to 192.168.10.0/24
dhcpcd[1069]: br0: adding default route via 192.168.10.1
dhcpcd[1069]: forked to background, child pid 1318

Then it works flawlessly with quemu... But I wish to be able to start the bridge
at boot time.

I searched the forum, finding two other cases of netctl+bridge issues, but they
were slightly different.
https://bbs.archlinux.org/viewtopic.php?id=170272
https://bbs.archlinux.org/viewtopic.php?id=161712

Offline

#2 2013-11-03 11:56:23

raneon
Member
Registered: 2013-11-02
Posts: 57

Re: can't start bridge at boot with netctl (dhcp timeout?)

Actually I have the same issue. It is driving me crazy as it works randomly. I thought it's my wrong setup so I  tried multiple different how-to's but always with the same result. It took me ages to figure out that my setup seems to be ok and it works from time to time, all I need to do is to reboot and try again. Maybe it is related to some automatic systemd service/device start.

My ethernet-dhcp profile is deactivated and I don't have to start it manually. I use a similar setup for the bridge. So just starting manually the bridge via "netctl start bridge" works after a fresh reboot in roundabout 50% of my attempts. If I enable the automatic start via "netctl enable bridge" the IP address is as well only assigned randomly.

Last edited by raneon (2013-11-03 12:49:44)

Offline

#3 2013-11-03 12:59:54

raneon
Member
Registered: 2013-11-02
Posts: 57

Re: can't start bridge at boot with netctl (dhcp timeout?)

As it works always if you do manually first "netctl start ethernet-dhcp" and then afterwards "netctl start bridge" I tought that the timeout might be related to a not proper configured ethernet interface. Maybe the ehternet interface must be up and running before the bridge.

Now instead of the ethernet-dhcp profile that works when activated before the bridge I've created one for ethernet-noip. Starting it manually via "netctl start ethernet-noip" and then "netctl start bridge" works as well.

But if I enable the profiles automatically during boot via "netctl enable ethernet-noip" and then "netctl enable bridge" it works as well only randomly.

Output of "systemctl status netctl@br0.service":

Nov 03 13:52:25 server dhcpcd[364]: br0: rebinding lease of 192.168.1.19
Nov 03 13:52:25 server dhcpcd[364]: br0: carrier lost
Nov 03 13:52:26 server dhcpcd[364]: br0: carrier acquired
Nov 03 13:52:26 server dhcpcd[364]: br0: rebinding lease of 192.168.1.19
Nov 03 13:52:34 server dhcpcd[364]: timed out
Nov 03 13:52:34 server dhcpcd[364]: exited
Nov 03 13:52:35 server network[226]: DHCP IP lease attempt failed on interface 'br0'

Last edited by raneon (2013-11-03 13:00:15)

Offline

#4 2013-11-04 23:29:45

Alambre
Member
Registered: 2011-11-30
Posts: 11

Re: can't start bridge at boot with netctl (dhcp timeout?)

//50%off
well on my case in the logs have missed a folder /var/lib/netctl/ check it

systemctl list-unit-files |grep netctl                                                                        
netctl-auto@.service                    disabled
netctl-ifplugd@.service                 disabled
netctl-sleep.service                    disabled
netctl.service                          enabled 
netctl@.service                         static  
cat /etc/netctl/bridge                                                                                        
Description="Example Bridge connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(eth0 eth4)
#IP=dhcp
## Ignore (R)STP and immediately activate the bridge
#SkipForwardingDelay=yes
IP='static'
ADDR='10.0.0.143'
GATEWAY='10.0.0.44'
# Any valid iproute command can be placed in this array
IPCustom=('addr add dev br0 10.0.0.143/24 brd +' 'route add default via 10.0.0.44')
DNS=('10.0.0.44')

some arguments are invalids, because i get from /etc/network.d/bridge

Offline

#5 2013-11-09 11:25:47

raneon
Member
Registered: 2013-11-02
Posts: 57

Re: can't start bridge at boot with netctl (dhcp timeout?)

Here are the outputs:

$ systemctl list-unit-files |grep netctl 
netctl-auto@.service                   disabled
netctl-ifplugd@.service                disabled
netctl-sleep.service                   disabled
netctl.service                         disabled
netctl@.service                        static  
netctl@br0.service                     enabled 
$ cat /etc/netctl/br0 
Description="Bridge"
Interface=br0
Connection=bridge
BindsToInterfaces=(enp0s25)
IP=dhcp

As you see my bridge is configured via DHCP. This is why I get the time out, even if it is weird. With a static IP it should be fine. I do the dhcp lease via my router. I found the following section in the netctl wiki:

DHCP timeout issues
If you are having timeout issues when requesting leases via DHCP you can set the timeout value higher than netctl's 30 seconds by default. Create a file in /etc/netctl/hooks/ or /etc/netctl/interfaces/, add TimeoutDHCP=40 to it for a timeout of 40 seconds and make the file executable.

This is what I will try next.

Offline

#6 2013-11-28 10:41:17

masque
Member
Registered: 2013-02-24
Posts: 25

Re: can't start bridge at boot with netctl (dhcp timeout?)

raneon wrote:

As you see my bridge is configured via DHCP. This is why I get the time out, even if it is weird. With a static IP it should be fine. I do the dhcp lease via my router. I found the following section in the netctl wiki:

DHCP timeout issues
If you are having timeout issues when requesting leases via DHCP you can set the timeout value higher than netctl's 30 seconds by default. Create a file in /etc/netctl/hooks/ or /etc/netctl/interfaces/, add TimeoutDHCP=40 to it for a timeout of 40 seconds and make the file executable.

This is what I will try next.

I tried it, but it didn't solve my issue.
At the moment, I configured my bridge with a static ip.

Offline

Board footer

Powered by FluxBB