ubuntu-ip selection policy difference between ping and telnet

 

below u will see different ip selection for command 'ping' and telnet' in linux:

 

server1@myhost18:~$ telnet host1-26 60020

Trying 192.168.1.126...

Connected to host1-26.

Escape character is '^]'.

quit

|??)org.apache.hadoop.ipc.RPC$VersionMismatch>Server IPC version 3 cannot communicate with client version 13Connection closed by foreign host.

server1@myhost18:~$ 

server1@myhost18:~$ 

server1@myhost18:~$ ping host1-26

PING host1-26 (192.168.1.128) 56(84) bytes of data.

64 bytes from host1-26 (192.168.1.128): icmp_req=1 ttl=64 time=0.224 ms

 

  the root cause is there are two hostnames(duplicated) with different ips set in hosts file:

/etc/hosts:

192.168.1.128  host1-26

….

192.168.1.126  host1-26 a-26

 

 so the conclusion is that 'ping' will use the ip first occured,but telnet will use the last one.

 (yep,setting like this is a little malformed although;)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值