You are not logged in.
Pages: 1
I want to set up a bridge using systemd-networkd.
I have the following files in /etc/systemd/network/:
eth0.network
==========
[Match]
Name=eth0
[Network]
Bridge=br0
br0.network
=========
[Match]
Name=br0
[Network]
Address=192.168.1.10
Gateway=192.168.1.1
br0.netdev
========
[NetDev]
Name=br0
Kind=bridge
systemctl reboot and I get 0 connectivity, networkctl shows eth0 in degraded state...
If i do the same setup using iproute2:
ip link add name bridge2 type bridge
ip link set dev bridge2 up
ip link set dev eth0 promisc on
ip link set dev eth0 up
ip link set dev eth0 master bridge2
ip addr add dev bridge2 192.168.1.1024
that works just fine, but is lost upon reboot...
What am I doing wrong?!?!
Offline
The only things I see different from my setup are:
1. in br0.network, I have address defined along with the CIDR - "Address=192.168.0.101/24"
2. in br0.network I have dns servers assigned - "DNS=8.8.8.8" \n "DNS=8.8.4.4"
Hope that helps.
Scott
Offline
Hi, that's a typo on my side, I do indeed have 'Address=192.168.1.10/24" in the network section for the bridge.
I was doubting if my nic is somehow causing the problem so i tried with another USB nic and it behaves the exact same way...
Offline
Wall of text for troubleshooting:
[root@odroid-c1 ~]# networkctl
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 eth0 ether degraded configured
3 wlan0 ether off unmanaged
4 usbnet0 ether off unmanaged
5 br0 ether routable configured
5 links listed.
[root@odroid-c1 ~]# systemctl status systemd-networkd
* systemd-networkd.service - Network Service
Loaded: loaded (/usr/lib/systemd/system/systemd-networkd.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2015-02-22 07:45:07 UTC; 39s ago
Docs: man:systemd-networkd.service(8)
Main PID: 196 (systemd-network)
Status: "Processing requests..."
CGroup: /system.slice/systemd-networkd.service
`-196 /usr/lib/systemd/systemd-networkd
Feb 22 07:45:07 odroid-c1 systemd-networkd[196]: br0 : netdev ready
Feb 22 07:45:07 odroid-c1 systemd[1]: Started Network Service.
Feb 22 07:45:07 odroid-c1 systemd-networkd[196]: eth0 : link configured
Feb 22 07:45:07 odroid-c1 systemd-networkd[196]: br0 : link configured
Feb 22 07:45:11 odroid-c1 systemd-networkd[196]: eth0 : gained carrier
Feb 22 07:45:11 odroid-c1 systemd-networkd[196]: br0 : gained carrier
[root@odroid-c1 ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.20 icmp_seq=1 Destination Host Unreachable
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 0 received, +1 errors, 100% packet loss, time 2999ms
[root@odroid-c1 ~]# cat /etc/systemd/network/eth0.network
[Match]
Name=eth0
[Network]
Bridge=br0
[root@odroid-c1 ~]# cat /etc/systemd/network/br0.network
[Match]
Name=br0
[Network]
Address=192.168.1.20/24
Gateway=192.168.1.1
[root@odroid-c1 ~]# cat /etc/systemd/network/br0.netdev
[NetDev]
Name=br0
Kind=bridge
[root@odroid-c1 ~]# ip route
default via 192.168.1.1 dev br0 proto static
192.168.1.0/24 dev br0 proto kernel scope link src 192.168.1.20
[root@odroid-c1 ~]# cat bridge0.sh
#!/bin/bash
ip link set dev eth0 promisc off
ip link set dev eth0 down
ip link set dev eth0 nomaster
ip link delete br0 type bridge
ip link add name br0 type bridge
ip link set dev br0 up
ip link set dev eth0 promisc on
ip link set dev eth0 up
ip link set dev eth0 master br0
ip addr add dev br0 192.168.1.20/24
ip route del default
ip route add default via 192.168.1.1
sleep 10
systemctl restart systemd-resolved
bridge link show
[root@odroid-c1 ~]# ./bridge0.sh
RTNETLINK answers: File exists
2: eth0 state UP : <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 master br0 state forwarding priority 32 cost 19
[root@odroid-c1 ~]# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=2.05 ms
^C
--- 192.168.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 2.056/2.056/2.056/0.000 ms
[root@odroid-c1 ~]# ping google.com
PING google.com (62.78.98.182) 56(84) bytes of data.
64 bytes from 62.78.98.182: icmp_seq=1 ttl=58 time=24.2 ms
64 bytes from 62.78.98.182: icmp_seq=2 ttl=58 time=32.9 ms
Last edited by blackice (2015-02-22 07:59:56)
Offline
My neworkctl output is similar to yours (i.e. shows 'degraded' for the main ethernet connection eno1 - eth0 for you), as is my ip route output. Do you have any DNS servers assigned that are visible in /etc/resolv.conf?
Offline
Pages: 1