SSH to host through bridge

Latest response

Hi, I'm testing KVM and would like to use only one physical interface to access/ssh into the host and VM's. So far I only managed to get it working by setting up a bridge on one physical interface to access VM's, and another interface to access host. is using single interface possible, similar to esxi?

using RHEL 7



In NetworkManager, create a bridge and put your physical interface in this bridge. We usually call this one br0. The physical machine now uses this bridge for its IP address and external network access. Don't use the physical interface directly anymore.

In virt-manager, under a VM's network interface, set the Source Network to "Bridge br0". You may have to restart the libvirtd service the first time for it to see the new bridge.

The bridge br0 will act as a Layer 2 switch between the real network and the VMs, so your VMs will get IP addresses on the real external network just like the physical machine.

Yes, I have it setup this way and can access the VM's but cant SSH into the host through this connection.

let say br0 has IP, should i be able to ssh the host with that IP?

From your description it sounds like you've got two physical interfaces, where one is bridged and one isn't, but both have IPs in the same subnet?

I recommend not doing this, as all traffic destined for the subnet will leave via one interface by default. That may be what's breaking your host access.

You'd be better to either: - have your VM network in one subnet and have your management network in another subnet - have an IP just on the management network and not on the bridge

However, if you really wish to have two IPs in the same subnet, you can do things like this, which is complex and difficult to configure and troubleshoot:

ok, I disconnected the second interface and now its working as I want. thanks!

initially that didn't work but probably I didnt have it setup correctly.