Specifications

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
#
# XenLaptopNAT Startup script for Xen on Laptops
#
# chkconfig: - 99 01
# description: Start NAT for Xen Laptops
#
# 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
18. Starting Domains Automatically During System
Boot
Starting Domains Automatically During System Boot
You can configure your guests to start automatically when you boot the system. To do this, you
Chapter 18. Red Hat Virtualization Troubleshooting
94