19.16. Laptop Configurations

19.16. Laptop Configurations

The task of configuring your RHEL 5.0 loaded laptop for use on a network environment, presents a number of potential challenges. Most WiFi and wired connections switch constantly during any given day, and Red Hat Virtualization assumes it has access to the same interface consistently. This results in the system performing ifup/ifdown calls to the network interface in use by Red Hat Virtualization. WiFi cards are not the ideal network connection method since Red Hat Virtualization uses the default network interface.

The idea here is to create a 'dummy' network interface for Red Hat Virtualization to use.

This technique allows you to use a hidden IP address space for your guests and Virtual Machines. To do this operation successfully, you must use static IP addresses as DHCP does not listen for IP addresses on the dummy network. You also must configure NAT/IP masquerading to enable network access for your guests and Virtual Machines. You should attach a static IP when you create the 'dummy' network interface.

For this example, the interface is called dummy0 and the IP used is 10.1.1. The script is called ifcfg-dummy0 and resides in the /etc/sysconfig/network-scripts/ directory:

DEVICE =dummy0
BOOTPROTO=none
ONBOOT=yes
USERCTL=no
IPV6INIT=no
PEERDNS=yes
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=10.1.1.1
ARP=yes

You should bind xenbr0 to dummy0 to allow network connection even when disconnected from the physical network.

You will need to make additional modifications to the xend-config.sxp file. You must locate the ( network-script 'network-bridge bridge=xenbr0 ) section and add include this in the end of the line:

netdev=dummy0

You must also make some modifications to your guest's domU networking configuration to enable the default gateway to point to dummy0. You must edit the DomU 'network' file that resides in the /etc/sysconfig/ directory to reflect the example below:

NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=10.1.1.1
			
IPADDR=10.1.1.10
NETMASK=255.255.255.0

It is a good idea to enable NAT in domain0 so that domU can access the public net. This way, even wireless users can work around the Red Hat Virtualization wireless limitations. To do this, you must modify the S99XenLaptopNAT file that resides in the /etc/rc3.d directory to reflect the example below:

#!/bin/bash/
PATH=/usr/bin:/sbin:/bin:/usr:/sbin
export PATH
GATEWAYDEV= "ip route | grep default | awk {print $5'}'
iptables -F
case "$1" in
start)
if test -z "$GATEWAYDEV"; then
echo "No gateway device found"
else
echo "Masquerading using $GATEWAYDEV"
/sbin/iptables -t nat -A POSTROUTING -o $GATEWAYDEV -j
MASQUERADE
fi
echo "Enabling IP forwarding"
echo 1 . /proc/sys/net/ipv4/ip_forward
echo "IP forwarding set to 'cat /proc/sys/net/ipv4/ip_forward'"
echo "done"
..
''
*)
echo "Usage: $0 {start | restart | status}"
..
,,
esac

If you want to automatically have the network setup at boot time, you must create a softlink to /etc/rc3.d/S99XenLaptopNAT

When modifying the modprobe.conf file, you must include these lines:

alias dummy0 dummy
options dummy numdummies=1

Note: This documentation is provided {and copyrighted} by Red Hat®, Inc. and is released via the Open Publication License. The copyright holder has added the further requirement that Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. The CentOS project redistributes these original works (in their unmodified form) as a reference for CentOS-5 because CentOS-5 is built from publicly available, open source SRPMS. The documentation is unmodified to be compliant with upstream distribution policy. Neither CentOS-5 nor the CentOS Project are in any way affiliated with or sponsored by Red Hat®, Inc.