. Run console
delete all connections
nmcli --fields UUID,TIMESTAMP-REAL con show | awk '{print $1}' | while read line; do nmcli con delete uuid $line; done
- create bridge br0
nmcli con add type bridge con-name br0 ifname br0
- set host-machine IP for br0
(for example, host machine IP=192.168.1.100/24, gateway=192.168.1.1, dns=192.168.1.254, domain search=example.com)
nmcli con mod br0 ipv4.addresses "192.168.1.100/24"
nmcli con mod br0 ipv4.gateway "192.168.1.1"
nmcli con mod br0 ipv4.dns "192.168.1.254 "
nmcli con mod br0 ipv4.dns-search "example.com"
nmcli con mod br0 ipv4.may-fail no
- Disable DHCP and enable manual settings for br0
nmcli con mod br0 ipv4.method manual
- Add real network card (eth1) to bridge br0
nmcli con add type ethernet con-name "br0-slave-eth1" ifname eth1 master br0
- Enable bridge br0
nmcli con up br0
Now you can attach to br0 any virtual machine from QEMU/KVM.
For example 192.168.1.100 - host,
192.168.1.10 - virt machine 1,
192.168.1.20 - virt machine 2
// for deleting the device br0 that is showing up even after deleting connection in nmcli,
nmcli device delete br0
Top comments (0)