I'm trying to create a bridge whose interface is a tap, both with static IPs, and have them persist across reboots.
In Ubuntu 14.04.6 LTS, this could be accomplished by editing /etc/network/interfaces as such:
auto br0
iface br0 inet static
address 0.0.0.0
bridge_ports tap0
auto tap0
iface tap0 inet static
address 0.0.0.0
pre-up /usr/sbin/tunctl -t tap0
and running
brctl addbr br0
tunctl -t tap0
brctl addif br0 tap0
on the command line.
Then, when you run bridge link
you get the following output:
4: tap0 state UP : <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 master br0 state
forwarding priority 32 cost 100
But since Ubuntu 20.04 has deprecated the use of /etc/network/interfaces in favor of netplan, I don't know how to set it up.
I've tried setting /etc/netplan/00-installer-config.yml to the following:
...
bridges:
br0:
addresses: [0.0.0.0/24]
gateway4: 10.0.2.15
nameservers:
addresses: [8.8.8.8]
and running netplan apply
followed by
ip tuntap add mode tap tap0
ip link tap0 master br0
I've tried running
ip link add name br0 type bridge
ip link set dev br0 up
ip tuntap add mode tpa tap0
ip link set tap0 master br0
I've even tried adding tap0 as an ethernet interface in /etc/netplan/00-installer-config.yaml, but no matter what I do, when I run bridge link
I get
4: tap0: <BROADCAST,MULTICAST> mtu 1500 master br0 state disabled priority 32 cost 100
How can I get this configured correctly? I've tried everything I've seen online, and no matter what I do I can't get the tap to go from state disabled
to state forwarding
. Please help