2. Internet Connection Sharing

This tool configures your system so that it acts as a gateway to the Internet for other machines connected to it via a LAN. This is very useful at home for example, if you wish all computers to access the Internet through the same Internet link.

Figura 15.6. A Simple Gateway Configuration

A Simple Gateway Configuration

The overall procedure is the following:

  1. Configure your Internet access (Seção 1, “Network and Internet Connection Management”). In order for your machine to act as a gateway, you will need an already configured and working connection to the Internet, plus a network connection to your LAN. This implies at least two interfaces, for example, a modem and an Ethernet card.

  2. Setup the gateway (Seção 2.1, “The Gateway Connection Wizard”)

  3. Configure the other local machines as clients (Seção 2.2, “Configuring the Clients”)

[Atenção]Atenção

This wizard will also configure a firewall to block most connections from the Internet. You are encouraged to check that the firewall configuration (Seção 3, “ Protegendo sua Conexão Internet com o DrakFirewall ”) suits you after completing the wizard.

After you complete this wizard, all computers on the LAN will be able to access the Internet. Their configuration will be automated due to the DHCP server which will be installed on your gateway, and the web access will be optimized due to the use of the Squid transparent proxy cache.

2.1. The Gateway Connection Wizard

These are the steps that compose that wizard:

  1. Choosing the Internet Interface

    You first need to specify the name of the interface connected to the Internet. Make sure you select the correct one: use the examples in the on-line help as a guide.

  2. Choosing The LAN Network Adapter

    If you have more than one Ethernet interface, and depending on what you chose as your Internet interface, the wizard might ask you to select the one connected to your LAN. Make sure you select the correct one. Note that all traffic to and from this network passing through the gateway will be masqueraded, that is: it will appear to come from the gateway instead of from the LAN.

  3. Local Area Network Settings

    Figura 15.7. Configuring The LAN

    Configuring The LAN

    At this point, if it is the 1st time the system has been configured as a gateway, the wizard proposes default parameters for the new local network to be managed. Check those values are not already in use in your network, and go on to next step.

    Otherwise, the wizard will first offer to reconfigure the LAN interface so that it will be compatible with the gateway services. It is recommended that you leave the default options and click on Next. Then, all the software needed will be installed.

  4. DNS Configuration

    If you plan on having a local name server on your machine, you can check the box. Otherwise you can choose to use the name server of your provider. If you don't know what is a name server, leaving the box checked is safe.

  5. DHCP Server Configuration

    Installing a DHCP server on your machine will allow all client machines to have their network configuration automatically done. Otherwise you will have to configure each of the clients by hands: IP address, network, gateway, DNS.

  6. Proxy Caching Server (SQUID)

    A caching server records the Internet pages requested by local browsers. Then if the same page is asked again by someone else, it'll be able to serve it without needing to retrieve it again from the Internet, thus saving bandwidth, and improving response time. This is most useful for many clients.

    The application used to perform this task is Squid.

When the wizard is completed, required packages are installed and configured.

2.2. Configuring the Clients

Configuration of the clients mainly depends on whether you chose to install a DHCP server on your gateway or not. By configuring the clients on the local network to use DHCP, they will automatically use the Mandriva Linux machine as a gateway to the Internet. This works for Windows®, GNU/Linux and any other OS which supports DHCP.

If you have no DHCP server, you will have to configure each of your machines manually, according to the network settings configured during the connection sharing wizard.

For DHCP, on a Mandriva Linux client system, make sure you selected DHCP in the Protocol pull-down list when configuring the network as shown in Figura 15.8, “Configuring a Client to Use DHCP”.

Figura 15.8. Configuring a Client to Use DHCP

Configuring a Client to Use DHCP