Table of Contents
This chapter will show you how to make different operating systems use a GNU/Linux box with masquerading set up as a gateway to the outside world. The configuration tests on the following operating systems all proved successful:
Digital VAX Stations 3520 and 3100, with UCX (TCP/IP stack for VMS);
IBM AIX (on RS/6000), OS/2 (including Warp 3) and OS400 (on OS/400);
Microsoft DOS (with the NCSA Telnet package, partial DOS Trumpet support), Windows 3.1 (with the Netmanage Chameleon package) and Windows For Workgroup 3.11 (with TCP/IP package);
Microsoft Windows 95, Windows 95 OSR2, Windows 98, Windows 98se;
Microsoft Windows NT 3.51, 4.0 and 2000 (both workstation and server);
Let's go through the configuration of a few of them. If your system is not listed, a simple way to proceed is to “just tell the OS which machine to use as a gateway”. Note that our main focus here is the gateway side of the network: therefore, we won't touch on DNS, file sharing or connection schemes problems. Thus, for this chapter to be of any use to you, you need a well-configured local network. Refer to your system's documentation to set it up properly, paying special attention to the DNS settings.
What follows assumes that you are set up on a class C network: your different machines all have IP addresses like 192.168.0.x, with a netmask set to 255.255.255.0, and use eth0 as the network interface. We also take for granted that your gateway's IP address is set to 192.168.0.1, and that your machines can each “talk” to the gateway (test the latter with the ping command or its equivalent in your environment).
There are (at least) three ways to go about this.
This is probably the fastest way to proceed. However, when you next restart your network layer or your whole system, any configuration change you made will have disappeared!
If eth0 is the network interface through which you access the gateway, (as root) issue this simple command: route add default gw 192.168.0.1 eth0 That's it! If the gateway is properly configured and connected to the Internet, the whole world is now within your reach through your favorite web browser.
To maintain the configuration each time the system is shut down and restarted, we need to edit a configuration file. Its name is /etc/sysconfig/network on a Mandrake Linux machine (it may be different on yours). Open it with your usual text editor, then add the following lines:
GATEWAYDEV="eth0" GATEWAY="192.168.0.1"
You may now restart your network layer with: service network restart
To install the configuration automatically, it's just about putting the right parameters in the configuration wizard. Refer to the Starter Guide's Internet Configuration. When you are configuring a local network Internet connection, the first step offers to configure the network in manual or automated mode (DHCP):
Simply put the right information in it. If you have a bootp or DHCP server on your local network, simply check the Automatic IP box, and your configuration is done. If you have a static IP address for your machine, enter it in the first field after making sure the Automatic IP check box is deactivated. Then click on the Next -> button.
Here, you must write in the correct IP addresses for the gateway and DNS server. Once this is done, follow the wizard's steps and restart the network when proposed. And that's it. Your network is properly configured and ready to run. The configuration is now permanent.