cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
21882
Views
10
Helpful
6
Replies

ip host command

mayambanzumba
Level 1
Level 1

 

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

6 Replies 6

josephsmar1
Level 1
Level 1

 

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

 

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

brianwilliams99
Level 1
Level 1

 

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).

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

HTH

Rick

Yes. The failover from first IP to second IP in (IP host xx.yy.com 10.0.0.9 10.0.0.13) 


@Richard Burts wrote:

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



does not work on PING, but works on other tcp command such as ssh, telnet.  I want to thank the author for pointing this out. I was only trying PING initially to test thinking if PING does not work nothing else will work. But it turned out to not to b true

easy and clear
thank you

Jaderson Pessoa
VIP Alumni
VIP Alumni
Hello,

it simple mapper an ip address to a name
Jaderson Pessoa
*** Rate All Helpful Responses ***