Appendix A. IP Packet Routing

Routers and gateways join multiple IP networks, forwarding packets between the networks. A single organization may have multiple IP networks because it has multiple buildings, multiple sites, or multiple subgroups that require their own networks. For example, the history and math departments at a university are likely to each have their own IP networks, just as an engineering and manufacturing facility separated by several miles will have independent networks. Section 17.2 discussed network partitioning using routers, and some of the performance considerations when running NFS and NIS in an internetworked environment. This appendix explores the mechanics of IP packet routing in greater detail.

Routers and their routing tables

A router has a unique IP address on each network interface; associated with each IP address is also a unique hostname. A common convention is to add a suffix associated with the network number to the name of the host used on the each network interface as shown in this /etc/hosts fragment:[1]

# 
# local network hosts 
# 
192.9.200.1     fred fred-200
192.9.200.2     barney 
192.9.200.3     wilma 
# 
# remote network gateway 
192.9.201.1     fred-201

Host fred is on both the 192.9.200.0 and 192.9.201.0 networks, and has a distinct name and address on each. netstat -i shows both interfaces and their associated networks and hostnames:

% netstat -i Name Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue hem0 1500 192.9.200.0 fred 349175 104 542039 ...

Get Managing NFS and NIS, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.