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.
$ 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.
]]>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
]]>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'
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.
]]>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