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.
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:
# # local network hosts # 126.96.36.199 fred fred-200 188.8.131.52 barney 184.108.40.206 wilma # # remote network gateway 220.127.116.11 fred-201
Host fred is on both the 18.104.22.168 and 22.214.171.124 networks, and has a distinct name and address on each. netstat -i shows both interfaces and their associated networks and hostnames:
netstat -iName Mtu Net/Dest Address Ipkts Ierrs Opkts Oerrs Collis Queue hem0 1500 126.96.36.199 fred 349175 104 542039 ...