Installation guide

echo "IP forwarding set to `cat /proc/sys/net/ipv4/ip_forward`"
echo "done."
;;
*)
echo "Usage: $0 {start|restart|status}"
;;
esac
Co n f ig u rin g d n smasq f o r t h e DNS, DH CP an d t f t p b o o t services
One of the challenges in running virtualization on a laptop (or any other computer which is not
connected by a single or stable network connection) is the change in network interfaces and
availability. Using a dummy network interface helps to build a more stable environment but it also
brings up new challenges in providing DHCP, DNS and tftpboot services to your guest virtual
machines. The default DHCP daemon shipped with Red Hat Enterprise Linux and Fedora Core will
not listen on dummy interfaces, and your DNS forwarded information may change as you connect to
different networks and VPNs.
One solution to the above challenges is to use dnsmasq, which can provide all of the above services
in a single package, and also allows you to configure services to be available only to requests from
your dummy interface. Below is a short write up on how to configure dnsmasq on a laptop running
virtualization:
Get the latest version of dnsmasq from here.
Documentation for dnsmasq can be found here.
Copy the other files referenced below from http://et.redhat.com/~jmh/tools/xen/ and grab the file
dnsmasq.tgz. The tar archive includes the following files:
nm-dnsmasq can be used as a dispatcher script for Net wo rkMan ag er. It will be run every
time Net workManag er detects a change in connectivity and force a restart or reload of
dnsmasq. It should be copied to /etc/NetworkManager/dispatcher.d/nm-dnsmasq
xenDNSmasq can be used as the main startup or shutdown script for
/etc/init.d/xenDNSmasq
dnsmasq.conf is a sample configuration file for /etc/dnsmasq.conf
dnsmasq is the binary image for /usr/local/sbin/dnsmasq
Once you have unpacked and built dnsmasq (the default installation will be the binary into
/usr/local/sbin/dnsmasq) you need to edit your dnsmasq configuration file. The file is
located in /etc/dnsmaqs.conf.
Edit the configuration to suit your local needs and requirements. The following parameters are
likely the ones you want to modify:
The interface parameter allows dnsmasq to listen for DHCP and DNS requests only on
specified interfaces (such as dummy interfaces). Note that dnsmasq cannot listen to public
interfaces as well as the local loopback interface simultaneously. Add another interface line
for more than one interface. interface=dummy0 is an example which listens on the dummy0
interface.
Modify dhcp-range to enable the integrated DHCP server. You will need to supply the range of
addresses available for lease and optionally a lease time. If you have more than one network,
you will need to repeat this for each network on which you want to supply DHCP service. An
example would be (for network 10.1.1.* and a lease time of 12 hours): dhcp-
Red Hat En t erp rise Lin ux 5 Virt ualizat ion Guid e
14 4