Confused about bridging between VM and Host

Issues related to configuring your network
Post Reply
arshadnoor
Posts: 2
Joined: 2008/11/14 04:49:07

Confused about bridging between VM and Host

Post by arshadnoor » 2017/08/06 23:04:19

Hi,

Upon reading documentation and researching, I've found that most articles about bridging networks between a VM and its Host depict a configuration, where the Host is connected to the internet and the guest may not be - or it is using the Host's default routes to get to the internet.

However, what I'm trying to figure out is the configuration for the opposite - where the VM is connected to the internet, but the physical Host whose interface it depends on is intended to use a non-routable IP address to an internal network. It is, however, physically connected through a router which can NAT packets from the 192.168 network to the 172.4 network. Both, host and guest are running CentOS 7. Also, there is only one NIC on the Host (even though the picture might give the appearance of having two).

Here is an example of what I'm trying to achieve:

Code: Select all

                                           +--------------------------------+
+------------------+         192.168.2.3   |   Host machine with bridge     |
| Host 192.168.2.2 | ----------------------|      +-------------------+     |            +---------------+
+------------------+                       |      |  VM  172.4.8.24   |-----|------------| GW 172.4.8.1  |
                                           |      +-------------------+     |            +---------------+
                                           +--------------------------------+
TIA for any help in what the network configuration files must look like.

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: Confused about bridging between VM and Host

Post by jlehtone » 2017/08/07 06:41:37

Two subnets with only one wire means that you do need to use a VLAN trunk between the router and the host. On both router and host you need one VLAN interface for each subnet.

The router will have IP address on each subnet.
The host should have IP address on the VLAN interface of the 192.168 network.

The VLAN interface of the 172.4 network should be enslaved to the same bridge as the VM.

https://access.redhat.com/documentation ... gging.html

Post Reply