systemd-networkd: bridge interface configuration

Florin Maticu flmati at airtame.com
Thu Oct 1 01:26:51 PDT 2015


Hi,

I have an embedded system with 2 WLAN and one Ethernet interface and
systemd 222 version .

I have a network bridge configured as :

/etc/systemd/system/br0.netdev:

*[NetDev]*

*Name=br0*
*Kind=bridge*

/etc/systemd/system/br0.network:
*[Match]*
*Name=br0*

*[Network]*
*Address=192.168.22.1/24 <http://192.168.22.1/24>*

Two wlan interfaces are added tot the bridge:
*[Match]*
*Name=wlan0*

*[Network]*
*Bridge=br0*

*[Match]*
*Name=wlan1*

*[Network]*
*Bridge=br0*

I have the interface connected to a local network:
*Name=eth**

*[Network]*
*DHCP=v4*
*IPForward=ipv4*

Forwarding is enabled for the eth0
*iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE*

Promiscuous mode is also enable for the bridge interface:
*ip link set dev br0 promisc on*

*I am having the following issue:*

Both *wlans* are running in AP mode.
*eth0* is connected to the local network that has Internet access.
I am connecting from my laptop to one of the AP (wlan1).

I can ping the bridge interface, but pinging 8.8.8.8 does not work.
With the tcpdump, I can see that the packages are not forwarded from the
bridge interface to the *eth0* interface.
I have also attached the debug output from the systemd-networkd bridge
configuration.

One solution that I found to work is as follows:
-remove the bridge configuration files br0.netdev and br0.network
-manually configure the bridge:
  1. brctl addbr br0
  2. brctl adif br0 wlan0
  3. brctl adif br0 wlan1
  4. ifconfig br0 192.168.22.1

I am missing something in the configuration of the bridge for systemd?

Thanks,
Florin

ifconfig output:
*br0: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500*
*        inet 192.168.22.1  netmask 255.255.255.0  broadcast 192.168.22.255*
*        inet6 fe80::542a:5dff:fe5b:38bc  prefixlen 64  scopeid 0x20<link>*
*        ether 56:2a:5d:5b:38:bc  txqueuelen 0  (Ethernet)*

systemd-netword debug:

*Oct 01 09:32:36 florin-test systemd-networkd[640]: br0: loaded bridgeOct
01 09:32:36 florin-test systemd-networkd[640]: br0: CreatingOct 01 09:32:36
florin-test systemd-networkd[640]: br0: Flags change: +UP +MULTICAST
+BROADCAST +PROMISCOct 01 09:32:36 florin-test systemd-networkd[640]: br0:
Link 6 addedOct 01 09:32:36 florin-test systemd-networkd[640]: br0: udev
initialized linkOct 01 09:32:36 florin-test systemd-networkd[640]: br0:
netdev has index 6Oct 01 09:32:36 florin-test systemd-networkd[640]: br0:
netdev readyOct 01 09:32:36 florin-test systemd-networkd[640]: br0: Saved
original MTU: 1500Oct 01 09:32:36 florin-test systemd-networkd[640]: br0:
Adding address: 192.168.22.1/24 <http://192.168.22.1/24> (valid for
ever)Oct 01 09:32:36 florin-test systemd-networkd[640]: br0: netdev exists,
using existing without changing its parametersOct 01 09:32:36 florin-test
systemd-networkd[640]: br0: CreatedOct 01 09:32:36 florin-test
systemd-networkd[640]: br0: Link state is up-to-dateOct 01 09:32:36
florin-test kernel: br0: port 1(wlan1) entered forwarding stateOct 01
09:32:36 florin-test kernel: br0: port 1(wlan1) entered forwarding stateOct
01 09:32:36 florin-test kernel: IPv6: ADDRCONF(NETDEV_CHANGE): br0: link
becomes readyOct 01 09:32:36 florin-test systemd-networkd[640]: br0
    : found matching network '/etc/systemd/network/br0.network'Oct 01
09:32:36 florin-test systemd-networkd[640]: br0: Setting addressesOct 01
09:32:36 florin-test kernel: br0: port 2(wlan0) entered forwarding stateOct
01 09:32:36 florin-test kernel: br0: port 2(wlan0) entered forwarding
stateOct 01 09:32:36 florin-test systemd-networkd[640]: wlan1: Enslaving by
'br0'Oct 01 09:32:36 florin-test systemd-networkd[640]: br0: Enslaving link
'wlan1'Oct 01 09:32:36 florin-test systemd-networkd[640]: wlan0: Enslaving
by 'br0'Oct 01 09:32:36 florin-test systemd-networkd[640]: br0: Enslaving
link 'wlan0'Oct 01 09:32:36 florin-test systemd-networkd[640]: br0:
Addresses setOct 01 09:32:36 florin-test systemd-networkd[640]: br0:
ConfiguredOct 01 09:32:36 florin-test systemd-networkd[640]: br0: Flags
change: +LOWER_UP +RUNNINGOct 01 09:32:36 florin-test
systemd-networkd[640]: br0: Gained carrierOct 01 09:32:37 florin-test
systemd-networkd[640]: br0: Adding address: fe80::542a:5dff:fe5b:38bc/64
(valid for ever)Oct 01 09:32:51 florin-test kernel: br0: port 1(wlan1)
entered forwarding stateOct 01 09:32:51 florin-test kernel: br0: port
2(wlan0) entered forwarding stateOct 01 10:12:13 florin-test
dnsmasq-dhcp[520]: DHCPDISCOVER(br0) 192.168.22.83 40:f0:2f:b5:e1:b0Oct 01
10:12:13 florin-test dnsmasq-dhcp[520]: DHCPOFFER(br0) 192.168.22.83
40:f0:2f:b5:e1:b0Oct 01 10:12:13 florin-test dnsmasq-dhcp[520]:
DHCPREQUEST(br0) 192.168.22.83 40:f0:2f:b5:e1:b0Oct 01 10:12:13 florin-test
dnsmasq-dhcp[520]: DHCPACK(br0) 192.168.22.83 40:f0:2f:b5:e1:b0*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/xdg/attachments/20151001/97147412/attachment.html>


More information about the xdg mailing list