LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 949|回复: 8

[offtopic..]在不同网站查看IP结果为什么不一致?

[复制链接]
发表于 2009-5-1 14:29:00 | 显示全部楼层 |阅读模式
刚刚想在 conky 里加一行Public Ip, 试了下几个网站, 结果有两种。。比如
http://www.ip-adress.com/
http://5-ip.com/
前者是国外的网站, 后者是国内的, 查了几个国外网站得到的ip大多和前者一致。
比如
http://riivo.eu/php/ip.php
http://www.whatismyip.com/
http://www.whatsmyip.org/

另外, 同一个网站得到的ip也会变化,
http://5-ip.com/ 的结果大多要么是 61.*.*.* 要么是 219.*.*.* , 并且, 有一次得到了那个国外网站一致得出的结果, 124.*.*.* 。
http://www.ip-adress.com/ 的结果大多时候是 124.*.*.* , 但有时候也会出现 219.*.*.*

这是怎么回事?
 楼主| 发表于 2009-5-1 15:11:07 | 显示全部楼层
  1. #!/bin/bash
  2. echo -n 'ip-address.com::       ' ; curl -s http://www.ip-adress.com/|grep "My IP address" | cut -d ' ' -f 4 | cut -d '<' -f 1
  3. echo -n '5-ip.com::             ' ; curl -s  http://5-ip.com/|sed -n '/您的IP地址/,+2p' | grep br | cut -d ' ' -f 1
  4. echo -n 'whatsmyip.net::        ' ; curl -s http://whatsmyip.net/|sed -n  '/Your IP is/,+2p'|grep 'textarea' | cut -d '>' -f 2 | cut -d '<' -f 1
  5. echo -n 'whatsmyip.org.uk::     ' ; curl -s http://www.whatsmyip.org.uk/|grep 'Your ip address is' | cut -d '#' -f 2 | cut -d ' ' -f 5 | cut -d '<' -f 1
  6. echo -n 'sng.net::              ' ; curl -s http://www.sng.net/ | sed -n '/Address:/,+2p'|sed -n '2p' | cut -d '<' -f 1 | sed 's/ //g'
  7. echo -n 'wieistmeineip.com::    ' ; curl -s http://www.wieistmeineip.com/ | grep 'Your IP' | cut -d ':' -f 2 | cut -d '>' -f 4 | cut -d '<' -f 1
  8. echo -n 'whatismyipaddress.com::' ; curl -A Opera -s http://whatismyipaddress.com/ | grep 'Your IP address is' | cut -d ' ' -f 6 | cut -d '<' -f 1
复制代码

写了这个脚本, 你可以从不同网站查看你的ip,
我这里运行的结果是出现3个不同的IP, 并且每次运行后的结果都会发生变化
回复 支持 反对

使用道具 举报

发表于 2009-5-1 15:45:51 | 显示全部楼层
我这里有2个IP.

5-ip.com,whatismyipaddress.com 是一个IP,其余的是另一个。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-1 15:47:34 | 显示全部楼层
@cwjiof

那同一个网站的结果每次查都一致吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-1 16:07:57 | 显示全部楼层
添加更多网站。。。前边是国内,后边国外。
  1. #!/bin/bash
  2. echo -n '5-ip.com::             ' ; curl -s  http://5-ip.com/|sed -n '/您的IP地址/,+2p' | grep br | cut -d ' ' -f 1
  3. echo -n '123cha.com::           ' ; curl -s http://www.123cha.com/ | grep "http://www.123cha.com/ip/?q=" | awk -F " '{gsub(/http:\/\/www.123cha.com\/ip\/\?q=/,"");print $2}'
  4. echo -n 'sogou.com::            ' ; curl -s http://www.sogou.com/features/ip.jsp | grep "http://www.sogou.com/web?query=" | cut -d "'" -f 2
  5. echo -n 'ikaka.com::            ' ; curl -s http://www.ikaka.com/ip/ | awk '/++/{print $5}' | head -1
  6. echo -n 'tongcha.com::          ' ; curl -s http://www.tongcha.com/index-ip.php | grep newmolv | head -1 | cut -d '>' -f 2 | cut -d '<' -f 1
  7. echo -n 'ip38.com::             ' ; curl -s http://www.ip38.com/ | grep ipad | head -1 | cut -d '>' -f 3 | tr -cd '[:digit:][=.=]\n'
  8. echo -n 'webmasterhome.cn::     ' ;  curl -s http://ip.webmasterhome.cn/ | awk -F " '/id="IP_Data"/{print $8}'
  9. echo -e "\n+************************************+\n"
  10. echo -n 'ip-address.com::       ' ; curl -s http://www.ip-adress.com/|grep "My IP address" | cut -d ' ' -f 4 | cut -d '<' -f 1
  11. echo -n 'whatsmyip.net::        ' ; curl -s http://whatsmyip.net/|sed -n  '/Your IP is/,+2p'|grep 'textarea' | cut -d '>' -f 2 | cut -d '<' -f 1
  12. echo -n 'whatsmyip.org.uk::     ' ; curl -s http://www.whatsmyip.org.uk/|grep 'Your ip address is' | cut -d '#' -f 2 | cut -d ' ' -f 5 | cut -d '<' -f 1
  13. echo -n 'sng.net::              ' ; curl -s http://www.sng.net/ | sed -n '/Address:/,+2p'|sed -n '2p' | cut -d '<' -f 1 | sed 's/ //g'
  14. echo -n 'wieistmeineip.com::    ' ; curl -s http://www.wieistmeineip.com/ | grep 'Your IP' | cut -d ':' -f 2 | cut -d '>' -f 4 | cut -d '<' -f 1
  15. echo -n 'whatismyipaddress.com::' ; curl -A Opera -s http://whatismyipaddress.com/ | grep 'Your IP address is' | cut -d ' ' -f 6 | cut -d '<' -f 1
复制代码
回复 支持 反对

使用道具 举报

发表于 2009-5-1 16:22:41 | 显示全部楼层
间隔1min查询,是一致的。
间隔20min,还是一样。
40min 后,出现了第三个IP,whatismyipaddress

确实奇怪。顛覆了常识。看来又是 GFW 干的好事。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-5-1 16:28:49 | 显示全部楼层
我的变的厉害。。
回复 支持 反对

使用道具 举报

发表于 2009-5-1 18:04:59 | 显示全部楼层
traceroute看看你出去的时候走的网关是不是一样。应该是ISP根据线路区分了出口。
回复 支持 反对

使用道具 举报

发表于 2009-5-1 21:12:58 | 显示全部楼层
你在不同的时间ping 百度的域名,返回的信息中百度的IP也是不同的,可能是运营商的线路不同造成的吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表