=over 4
(xend-relocation-server yes)
- (xend-relocation-address 192.168.1.1)
+ (xend-relocation-address 192.0.2.192)
(network-script network-bridge)
(vif-script vif-bridge)
(dom0-min-mem 0)
\begin{quote}
\begin{small}
\begin{verbatim}
-/export/vm1root 1.2.3.4/24 (rw,sync,no_root_squash)
+/export/vm1root 192.0.2.4/24 (rw,sync,no_root_squash)
\end{verbatim}
\end{small}
\end{quote}
# this command enables Xen relocations only from the specific
# subnet:
-iptables -I INPUT -p tcp -{}-source 192.168.1.1/8 \
+iptables -I INPUT -p tcp -{}-source 192.0.2.0/24 \
--destination-port 8002 -j ACCEPT
\end{verbatim}
and trying to ping them across the network. For example, using machines
hostA and hostB:
\begin{verbatim}
-hostA# ifconfig vnif0004 10.0.0.100 up
-hostB# ifconfig vnif0004 10.0.0.101 up
-hostB# ping 10.0.0.100
+hostA# ifconfig vnif0004 192.0.2.100 up
+hostB# ifconfig vnif0004 192.0.2.101 up
+hostB# ping 192.0.2.100
\end{verbatim}
The vnet implementation uses IP multicast to discover vnet interfaces, so
\end{verbatim}
If multicast is not being forwarded between machines you can configure
-multicast forwarding using vn. Suppose we have machines hostA on 10.10.0.100
-and hostB on 10.11.0.100 and that multicast is not forwarded between them.
+multicast forwarding using vn. Suppose we have machines hostA on 192.0.2.200
+and hostB on 192.0.2.211 and that multicast is not forwarded between them.
We use vn to configure each machine to forward to the other:
\begin{verbatim}
hostA# vn peer-add hostB
function dhcp_start()
{
- if ! grep -q "subnet 10.0.0.0" "$dhcpd_conf_file"
+ if ! grep -q "subnet 192.0.2.0" "$dhcpd_conf_file"
then
- echo >>"$dhcpd_conf_file" "subnet 10.0.0.0 netmask 255.255.0.0 {}"
+ echo >>"$dhcpd_conf_file" "subnet 192.0.2.0 netmask 255.255.255.0 {}"
fi
"$dhcpd_init_file" restart
function dhcp_stop()
{
local tmpfile=$(mktemp)
- grep -v "subnet 10.0.0.0" "$dhcpd_conf_file" >"$tmpfile"
+ grep -v "subnet 192.0.2.0" "$dhcpd_conf_file" >"$tmpfile"
if diff "$tmpfile" "$dhcpd_conf_file" >&/dev/null
then
rm "$tmpfile"
##### CONFIG ######
-my %xenhosts = ("192.168.0.10" => {"port" => "9363"},
- "192.168.0.11" => {"port" => "9363"},
- "192.168.0.12" => {"port" => "9363"},
- "192.168.0.13" => {"port" => "9363"});
+my %xenhosts = ("192.0.2.10" => {"port" => "9363"},
+ "192.0.2.11" => {"port" => "9363"},
+ "192.0.2.12" => {"port" => "9363"},
+ "192.0.2.13" => {"port" => "9363"});
##### CONFIG END ###
# Root device for nfs.
#root = "/dev/nfs"
# The nfs server.
-#nfs_server = '169.254.1.0'
+#nfs_server = '192.0.2.1'
# Root directory on the nfs server.
#nfs_root = '/full/path/to/root/directory'
# Root device for nfs.
#root = "/dev/nfs"
# The nfs server.
-#nfs_server = '169.254.1.0'
+#nfs_server = '192.0.2.1'
# Root directory on the nfs server.
#nfs_root = '/full/path/to/root/directory'
Sheet.__init__( self, urlWriter, "Network settings", 4 )
self.addControl( ListControl( 'dhcp', [('off', 'No'), ('dhcp', 'Yes')], 'Use DHCP:' ) )
self.addControl( InputControl( 'hostname', 'hostname', 'VM Hostname:' ) )
- self.addControl( InputControl( 'ip_addr', '1.2.3.4', 'VM IP Address:' ) )
+ self.addControl( InputControl( 'ip_addr', '192.168.1.1', 'VM IP Address:' ) )
self.addControl( InputControl( 'ip_subnet', '255.255.255.0', 'VM Subnet Mask:' ) )
- self.addControl( InputControl( 'ip_gateway', '1.2.3.4', 'VM Gateway:' ) )
- self.addControl( InputControl( 'ip_nfs', '1.2.3.4', 'NFS Server:' ) )
+ self.addControl( InputControl( 'ip_gateway', '192.168.1.1', 'VM Gateway:' ) )
+ self.addControl( InputControl( 'ip_nfs', '192.168.1.1', 'NFS Server:' ) )
class CreateFinish( Sheet ):
def preprocess_ip(vals):
if vals.ip or vals.dhcp != 'off':
- dummy_nfs_server = '1.2.3.4'
+ dummy_nfs_server = '127.0.255.255'
ip = (vals.ip
+ ':' + (vals.nfs_server or dummy_nfs_server)
+ ':' + vals.gateway
disk = ['phy:/dev/virt-blkdev-backend/dom1,sda1,w',
'phy:/dev/virt-blkdev-backend/usr,sda2,r']
root = "/dev/sda1 ro"
-extra = " profile=1 GATEWAY=10.0.1.254 NETMASK=255.255.0.0 IPADDR=10.0.134.1 HOSTNAME=dom1"
+extra = " profile=1 GATEWAY=192.0.2.254 NETMASK=255.255.255.0 IPADDR=192.0.2.1 HOSTNAME=dom1"
on_poweroff = 'destroy'
on_reboot = 'destroy'
on_crash = 'destroy'
'vcpus' : 4,
'nics' : -1,
'root' : '/dev/sda1 ro',
- 'extra' : ' profile=1 GATEWAY=10.0.1.254 NETMASK=255.255.0.0 IPADDR=10.0.134.1 HOSTNAME=dom1',
+ 'extra' : ' profile=1 GATEWAY=192.0.2.254 NETMASK=255.255.255.0 IPADDR=192.0.2.1 HOSTNAME=dom1',
'on_poweroff' : 'destroy',
'on_reboot' : 'destroy',
'on_crash' : 'destroy',
to them and test connectivity without any vms running.
For example, using vnif0004 on machines A and B:
- A> ifconfig vnif0004 10.0.0.11
- B> ifconfig vnif0004 10.0.0.12
- B> ping 10.0.0.11
+ A> ifconfig vnif0004 192.0.2.11
+ B> ifconfig vnif0004 192.0.2.12
+ B> ping 192.0.2.11
If the vnet device is enslaved to a bridge you will have to add the IP address
to the bridge instead. Use C<brctl show> or C<vn vnets> to see if a vnet
It should also show in 'brctl show', with its attached interfaces.
You can 'see into' a vnet from dom0 if you put an IP address on the bridge.
-For example, if you have vnet97 and a vm with ip addr 10.0.0.12 connected to it,
+For example, if you have vnet97 and a vm with ip addr 192.0.2.12 connected to it,
then
-ifconfig vnet97 10.0.0.20 up
+ifconfig vnet97 192.0.2.20 up
-should let you ping 10.0.0.12 via the vnet97 bridge.
+should let you ping 192.0.2.12 via the vnet97 bridge.
4) Examples
-----------
These assume a vnet with a bridge 'vnet97' has been created.
-Here's the full config for a vm on vnet 97, using ip addr 10.0.0.12:
+Here's the full config for a vm on vnet 97, using ip addr 192.0.2.12:
(vm
(name dom12)
(image
(linux
(kernel /boot/vmlinuz-2.6-xenU)
- (ip 10.0.0.12:1.2.3.4::::eth0:off)
+ (ip 192.0.2.12:192.0.2.4::::eth0:off)
(root /dev/sda1)
(args 'rw fastboot 4')
)
(image
(linux
(kernel /boot/vmlinuz-2.6-xenU)
- (ip 10.0.0.11:1.2.3.4::::eth0:off)
+ (ip 192.0.2.11:192.0.2.4::::eth0:off)
(root /dev/sda1)
(args 'rw fastboot 4')
)
a bridging environment. Xm-test currently only supports a range of
IPs, the dhcp feature will be added soon.
-The network tests will need to know what IPs to use. IPs are configured
-when you build xm-test. Xm-test uses the zeroconf address range by
-default, 169.254.0.1-169.254.255.255. If you'd like to set a new range,
-do so at configure time, a netmask and network address must also be defined:
-
- # ./configure --with-net-ip-range=192.168.1.1-192.168.1.100 --with-network-address=192.168.1.0 --with-netmask=255.255.255.0
+The network tests will need to know what IPs to use. IPs are
+configured when you build xm-test. Xm-test by default a range chosen
+at random from the RFC1918 private use space, and published at
+www.ucam.org/cam-grin, 172.30.206.1-172.30.206.254 from
+172.30.206.0/24. If you'd like to set a new range, do so at configure
+time, a netmask and network address must also be defined:
+
+ # ./configure --with-net-ip-range=192.0.2.1-192.0.2.100 --with-network-address=192.0.2.0 --with-netmask=255.255.255.0
The tests will not need to set network information, this is done by
the library once it's configured.
fi
# Network needs to know ips to use: dhcp or a range of IPs in the form
-# of: 192.168.1.1-192.168.1.100
+# of: 192.0.2.1-192.0.2.100
# If not dhcp, a netmask and network address must be supplied. Defaults to
-# zeroconf range.
-NET_IP_RANGE="169.254.0.1-169.254.255.255"
+# range allocated in www.ucam.org/cam-grin.
+NET_IP_RANGE="172.30.206.1-172.30.206.254"
AC_ARG_WITH(net-ip-range,
- [ --with-net-ip-range=ip-range Set a range of ip addresses to use for xm-test guest domain networks. Can specify dhcp or a range of IPs: 192.168.1.1-192.168.1.100 [[default="169.254.0.1-169.254.255.255"]]],
+ [ --with-net-ip-range=ip-range Set a range of ip addresses to use for xm-test guest domain networks. Can specify dhcp or a range of IPs: 192.0.2.1-192.0.2.100 [[default="172.30.206.1-172.30.206.254"]]],
[ NET_IP_RANGE="$withval" ])
iprange=`echo $NET_IP_RANGE | perl -e 'while(<>) { print if /\d+\.\d+\.\d+\.\d+-\d+\.\d+\.\d+\.\d+/ }'`
-NETWORK_ADDRESS="169.254.0.0"
+NETWORK_ADDRESS="172.30.206.0"
AC_ARG_WITH(network-address,
- [ --with-network-address=ip Set network address to use with ip range [[default="169.254.0.0"]]],
+ [ --with-network-address=ip Set network address to use with ip range [[default="172.30.206.0"]]],
[ NETWORK_ADDRESS="$withval" ])
-NETMASK="255.255.0.0"
+NETMASK="255.255.255.0"
AC_ARG_WITH(netmask,
- [ --with-netmask=mask Set netmask to use with ip range [[default="255.255.0.0"]]],
+ [ --with-netmask=mask Set netmask to use with ip range [[default="255.255.255.0"]]],
[ NETMASK="$withval" ])
if test "x$NET_IP_RANGE" != "xdhcp" && test -z "$iprange"
configfile.close()
return netenv
-def checkZeroconfAddresses():
- # Make sure there aren't existing zeroconf addresses.
- rc, out = traceCommand("ip addr show |grep \"inet 169.254\" | grep eth0")
- if rc == 0:
- raise NetworkError("Zeroconf addresses already used: %s" % out)
-
class NetConfig:
def __init__(self):
self.__setMaxNumberIPs()
- if self.network == "169.254.0.0":
- checkZeroconfAddresses()
-
# Clean out any aliases in the network range for dom0's interface.
# If an alias exists, a test xendevice add command could fail.
if NETWORK_IP_RANGE != "dhcp":
if run["return"] != 0:
FAIL("Unable to write to block device hdb2!")
- run = console.runCmd("ifconfig eth0 169.254.0.1 netmask 255.255.255.0")
+ run = console.runCmd("ifconfig eth0 172.30.206.1 netmask 255.255.255.240")
if run["return"] != 0:
FAIL("Unable to configure DomU's eth0")
- run = console.runCmd("ifconfig eth1 169.254.1.1 netmask 255.255.255.0")
+ run = console.runCmd("ifconfig eth1 172.30.206.17 netmask 255.255.255.240")
if run["return"] != 0:
FAIL("Unable to configure DomU's eth1")
run = console.runCmd("ifconfig")
if not re.search("eth0", run["output"]):
FAIL("DomU's eth0 disappeared")
- if not re.search("169.254.0.1", run["output"]):
+ if not re.search("172.30.206.1", run["output"]):
FAIL("DomU's eth0 lost its IP")
if not re.search("eth1", run["output"]):
FAIL("DomU's eth1 disappeared")
- if not re.search("169.254.1.1", run["output"]):
+ if not re.search("172.30.206.17", run["output"]):
FAIL("DomU's eth1 lost its IP")
if not re.search("Loopback", run["output"]):
FAIL("DomU's lo disappeared")
# Configure IP addresses on two domains
try:
# Run 'ls'
- run = console1.runCmd("ifconfig eth0 192.168.0.1 netmask 255.255.255.0 up")
- run = console2.runCmd("ifconfig eth0 192.168.0.2 netmask 255.255.255.0 up")
+ run = console1.runCmd("ifconfig eth0 172.30.206.1 netmask 255.255.255.0 up")
+ run = console2.runCmd("ifconfig eth0 172.30.206.2 netmask 255.255.255.0 up")
except ConsoleError, e:
saveLog(console.getHistory())
FAIL(str(e))
# Now ping...
try:
- run = console1.runCmd("ping -c 4 192.168.0.2")
+ run = console1.runCmd("ping -c 4 172.30.206.2")
if run['return'] > 0:
FAIL("Could not ping other host")
- run = console2.runCmd("ping -c 4 192.168.0.1")
+ run = console2.runCmd("ping -c 4 172.30.206.1")
if run['return'] > 0:
FAIL("Could not pint other host")
except ConsoleError, e: