Configuration of network bridge for KVM on CentOS 7.4

bridgecentos7kvm-virtualizationvirtualbox

I'm new to KVM on CentOS 7.4, but I have experience with using VirtualBox on the Mac OS. There I was able to select in the options to have a bridged network instead of a NAT, and it worked. The instance running can be easily accessed from the LAN, and it has an IP address which looks like it got it DHCP from the router.

On KVM/CentOS 7.4, I've not been successful yet. Is there an option like that in virt-manager to configure it for a Bridged network like it is in VirtualBox/Mac?

What I have done so far to ssh into the KVM instance is use ssh -t, to tunnel in there and that works. But I really need it to work without tunneling. And I need to be able to run Apache and serve some pages from this instance too.

Is the solution in some settings in virt-manager to make the network bridge work as I described like it does in VirtualBox/Mac? Or is there a more complicated that is needed to accomplish this? If so, what is it?

Best Answer

Bridging works fine, all you need is to have the same IP segment on the bridge and in the VM.

As you mentioned virt-manager, there is screenshot from NIC definition of one of our working VMs (bothy hypervisor/VM are RHEL 7 nodes).

enter image description here

EDIT1:

Maybe you're missing following sysctl deffinitions:

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

EDIT2:

In the discussion we've identifide the problem. There are no bridge (br0/br1 etc.) interfaces defined on top of physical NICs. It's necessary to create it first. There is short, but most probably, sufficient howto:

https://ervikrant06.wordpress.com/2014/06/06/how-to-configure-software-bridge-in-rhel-7/

Related Topic