I want my Fedora host to using vlan1 IPs, while allowing one of its libvirtd guest to use vlan2 IPs.
My ISP is allowing me two connections: OpenWRT is using one, and I want to make one libvirtd guest to use the second. (Both sets of IPs are working, when I configured my Fedora host to use the second link.)
Under this trunk port connection, how can I make Fedora host use vlan1 only, and make one guest to use vlan2?
How can be two untagged vlans on the same trunk link? That’s not possible.
Create two bridges with NetworkManager, and connect each vlan as a slave interface to each bridge. Using NetworkManager, assign a IP in the desired bridge for the Fedora host and connect the VM to the second bridge in the libvirt XML definition of the domain.
[Network] #when create a bridge this this interface, do not get IP here
Bridge=br2
cat br1.netdev
[Match]
Name=vlan1
Kind=bridge
cat br2.netdev
[Match]
Name=vlan2
Kind=bridge
cat br1.network
[Match]
Name=br1
[Network]
DHCP=yes
cat br2.network
[Match]
Name=br2
[Network]
DHCP=no
This is what I find out to be critical for my setup. I guess, once my Host responded to DHCPv6 or SLAAC, then my ISP considered my Host is “connected”, thus my guest cannot get any offers.
I would like to know if there are any systemd-networkd way to completely disable IPv6 of that bridge interface.
disable ipv6 in br2: cat /etc/sysctl.d/2-sysctl.conf
net.ipv6.conf.br2.disable_ipv6=1
At virt-manager:
At Guest:
tested with ssh incoming and outgo connections OK.
My only outstanding issues is: that guest is not starting with the host, even with option checked:
With your advice on the extra IPv6 lines for the br2 interface, it is now working fine even taken out the sysctl statement
net.ipv6.conf.br2.disable_ipv6=1