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 # 18.104.22.168 fred fred-200 22.214.171.124 barney 126.96.36.199 wilma # # remote network gateway 188.8.131.52 fred-201
Host fred is on both the 184.108.40.206 and 220.127.116.11 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 18.104.22.168 fred 349175 104 542039 ...