The host table defines a static name-to-address mapping on the router. This host table enables you to Telnet to the router defined in the host table by its name that is defined in the table. To create an IP host table, enter global configuration mode and use the following command:
Router# ip host name address
For demonstration purposes, create a host table on R1 for each lab router that will map the router name to its loopback IP address. (You will assign them to the routers in Chapter 7, "Router Interface Configuration.") Example 6-12 shows the host table configuration.
R1# configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# ip host R1 192.169.1.1 R1(config)# ip host R2 192.169.2.2 R1(config)# ip host R3 192.169.3.3 R1(config)# ip host R4 192.169.4.4 R1(config)# ip host R5 192.169.5.5 R1(config)# ip host R6 192.169.6.6 R1(config)# exit R1#
Note
In Example 6-12, 192.169. x. x is within the public addressing space used on the Internet. For our purposes, this is not an issue because the lab routers are not connected to the Internet. If your lab equipment is connected to the Internet, use RFC 1918 addressing instead.
Now examine the host table as it appears in the configuration by doing a show running-config. The highlighted portion of Example 6-13 displays the host table as it appears in the running-config.
R1# show running-config Building configuration... Current configuration: ! version 11.2 no service password-encryption no service udp-small-servers no service tcp-small-servers ! hostname R1 ! enable password falcons ! no ip domain-lookup ip host R1 192.169.1.1 ip host R2 192.169.2.2 ip host R3 192.169.3.3 ip host R4 192.169.4.4 ip host R5 192.169.5.5 ip host R6 192.169.6.6 ! interface Ethernet0 no ip address shutdown R1#
Now test the connection to R2 via a regular Telnet session. From R1, Telnet to R2 by its name-to-address mapping that you configured in the host table, as shown in Example 6-14.
R1# R2 Trying R2 (192.169.2.2)... % Destination unreachable; gateway or host down R1#
Why did the attempt fail? For it to work, you must have IP connectivity to the loopback interface that was defined in the host table. In addition, the destination router must have Telnet access configured on its vty lines. When IP connectivity is established and each router has the appropriate loopback IP address assigned, you'll be able to Telnet to each router by host name. Chapter 7 covers these configuration steps in greater detail.
Top |