Chapter 9: Host and Guest System Network Configuration
9.5 Guest Operating System Networking Configuration
Each guest operating system has its own interface for networking settings; the following sections provide an overview of each major one. To configure your network interface properly and get it talking to the host system and/or the rest of the world, you’ll need to know the essentials for an IP connection, such as how to enter an IP address or choose DHCP configuration.
Note If you choose to configure your guest operating system’s network interface manually on a host−only network, pick an IP address where the last number is between 3 and 127, because VMware’s default DHCP server configuration (described in the previous section) reserves the numbers 128 through 254.
Unless you build a custom network, the subnet mask for a host−only network is always 255.255.255.0.
To view (and set) your network connections on guest operating systems, use ifconfig (Unix) or ipconfig (Windows) from the command line. When you view your settings, turn on the verbose options (so that you’ll get more information), using ifconfig −a and ipconfig /all. (Some versions of Unix require you to use −a to view any configuration whatsoever.)
Test the connection with a ping command on both your host and guest. From the guest, ping your host system with a command like ping 172.16.144.1. Then do the same thing from your host system to the guest.
All modern operating systems can deal with more than one Ethernet interface; VMware offers up to three for its guest systems.
9.5.1 Windows 95, 98, and Me
To configure your network interface under Windows 95/98/Me, do the following:
1.
Open the Network control panel and click the Configuration tab.
2.
You should see a TCP/IP • AMD PCNET Family Ethernet Adapter (PCI−ISA) component.
Double−click it, and the TCP/IP Properties window should appear.
3.
On the IP Address tab, choose DHCP with Obtain an IP address automatically, or enter an IP address.
4.
If you choose manual configuration and have a bridged or NAT network, add your default gateway on the Gateway tab.
9.5.2 Windows NT
To configure your network interface under Windows NT, do the following:
1.
On the Network control panel, click the Protocols tab to bring up the TCP/IP Protocol Properties window.
2.
Select the IP Address tab; pick the interface you want to configure under Adapter and then set the appropriate options for DHCP or static addresses.
9.5.3 Windows 2000/XP
To configure your network interface under Windows 2000 or XP, do the following:
1.
Open the Network and Dialưup Connections (2000) or Network Connections (XP) folder on the control panel.
2.
Double−click the Local Area Connection corresponding to the VMware network interface that you want to change to get a status window.
3.
Configure the interface by clicking Properties.
4.
For the TCP/IP settings, display the Internet Protocol (TCP/IP) Properties window (a new window).
The selections for obtaining addresses automatically here specify DHCP configuration.
9.5.4 Linux
Each Linux distribution has its own way of configuring an Ethernet interface. Still, it’s always possible to set up the interface manually with the ifconfig command.
For example, this sets the guest system’s IP address to 172.16.144.99:
ifconfig eth0 172.16.144.99 netmask 255.255.255.0 up
As mentioned in Chapter 6, eth0 is the first Ethernet interface on the system.
To add a default route for this example, you can use the route command:
route add default gw 172.16.144.1
As far as the various Linux distributions go, every configuration tool ultimately creates or modifies some file on your system. (For example, when you configure an interface in Red Hat 7 [Config − Networking − Client tasks − Basic host information in the linuxconf program], you change a
/etc/sysconfig/network−scripts/ifcfg−ethn file.)
If your network has a static (non−DHCP) configuration, you’ll find that each distribution ultimately runs ifconfig in some network startup script at boot time. For example, Debian’s /etc/init.d/networking script performs this function.
DHCP is another story. Most Linux distributions use the ISC dhclient program to get a DHCP connection at boot time if the Ethernet interface is set to an automatic configuration. Red Hat, however, uses a program called pump for DHCP client configuration.
By default, dhclient tries to configure all network interfaces, but you can single out an interface by supplying an argument. For instance, dhclient eth0 configures the DHCP server for the first Ethernet interface.
9.5.5 FreeBSD
As with Linux, you can manually specify the IP settings for VMware’s lnc interfaces with the ifconfig command. You can either set the options manually in /etc/rc.conf or use the /stand/sysinstall command. For the sysinstall utility, go through the menus as follows: Configure • Networking • Interfaces (press space on this option instead of enter); then specify lncn, where n is the number of the interface you want to configure.
You can also change the settings in /etc/rc.conf. If you’re configuring interface lnc0, use something like
ifconfig_lnc0="172.16.144.103 netmask 255.255.255.0"
for a fixed configuration. To use DHCP, use the following instead:
ifconfig_lnc0="DHCP"
9.5.6 NetBSD
In NetBSD, put your parameters for your interfaces in /etc/ifconfig.len. For example, /etc/ifconfig.le0 could look like this:
172.16.144.98 netmask 255.255.255.0
To use DHCP with NetBSD, don’t create this file; instead, edit /etc/rc.conf and add
dhclient=YES
To run DHCP on only one specific interface (say le0), use
dhclient_flags="le0"
You can manually set the default gateway for any BSD system as follows:
route add default 172.16.144.1
Checking the routing table is the same as in Linux; use netstat −nr.