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
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
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
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.254
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 192.168.1.254
# ping cyberciti.biz
A Note About RHEL / CentOS / Fedora / Redhat KVM Bridged Networking
See our previous FAQ CentOS / Redhat: KVM Bridged Network Configuration.
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop














{ 0 comments… add one now }