ip host command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 02:14 PM - edited 03-07-2019 08:28 PM
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
- Labels:
-
Other Switching
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 02:23 PM
I found this doing a quick search. Hope it helps.
https://learningnetwork.cisco.com/thread/65690
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 02:24 PM
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).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2014 06:37 PM
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
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2019 09:12 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2019 10:09 AM
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2019 09:59 AM
it simple mapper an ip address to a name
*** Rate All Helpful Responses ***
