This is an old revision of the document!
By default dhcpd based network bridge configured by libvirtd. You can verify that with the following commands:
# brctl show # virsh net-list
KVM default networking All VMs (guest machine) only have network access to other VMs on the same server. A private network 192.168.122.0/24 created for you. Verify it:
# virsh net-dumpxml default
If you want your VMs avilable to other servers on your LAN, setup a a network bridge on the server that connected to the your LAN.
Update your nic config file such as ifcfg-enp3s0 or em1: # vi /etc/sysconfig/network-scripts/enp3s0
Add line:
BRIDGE=br0
Save and close the file in vi. Edit /etc/sysconfig/network-scripts/ifcfg-br0 and add:
# vi /etc/sysconfig/network-scripts/ifcfg-br0
Append the following:
DEVICE="br0" # I am getting ip from DHCP server # BOOTPROTO="dhcp" IPV6INIT="yes" IPV6_AUTOCONF="yes" ONBOOT="yes" TYPE="Bridge" DELAY="0"
Restart the networking service (warning ssh command will disconnect, it is better to reboot the box):
# systemctl restart NetworkManager
Verify it with brctl command:
# brctl show
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-br1 DEVICE="br1" ONBOOT="yes" TYPE="Bridge" BOOTPROTO="none" IPADDR="10.5.22.51" NETMASK="255.255.255.0" GATEWAY="10.5.22.254" IPV6INIT="yes" IPV6_AUTOCONF="yes" DHCPV6C="no" STP="on" DELAY="0.0"
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-br2 DEVICE="br2" ONBOOT="yes" TYPE="Bridge" BOOTPROTO="none" IPADDR="10.5.23.10" NETMASK="255.255.255.0" IPV6INIT="yes" IPV6_AUTOCONF="yes" DHCPV6C="no" STP="on" DELAY="0.0"
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 ONBOOT=yes BRIDGE="br1"
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 ONBOOT=yes BRIDGE="br2"
[root@localhost ~]# cat /sbin/ifup-local #!/bin/sh ip route add default via 10.5.23.254 dev br2 table rt2; ip rule add from 10.5.23.0/24 table rt2