You are not logged in.
I'm trying to create a host-only networking setup with NAT for enabling Internet access in QEMU. I've created a tap device and a bridge but for some reason the static IP assignment to the bridge isn't happening.
The files and the contents that I've created are as follows -
$ cat /etc/systemd/network/30-bridge0.netdev
[NetDev]
Description="This bridge has been created for VMs and containers"
Name=br0
Kind=bridge
$ cat /etc/systemd/network/31-bridge0.network
[Match]
Name=br0
[Link]
RequiredForOnline=no
[Network]
Description="This bridge has been created for VMs and containers"
LinkLocalAddressing=no
LLMNR=no
IPv6AcceptRA=no
#DHCPServer=yes
Gateway=192.168.1.0
DNS=1.1.1.1
[Address]
Address=192.168.1.1/24
Broadcast=192.168.1.255
$ cat /etc/systemd/network/40-tap0.netdev
[NetDev]
Description="This is a tap device for a VM or a container"
Name=tap0
Kind=tap
[Tap]
User=user1
Group=user1
$ cat /etc/systemd/network/41-tap0.network
[Match]
Name=tap0
[Link]
RequiredForOnline=no
[Network]
Description="This is a tap device for a VM or a container"
LinkLocalAddressing=no
LLMNR=no
IPv6AcceptRA=no
Bridge=br0
I tried restarting the systemd-networkd service after creating these files but I get the following output in journalctl
$ journalctl --unit=systemd-networkd -o cat
Starting Network Service...
br0: netdev ready
Enumeration completed
Started Network Service.
br0: netdev exists, using existing without changing its parameters
tap0: Lost carrier
enp3s0: DHCPv4 address 192.168.0.100/24 via 192.168.0.1
tap0: IPv6 successfully disabled
br0: Could not set route: Invalid argument
br0: Configured
tap0: Gained carrier
tap0: Configured
enp3s0: Configured
tap0: Lost carrier
br0: Lost carrier
The relevant output of $ ip a is as follows
$ ip a
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether ab:12:14:cb:31:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.0.100/24 brd 192.168.0.255 scope global dynamic enp3s0
valid_lft 6435sec preferred_lft 6435sec
7: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br0 state DOWN group default qlen 1000
link/ether ca:53:6a:95:43:06 brd ff:ff:ff:ff:ff:ff
8: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 2e:f6:d9:61:25:be brd ff:ff:ff:ff:ff:ff
I'm failing to understand my mistake. I'm expecting to see a static IP address assignment on br0 but it isn't happening. It might be related to the message "br0: Could not set route: Invalid argument" but I'm not sure what I should do. I've also tried removing the Gateway line but that didn't help either. Can you help me?
Last edited by raddecen (2018-06-10 01:49:56)
Offline
Change Gateway=192.168.1.0 to Gateway=192.168.1.1
Offline
Change Gateway=192.168.1.0 to Gateway=192.168.1.1
I changed to value of the gateway to 192.168.1.1 and, although the message "Could not set route: Invalid argument" went away, I'm still not getting a static IP on br0.
After restarting the systemd-networkd service, the journalctl --unit=systemd-networkd output is
Starting Network Service...
br0: netdev ready
Enumeration completed
Started Network Service.
br0: netdev exists, using existing without changing its parameters
tap0: Lost carrier
enp3s0: DHCPv4 address 192.168.0.100/24 via 192.168.0.1
tap0: IPv6 successfully disabled
br0: Configured
tap0: Gained carrier
tap0: Configured
enp3s0: Configured
tap0: Lost carrier
br0: Lost carrier
The output of $ ip a is
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether ab:12:14:cb:31:ac brd ff:ff:ff:ff:ff:ff
inet 192.168.0.100/24 brd 192.168.0.255 scope global dynamic enp3s0
valid_lft 6435sec preferred_lft 6435sec
9: tap0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br0 state DOWN group default qlen 1000
link/ether ba:b9:5e:94:eb:a3 brd ff:ff:ff:ff:ff:ff
10: br0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 2e:f6:d9:61:25:be brd ff:ff:ff:ff:ff:ff
Offline