cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
502
Views
3
Helpful
9
Replies

Hostname appears different on IOS router

DuBu
Level 1
Level 1

Hi

We have 2  8300 series routers at a given location.

1. Router 1 -- ABC

2. Router 2 -- XYZ

When I ssh to router "ABC" using hostname it displays the prompt as -- "XYZ" >

When I check the running config in this scenario, the hostname mentioned shows "XYZ".

However , when i ssh to "ABC" using its ip address it displays the correct prompt -- "ABC" >

When I check the running config, the hostname displays "ABC" which is correct.

I wanted to understand the difference in behavior when trying to ssh using Hostname vs when ssh using IP address

 

 

 

 

9 Replies 9

check below

MHM

Sorry @MHM Cisco World , could you please explain what you meant?

how you can access to router via SSH ? you need password, how you dd this password in router ?

MHM

yes, i do enter the password in both scenarios, i.e.  when I ssh to the router using hostname and also when i ssh to the router using IP address.

this password config in router under ""line vty"" or via ""username xxx password xxx""?

MHM

DuBu
Level 1
Level 1

I dont see any ""username xxx password xxx"" config...There is password info mentioned under "line vty" config as follows

line vty 0 4
access-class vty_access_in in vrf-also
password 7 083A5F173615543A333317172B6120
transport preferred none
transport input ssh
transport output telnet ssh
line vty 5 15
access-class vty_access_in in vrf-also
password 7 083A5F173615543A333317172B6120
transport preferred none
transport input ssh
transport output telnet ssh

 

Harold Ritter
Level 12
Level 12

Hi @DuBu ,

If you get to the wrong device when using the host name and to the correct device when using the IP address then it is most likely a DNS issue. Can you check what the is the IP address linked to host "ABC" and change it to correct the issue.

You can use DNS tools like dig, nslookup, host, etc to verify the host name to IP address mapping.

Regards,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello @DuBu ,

check on OS shell how hostname is solved using

nslookup <ABC>

as suggested you may be facing a wrong DNS entry

Hope to help

Giuseppe

 

Hello
Curious where are you initiating the ssh connection?


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul
Review Cisco Networking for a $25 gift card