3. 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.

Figure 4.10. A Simple Gateway Configuration

A Simple Gateway Configuration

The overall procedure is the following:

  1. Configure your Internet access (Section 1, “Network and Internet Connection Management”). In order for your machine to act as a gateway, you 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 (Section 3.1, “The Gateway Connection Wizard”).

  3. Configure the other local machines as clients (Section 3.2, “Configuring the Clients”).

[Warning] Warning

This wizard also configures a firewall to block most connections from the Internet. You are encouraged to check that the firewall configuration (Section 3, “Securing your Internet Access via 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 is installed on your gateway, and the web access will be optimized due to the use of the Squid transparent proxy cache.

3.1. The Gateway Connection Wizard

These are the steps that the wizard takes:

  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 from the drop-down list. It should be the interface name you configured in the Internet Configuration Management tool.

  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[2]. Make sure you select the correct one.

  3. Local Area Network Settings

    Figure 4.11. 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 that these values are not already in use in your network, and proceed to the 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 required software is 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 a name server is, 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 hand: 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 for again by someone else, it is able to serve it without needing to retrieve it again from the Internet, thus saving bandwidth, and improving response time. This is very useful if there are many clients behind the gateway.

    The application used to perform this task is Squid.

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

[Note] Disable Connection Sharing

The next time you launch this wizard, the first step proposes either to reconfigure or to disable connection sharing.

3.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 have to configure each of your machines manually, according to the network parameters set on 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 Figure 4.12, “Configuring a Client to Use DHCP”.

Figure 4.12. Configuring a Client to Use DHCP

Configuring a Client to Use DHCP



[2] Note that all traffic to and from this network passing through the gateway will be masqueraded, that is: it will appear (from an Internet point of view) to come from the gateway instead of from the LAN.