DEV Community

ckyoo
ckyoo

Posted on

network bridging

. Run console

delete all connections
Enter fullscreen mode Exit fullscreen mode

nmcli --fields UUID,TIMESTAMP-REAL con show | awk '{print $1}' | while read line; do nmcli con delete uuid $line; done

  1. create bridge br0

nmcli con add type bridge con-name br0 ifname br0

  1. 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

  1. Disable DHCP and enable manual settings for br0

nmcli con mod br0 ipv4.method manual

  1. Add real network card (eth1) to bridge br0

nmcli con add type ethernet con-name "br0-slave-eth1" ifname eth1 master br0

  1. 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

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post