Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements
Webcast-Catalyst9k
New Member

ip host command

 

What happens when the command ''ip host x.x.x.x x.x.x.x is used on a router?  Is the second address used if the first is not accessible?  I have two router, router A and router B.   Router B has two loopback address configured and there is a static router on router A to reach those address.  Router A has been configured with using the ip host command refering to the two loopbacks on router B.  When pinging the first loopback using an alias, the pings work, but when that loopback is shutdown, router A does not fall back to the second address to reach loopback2 on router B.  Am I missing something here?

 

RouterA#

 

ip host routerb x.x.x.x x.x.x.x

 

 

Routerb#

interface loopback1 ip address x.x.x.x

interface loopback2 ip address x.x.x.x

 


Make/Model:ISR Gen2 2921IOS: 15.2.4.S3

3 REPLIES
New Member

 I found this doing a quick

 

I found this doing a quick search. Hope it helps.

 

https://learningnetwork.cisco.com/thread/65690

New Member

 Now, for convenience sake

 

Now, for convenience sake only, we can create an entry on R1 (using the "IP HOST" command, that says "If I refer to the host name of R3, I really mean the IP address of R3 at 23.0.0.3"  Again, this is just a convenience, and not required.   Lets demonstrate a ping to R3 before the IP HOST command, and then after.


R1(config)#do ping r3

 

Translating "r3"
% Unrecognized host or address, or protocol not running.

 

R1(config)#ip host r3 23.0.0.3
R1(config)#do ping r3

 

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.0.0.3, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 40/80/112 ms
R1(config)#

 

So as a review, the command "IP Route" is to add static routes and the command "IP HOST" is to match a name with an IP (like a mini DNS system, or hosts file on a computer).

Hall of Fame Super Gold

The original poster gives us

The original poster gives us a few details about the issue he wants to understand but not enough detail for us to be sure about the issue. He describes router B which has two loopback interfaces configured and router A which apparently has routes to both loopbacks on router B. He suggests that there is an ip host command for router B which has the addresses of both loopback interfaces. And he asserts that only the first address is used when he attempts to ping using the name of host B.

 

I have tested the ip host command with multiple addresses specified. I know for some commands that it works by trying the first address and if that is not successful then trying the next address. I do not remember testing the ip host command using ping. And I can believe that ping might try only the first address. But I would like the original poster to try the telnet command using the name specified in the ip host command (or try using the ssh command). I am confident that these commands will try the first address and if it is not successful then will try the remaining addresses.

 

HTH

 

Rick

892
Views
0
Helpful
3
Replies
CreatePlease to create content