I'm a bit confused on how to setup a bridge for KVM on my Debian box that has three NICs in it. I've attached my current /etc/network/interface below. My goal here is to have a video surveillance server VM on the CAM LAN interface so I need just that interface bridged. I don't need the other two interfaces bridged.
Everything I'm seeing online deals with setting up a bridge using just one NIC. I can't seem to find anything that deals with multiple NICs on the same machine each having a different subnet. How would I go about bridging just the CAM LAN NIC and not breaking the networking already in place?
# The loopback network interface
auto lo
iface lo inet loopback
# Computer LAN
allow-hotplug enp3s0
iface enp3s0 inet static
address 192.168.22.149
netmask 255.255.255.0
network 192.168.22.0
broadcast 192.168.22.255
gateway 192.168.22.1
dns-nameservers 192.168.22.1 8.8.8.8
# Cam LAN
allow-hotplug enp1s0f1
iface enp1s0f1 inet static
address 192.168.2.50
netmask 255.255.255.0
post-up ip route add 192.168.2.0/24 dev enp1s0f1 src 192.168.2.50 table rt2
post-up ip route add default via 192.168.2.1 dev enp1s0f1 table rt2
post-up ip rule add from 192.168.2.50/32 table rt2
post-up ip rule add to 192.168.2.50/32 table rt2
# DMZ LAN
allow-hotplug enp1s0f0
iface enp1s0f0 inet static
address 10.0.1.2
netmask 255.255.255.0
post-up ip route add 10.0.1.0/24 dev enp1s0f0 src 10.0.1.2 table rt3
post-up ip route add default via 10.0.1.1 dev enp1s0f0 table rt3
post-up ip rule add from 10.0.1.2/32 table rt3
post-up ip rule add to 10.0.1.2/32 table rt3
Edit - So I have figured out how to manually add a bridge on the CLI. Its as follows:
# brctl addbr br0
# brctl addif br0 enp1s0f1
# ifconfig br0 up
# dhclient br0
This successfully grabs an IP address on the CAM LAN interface from the upstream router which is correct. I can so assign a static (which is the ultimate end goal) with ifconfig br0 192.168.2.x netmask 255.255.255.0 up
.
However, I can't figure out how to input this information into the /etc/network/interface
file. I need the br0
bridge assigned to enp1s0f1
and I need them both to have static IPs.