Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP 9000 Networking: Installing and Administering PPP > Chapter 4 Common pppd Options

IP Routing Tips

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

The UNIX host's IP implementation sees PPP as a point-to-point network connection between two known addresses. If neither end-point resides on an IP-based local area network (LAN), packets simply flow in both directions as soon as the PPP connection is established. When the PPP link connects a remote host to a LAN, provides a connection between two LANs, or connects a host or a LAN to the worldwide Internet, the systems involved must be concerned with routing.

The examples below describe how to establish static routes when the machines boot. This is cumbersome, because any topology change requires that all the machines even remotely involved be reconfigured by editing their boot-time shell scripts. An alternative to static routes would be to use some automated system for updating all the hosts' routing tables. This is usually implemented as a daemon running on all the hosts involved. Many networks use the RIP protocol and run routed on their UNIX systems. If you use routed to propagate routing information, you will need to specify the PPP link as leading to a passive gateway.

Some sites prefer other routing protocols, and they use gated instead. If you use gated, you should invoke pppd with the netmask argument set to the same value as used on the LAN, if that subnet mask is different from the default for the class of your network.

Connecting a Host to a LAN

There are two conventional approaches for connecting a set of standalone hosts to a LAN via PPP.

Separate Network

The method that causes the least confusion is to assign a network or subnet for use by all remote machines. For example, suppose the organization's class B network number is 134.19, and they are subnetting with a class C-sized network mask of 0xffffff00. The departmental LAN is subnet 134.19.5.0, populated by hosts alpha (134.19.5.22) and bravo (134.19.5.41). A modem is attached to one of alpha's serial ports, and alpha's Login shell script is a generic one as shown below. A laptop named nomad wishes to connect to the network.

Figure 4-1 Title not available (Separate Network)

     #!/bin/sh
PATH=/usr/bin:/usr/etc:/etc:/bin
mesg n
stty -tostop
exec pppd `hostname`: idle 180

Designate subnet 6 for remote machines. Assign nomad the IP address 134.19.6.17. The PPP daemon on nomad would be started in the Autostart script as:

     pppd 134.19.6.17:134.19.5.22 auto idle 180

or, if all the names can be found in the local /etc/hosts (or resolved via NIS/YP, NetInfo, the Domain Name Service, or some other mechanism without first needing to bring up the PPP link), it could look like

     pppd nomad:alpha auto idle 180

The next line in nomad's Autostart would set up an IP route through the dial-in gateway:

     route add net 134.19.0.0 134.19.5.22 1

Alternatively, and necessarily if the LAN were also connected to the Internet:

     route add default alpha 1

Similarly, the pppd on alpha would be started as

     pppd alpha:nomad auto idle 180

bravo needs to have a network route for 134.19.6.0 pointing through alpha.

     route add net 134.19.6.0 alpha 1
ARP Table Manipulation

If a separate subnet number is unavailable for use by remote-access machines, it is possible to assign the remote machines addresses on the same subnet number as the departmental LAN. As above, suppose the organization's class B network number is 134.19, and they are subnetting with a class C-sized network mask of 0xffffff00. The departmental LAN is subnet 134.19.5.0, populated by hosts alpha (134.19.5.22) and bravo (134.19.5.41). A modem is attached to one of alpha's serial ports, and alpha's Login shell script is the generic one described above. A laptop named nomad wishes to connect to the network.

Assign nomad the IP address 134.19.5.114. The PPP daemon on nomad would be started in the Autostart script as

     pppd 134.19.5.114:134.19.5.22 auto idle 180

or, if all the names can be found in the local /etc/hosts:

     pppd nomad:alpha auto idle 180

The next line in nomad's Autostart would set up an IP route through the dial-in gateway:

     route add net 134.19.0.0 134.19.5.22 1

Figure 4-2 Title not available (ARP Table Manipulation)

Alternatively, and necessarily if the LAN were also connected to the Internet:

     route add default alpha 1

Similarly, the pppd on alpha would be started as:

     pppd alpha:nomad auto idle 180

Alpha would run the following command at boot time:

     arp -s nomad 8:0:9:30:dc:91 pub

(The hexadecimal sequence 8:0:9:30:dc:91 is the Mac address of the Ethernet card in alpha. Substitute the Mac address for your machine's Ethernet card in the command above.) This would add a permanent entry to alpha's ARP table, and cause it to be provided to other systems on the local Ethernet. Any time a host on that LAN tries to find the Ethernet address corresponding to nomad's IP address, the request will be answered with instructions to forward the packets to alpha. Since nomad appears to be directly connected to the LAN, no hosts on the LAN, nor on any other IP-connected network, would require routing table modifications.

Connecting Two LANs

Suppose gate-a (192.9.200.63) and ws-a (192.9.200.66) are on one LAN, with gate-a supporting a modem. Also suppose gate-b (134.19.14.29) and ws-b (134.19.14.102) are on another LAN across town, with gate-b supporting a modem.

Figure 4-3 Title not available (Connecting Two LANs)

gate-b's pppd should be started as

     pppd gate-b:gate-a auto idle 130

and gate-b should have a route like

    route add net 192.9.200.0 gate-a 1

ws-b should have a route like

     route add net 192.9.200.0 gate-b 1

Similarly, gate-a's pppd should be started as

     pppd gate-a:gate-b auto idle 130

and gate-a should have a route like

     route add net 134.19.14.0 gate-b 1

or, depending upon the structure of LAN b, maybe

     route add net 134.19.0.0 gate-b 1

ws-a should have a route like

     route add net 134.19.14.0 gate-a 1

or, again depending upon the structure of LAN b, perhaps

     route add net 134.19.0.0 gate-a 1

Connecting a Host or LAN to the Internet

If your LAN is connected to the Internet, or if you have arranged an account at a Point Of Presence (POP) of a PPP or SLIP-talking Internet connectivity vendor (say foo.net), then you should arrange for your default route to point through the gateway at the other end of the PPP connection. If hotel supported a modem to call a POP, it would start its PPP daemon like

     pppd hotel:pop.foo.net auto idle 240

and would arrange a route as

     route add default pop.foo.net 1

Any hosts on the LAN 'behind' hotel would set a route like

     route add default hotel 1

A machine's default route should point to the next machine along its path "outward" to the Internet. If hotel were a remote machine dialing into one machine in a complex corporate internet, its default route should point to that hub machine, expecting that the hub will deal with the issues of routing hotel's packets to their destination, whether on the LAN or elsewhere on the corporate internet or onto the Internet.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.