免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3616 | 回复: 9
打印 上一主题 下一主题

[FreeBSD] 请问关于freebsd traceroute [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-08 22:37 |只看该作者 |倒序浏览
请问各位前辈,我的freebsd在traceroute 内网IP的时候没有任何问题能收到回应
但是当我traceroute 外网的域名时候发现freebsd根本没有封ICMP包去做
我tcpdump | grep icmp
获者tcpdump | grep udp 都没有输出
但是我traceroute 内网的ip时都有发送ICMP包探测
DNS没有问题能成功解析
我是通过代理上网的方式
FB是我的虚拟机IP 10.137.200.171
我实体机器的IP 10.137.200.130
下面是一些信息如果还需要什么信息,我尽量提供
traceroute 内网ip
  1. traceroute to 10.137.66.11 (10.137.66.11), 64 hops max, 40 byte packets
  2. 1  10.137.200.129 (10.137.200.129)  0.975 ms  0.574 ms  0.633 ms
  3. 2  10.137.255.37 (10.137.255.37)  0.701 ms  0.827 ms  0.566 ms
  4. 3  10.137.66.11 (10.137.66.11)  0.643 ms  0.392 ms  0.436 ms
复制代码

tcpdump回复
  1. 06:21:34.320778 IP 10.137.66.11 > 10.137.200.171: ICMP 10.137.66.11 udp port 33441 unreachable, length 48
  2. 06:21:34.325791 IP 10.137.66.11 > 10.137.200.171: ICMP 10.137.66.11 udp port 33442 unreachable, length 48
  3. 06:21:34.326216 IP 10.137.66.11 > 10.137.200.171: ICMP 10.137.66.11 udp port 33443 unreachable, length 48
复制代码

traceroute 外网域名
  1. BSD-1# traceroute [url]www.baidu.com[/url]
  2. traceroute: Warning: [url]www.baidu.com[/url] has multiple addresses; using 121.14.89.10
  3. traceroute to [url]www.a.shifen.com[/url] (121.14.89.10), 64 hops max, 40 byte packets
  4. 1  * * *
  5. 2  * * *
  6. 3  * * *
  7. 4  * * *
  8. 5  * * *
复制代码

tcpdump 回显
  1. BSD-1# tcpdump | grep udp
  2. tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
  3. listening on em0, link-type EN10MB (Ethernet), capture size 96 bytes
  4. 06:36:58.949868 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  5. 06:37:00.267766 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  6. 06:37:01.200638 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  7. 06:37:03.846236 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  8. 06:37:04.914921 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  9. 06:37:09.692171 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  10. 06:37:10.715016 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  11. 06:37:11.229696 IP 10.137.200.171 > 10.137.65.101: ICMP 10.137.200.171 udp port 60741 unreachable, length 36
  12. 06:37:13.083548 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  13. 06:37:41.504205 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  14. 06:37:43.003802 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  15. 06:37:44.503903 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  16. 06:37:46.004138 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  17. 06:37:47.503924 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  18. 06:37:49.006303 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  19. 06:37:49.329246 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  20. 06:37:50.022742 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  21. 06:37:50.504028 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  22. 06:37:50.914962 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  23. 06:37:52.006853 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  24. 06:37:53.503794 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  25. 06:37:55.004867 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  26. 06:37:56.504184 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  27. 06:37:58.003946 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  28. 06:37:59.504176 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  29. 06:38:01.004455 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  30. 06:38:02.504180 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  31. 06:38:04.004227 IP 10.137.65.102 > 10.137.200.130: ICMP 10.137.65.102 udp port netbios-ns unreachable, length 104
  32. 06:38:05.366326 IP 10.137.200.171 > 10.136.33.195: ICMP 10.137.200.171 udp port 6112 unreachable, length 36
  33. ^C701 packets captured
  34. 703 packets received by filter
  35. 0 packets dropped by kernel
复制代码


设置的代理
  1. setenv HTTP_PROXY 'http://XXXXX:password@10.137.255.176:3128'
  2. setenv FTP_PROXY 'http://XXXXX:password@10.137.66.59:3128'
复制代码

论坛徽章:
0
2 [报告]
发表于 2010-01-08 23:37 |只看该作者
traceroute -P icmp 试试

论坛徽章:
0
3 [报告]
发表于 2010-01-08 23:54 |只看该作者
其实一般说来,你如果想抓 ICMP 包,可以 tcpdump -n -i <ifname> icmp
如果是 UDP,就换成 udp

其中 <ifname> 是用来连接外网的设备

论坛徽章:
0
4 [报告]
发表于 2010-01-09 10:11 |只看该作者
说说你的网络结构,看看代理服务器上有没有做禁止ICMP回复报文的设置

论坛徽章:
0
5 [报告]
发表于 2010-01-09 14:46 |只看该作者
呵呵 謝謝樓上的幫忙我晚上回去試試,平時一般都用WIN下面的抓包工具沒有
用過TCPDUMP,斑竹的意思是需要用ICMP協議來traceroute麼?BSD自己應該是用的
UDP的方式把記得以前看TCP/IP詳解時候提到過
lock0n 朋友代理服務器并不是我在管,但是他應該是沒有禁用ICMP回顯的。。。
至于網絡結構就是我的機器經過2跳路由到代理服務器,然后代理出去
我發現我當時應該把tcpdump | grep udp 貼出來那個上面就很明顯的顯示出了中間的幾跳交換機
返回的超時數據包呵呵

论坛徽章:
0
6 [报告]
发表于 2010-01-09 20:34 |只看该作者
多谢 斑竹真的可以为什么啊? 用UDP的不行呢?

论坛徽章:
0
7 [报告]
发表于 2010-01-10 02:16 |只看该作者

回复 #6 czljim 的帖子

1、部分路由器出于安全或者减小负载等考虑,可能禁止了 UDP traceroute 用到的端口
2、你运行 tcpdump 时没有加 -n 参数,使得 tcpdump 不断耗费时间在查询 IP 地址的反向记录上
3、grep 命令的输入是有缓冲的,当读取缓冲装满时才会输出,这会造成问题。grep icmp / grep udp 确实可以筛选出包含 icmp 或者 udp 的记录,但正确的用法是 tcpdump icmp 或者 tcpdump udp,其实这里小写的 icmp / udp 是匹配表达式,例如 tcpdump -n -i re0 host 192.168.0.1 and port 80 and tcp 表示仅抓取 re0 设备上的分组数据,不反向查询,仅匹配和 192.168.0.1 有关的 80/tcp 上的数据往来。

论坛徽章:
0
8 [报告]
发表于 2010-01-10 08:15 |只看该作者
恩谢谢斑竹了哈哈,对了有没有什么好的PORTS包镜像站点阿,最好HTTP的,这边代理FTP代理不出去额.....

论坛徽章:
0
9 [报告]
发表于 2010-01-10 11:02 |只看该作者

回复 #8 czljim 的帖子

建议您访问
http://mirrorlist.freebsd.org/

然后选择速度比较快的一个镜像。

我用的是 ftp.chg.ru,FTP/HTTP IPv4/IPv6 都可以。

论坛徽章:
0
10 [报告]
发表于 2010-01-10 14:18 |只看该作者
太谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP