Before all the routing in Chapter 11 could work, the routers needed to know what
their interfaces' IP addresses were. In this figure, you see that the engineer
told R1 that its IP addresses were 150.1.1.250 (Ethernet1) and 150.1.2.1
(Ethernet2). Based on what the engineer told the router, the router can deduce
the subnet numbers connected to those two interfaces and the range of valid IP
addresses. (Although this book doesn't cover the details, for those of you who
have some router configuration experience, the engineer configures an IP address
and subnet mask for each interface. The router uses those two numbers to figure
out the range of valid IP addresses in each subnet.)
After R1's two interfaces are up and working, R1 knows a few
important facts:
-
The subnet numbers of the subnets that are connected to these
two interfaces.
-
The outgoing interface it should use to forward packets to
those subnets.
-
It does not need to send packets to another router so that it
can reach these subnets.
As a result, R1 simply adds a route for each directly connected
subnet to its routing table. A directly connected subnet is a
subnet that is, well, connected directly to a router. Back in Chapter 10, "Delivering the Goods to the Right Street
(IP) Address," you learned how all the IP hosts in the same IP subnet were
attached to the same physical network. In Figure 12-1, R1's Ethernet1 interface is attached to the
same physical Ethernet as Hannah; therefore, R1's Ethernet1 interface is
connected directly to the same subnet as Hannah. By adding a route for that
subnet to its routing table, R1 can then forward packets to Hannah and other
hosts in that subnet.
Likewise, R2 can add two routes to its routing table after the
network engineer has configured R2 and the two interfaces are working. Figure 12-2 shows the routing tables on R1
and R2, this time with the newly added directly connected routes shown.