Difference between revisions of "Xen 3.2, CentOS 5.1 and NAT HOWTO"

From PDP/Grid Wiki
Jump to navigationJump to search
 
Line 1: Line 1:
 
The default configuration for networking with Xen DomUs is bridging the network interface to the Dom0. This will make a DomU network interface appear on the LAN just like any other machine.
 
The default configuration for networking with Xen DomUs is bridging the network interface to the Dom0. This will make a DomU network interface appear on the LAN just like any other machine.
  
This HOWTO explains how you can change the configuration to masquerade all the network interfaces of the DomUs behind the Dom0. This will turn the Dom0 into a NAT box, which may be useful if you want to build a cluster that doesn't expose itself to the network.
+
This HOWTO explains how you can change the configuration to masquerade all the network interfaces of the DomUs behind the Dom0. This will turn the Dom0 into a NAT box, which may be useful if you want to build a cluster that doesn't expose itself to the network as much.
 +
 
 +
== NAT ==
 +
 
 +
The way network interfaces work in Xen is by generating, on the fly, a virtual network interface in the Dom0 for each DomU. This interface is connected to the interface on the DomU side by an imaginary crossover cable.
 +
 
 +
Two scripts handle the management of these interfaces. One is called the network-script, which is just run once upon starting the xend daemon; the other is the vif-script, which is called each time a virtual interface needs to be created or torn down.
 +
The file names of the scripts to use are defined in the Xen daemon configuration file,  /etc/xen/xend-config.xsp.
 +
 
 +
Install the replacement scripts network-nat-dns
 +
and find the lines that define the network script and the vif-script. Change them to the following.
 +
 
 +
(network-script network-nat-dns)
 +
(vif-script    vif-nat-dns)

Revision as of 12:38, 22 April 2008

The default configuration for networking with Xen DomUs is bridging the network interface to the Dom0. This will make a DomU network interface appear on the LAN just like any other machine.

This HOWTO explains how you can change the configuration to masquerade all the network interfaces of the DomUs behind the Dom0. This will turn the Dom0 into a NAT box, which may be useful if you want to build a cluster that doesn't expose itself to the network as much.

NAT

The way network interfaces work in Xen is by generating, on the fly, a virtual network interface in the Dom0 for each DomU. This interface is connected to the interface on the DomU side by an imaginary crossover cable.

Two scripts handle the management of these interfaces. One is called the network-script, which is just run once upon starting the xend daemon; the other is the vif-script, which is called each time a virtual interface needs to be created or torn down. The file names of the scripts to use are defined in the Xen daemon configuration file, /etc/xen/xend-config.xsp.

Install the replacement scripts network-nat-dns

and find the lines that define the network script and the vif-script. Change them to the following.
(network-script network-nat-dns)
(vif-script     vif-nat-dns)