The NAT based connectivity is useful for easy deployments. However I want to use full bridging, where the guest is connected directly to the LAN. How do setup and share physical network with host and rest of the LAN under Linux?

You need to type the following commands under Debian or Ubuntu Linux (you may to disable network manager too) to set bridging option. My default eth0 config looks as follows /etc/network/interfaces:

 allow-hotplug eth0
 iface eth0 inet static

Take down eth0, enter:
# ifdown eth0
Next, edit /etc/network/interfaces network configuration file, enter:
# vi /etc/network/interfaces
Update it as follows to define the interface eth0 as being a bridge and specify its ports:

 auto br0
 iface br0 inet static
         bridge_ports eth0
         bridge_stp on
         bridge_maxwait 0

Save and close the file. Type the following command to start br0:
# ifup br0
Update /etc/sysctl.conf as follows to disable netfilter on the bridge (alternately you can configure netfiler using iptables for security):

net.bridge.bridge-nf-call-ip6tables = 0
net.bridge.bridge-nf-call-iptables = 0
net.bridge.bridge-nf-call-arptables = 0

Save and close the file. Type the following to update the changes:
# sysctl -p
As I said earlier configure iptables to allow all traffic to be forwarded across the bridge from KMV guest. Add following rule to your iptables script:

/sbin/iptables -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT

Restart / reload your firewall script. Finally, verify that you got a working shared physical device which guests can be attached, enter:
# brctl show
# ip addr show br0
# ip route
# ping
# ping

A Note About RHEL / CentOS / Fedora / Redhat KVM Bridged Networking

See our previous FAQ CentOS / Redhat: KVM Bridged Network Configuration.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersncdu pydf
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum