Previous Next Contents

19. Linking two networks using PPP

There is basically no difference between linking a single Linux PC to a PPP server and linking two LANs using PPP on a machine on each LAN. Remember, PPP is a peer to peer protocol.

However, you DEFINITELY need to understand about how routing is established. Read the NET-2 howto and the Linux Network Administrator Guide (NAG). You will also find " TCP/IP Network Administration" (published by O'Reilly and Assoc - ISBN 0-937175-82-X) to be of invaluable assistance.

In order to link two LANs, you must be using different IP network numbers (or subnets of the same network number) and you will need to use static IP numbers - or use IP masquerade. If you want to use IP masquerade, see the IP masquerade mini-howto for instructions on setting that up.

19.1 Setting up IP numbers

Arrange with the network administrator of the other LAN the IP numbers that will be used for each end of the PPP interface. If you are using static IP numbers, this will also probably require you to dial into a specific telephone number.

Now edit the appropriate /etc/ppp/options[.ttyXX] file - it's a good idea to have a specific modem and port at your end for this connection. This may well require you to change your /etc/ppp/options file too - and create appropriate options.ttyXX files for any other connections too!

Specify the IP numbers for your end of the PPP link in the appropriate options file exactly as shown above for static IP numbers.

19.2 Setting up the routing

You must arrange that packets on your local LAN are routed across the interface that the PPP link establishes. This is a two stage process.

First of all, you need to establish a route from the machine running the PPP link to the network(s) at the far end of the link. If the link is to the Internet, this can be handled by a default route established by pppd itself at your end of the connection using the 'defaultroute' option to pppd.

If however, the link is only linking two LANs, then a specific network route must be added. This is done using a 'route' command in the /etc/ppp/ip-up script (see After the link comes up...) for instructions on doing this.

The second thing you need to do is to tell the other computers on your LAN that your Linux computer is actually the 'gateway' for the network(s) at the far end of the ppp link.

Of course, the network administrator at the other end of the link has to do all this too! However, as s/he will be routing packets to your specific networks, a specific network route will be required, not a default route (unless the LANs at the far and of the link are linking into you to access the Internet across your connection).

19.3 Network security

If you are linking you LAN to the Internet using PPP - or even just to a "foreign" LAN, you need to think about security issues. I strongly urge you to think about setting up a firewall!


Previous Next Contents