Difference between revisions of "Vnx-extnet"
Line 7: | Line 7: | ||
Option 1 is recommended one because: | Option 1 is recommended one because: | ||
* Facilitates the coexistence of multiple VNX scenarios sharing the external connectivity, as well as other virtual machines not started with VNX. | * Facilitates the coexistence of multiple VNX scenarios sharing the external connectivity, as well as other virtual machines not started with VNX. | ||
− | * Does not need to change the IP configuration of the external interface during scenario creation. When using bridge based configurations, the IP address of the external interface has to be assigned to the bridge, not to the interface as it is done normally. In case of using option 2, VNX has to reconfigure the external interface during scenario creation/release, which could led in some cases to | + | * Does not need to change the IP configuration of the external interface during scenario creation. When using bridge based configurations, the IP address of the external interface has to be assigned to the bridge, not to the interface as it is done normally. In case of using option 2, VNX has to reconfigure the external interface during scenario creation/release, which could led in some cases to lose the IP conectivity to the host. |
== Option 1: Static bridge associated with external interfce (recomended) == | == Option 1: Static bridge associated with external interfce (recomended) == |
Revision as of 23:08, 21 January 2012
Connecting a Virtual Machine to a external network
There are several ways to connect a virtual machine included in a VNX scenario to an external network. Here we present two options, both based on seting up a bridge and connecting the external interface to that bridge:
- Option 1 consist on changing the host networking configuration to manually connect the external interface to a permanent bridge. Virtual machines that need external connectivity will be simply connected by VNX to that bridge.
- Option 2 consists on dynamically creating a bridge and connecting the external interface to that bridge during scenario creation.
Option 1 is recommended one because:
- Facilitates the coexistence of multiple VNX scenarios sharing the external connectivity, as well as other virtual machines not started with VNX.
- Does not need to change the IP configuration of the external interface during scenario creation. When using bridge based configurations, the IP address of the external interface has to be assigned to the bridge, not to the interface as it is done normally. In case of using option 2, VNX has to reconfigure the external interface during scenario creation/release, which could led in some cases to lose the IP conectivity to the host.
Option 1: Static bridge associated with external interfce (recomended)
- Create a virtual bridge associated with the external interface (eth0 in this example). For example, for an Ubuntu host you have to edit /etc/network/interfaces file and change it in the following way (adapt the addresses and masks values to your case):
auto lo iface lo inet loopback auto br0 iface br0 inet static address 10.1.1.7 netmask 255.255.255.0 gateway 10.1.1.1 bridge_ports eth0 bridge_stp on bridge_maxwait 0 bridge_fd 0
This will create a new bridge, br0, connected to the host interface eth0 and assign the IP address 10.1.1.7 previously assigned to eth0 to the new bridge.
IMPORTANT: be aware that you are modifying the network configuration of your host interfaces and, in case of problems, you will loose the connectivity to the host. This modifications should be done from the host console to avoid problems.
<net name="br0" mode="virtual_bridge"/>
<vm name="vm1" type="libvirt" subtype="kvm" os="linux"> ... <if id="1" net="br0"> <ipv4>10.1.1.40/24</ipv4> </if> ... </vm>
Option 2: Use of external attribute of <if> tag
- Define a VNX <net> with an external attribute:
<net name="Net0" mode="virtual_bridge" external="eth0"/>
<vm name="vm1" type="libvirt" subtype="kvm" os="linux"> ... <if id="1" net="Net0"> <ipv4>10.1.1.40/24</ipv4> </if> ... </vm>
<host> <hostif net="Net0"> <ipv4 mask="255.255.255.0">10.1.1.7</ipv4> </hostif> <route type="ipv4" gw="10.1.1.7">default</route> <physicalif name="eth0" type="ipv4" ip="10.1.1.7" mask="255.255.255.0" gw="10.1.17"/> </host>
Host