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.
#!/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 |
 |
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 |
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.