在远程网络中,我们有两台机器。其中一台接收多播订阅,另一台不接收
机器一仅接收 igmp 查询:
sudo tcpdump -nevv -i eth1 -s 1515 igmp
tcpdump: listening on eth1, link-type EN10MB (Ethernet), capture size 1515 bytes
09:42:12.973995 00:24:97:23:54:3f > 01:00:5e:00:00:01, ethertype IPv4 (0x0800), length 60: (tos 0xc0, ttl 1, id 13227, offset 0, flags [none], proto IGMP (2), length 32, options (RA))
157.157.7.252 > 224.0.0.1: igmp query v2
而机器二接收到更多的 igmp 数据包:
09:46:12.986376 00:24:97:23:54:3f > 01:00:5e:00:00:01, ethertype IPv4 (0x0800), length 60: (tos 0xc0, ttl 1, id 13468, offset 0, flags [none], proto IGMP (2), length 32, options (RA))
157.157.7.252 > 224.0.0.1: igmp query v2
09:46:13.148086 00:e0:81:b3:f7:66 > 01:00:5e:14:14:8b, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 230.20.20.139: igmp v2 report 230.20.20.139
09:46:13.384097 00:e0:81:b3:f7:66 > 01:00:5e:1e:1e:6e, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 231.30.30.110: igmp v2 report 231.30.30.110
09:46:15.056105 00:e0:81:b3:f7:66 > 01:00:5e:14:14:b7, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 231.20.20.183: igmp v2 report 231.20.20.183
09:46:15.212094 00:e0:81:b3:f7:66 > 01:00:5e:00:00:fb, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 224.0.0.251: igmp v2 report 224.0.0.251
09:46:15.900096 00:e0:81:b3:f7:66 > 01:00:5e:14:14:24, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 230.20.20.36: igmp v2 report 230.20.20.36
09:46:16.036096 00:e0:81:b3:f7:66 > 01:00:5e:1d:1d:99, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 231.29.29.153: igmp v2 report 231.29.29.153
09:46:18.764102 00:e0:81:b3:f7:66 > 01:00:5e:14:14:8a, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 230.20.20.138: igmp v2 report 230.20.20.138
09:46:21.612091 00:e0:81:b3:f7:66 > 01:00:5e:14:14:08, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 231.20.20.8: igmp v2 report 231.20.20.8
09:46:22.764102 00:e0:81:b3:f7:66 > 01:00:5e:14:14:70, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 230.20.20.112: igmp v2 report 230.20.20.112
09:46:22.956111 00:e0:81:b3:f7:66 > 01:00:5e:14:14:85, ethertype IPv4 (0x0800), length 46: (tos 0xc0, ttl 1, id 0, offset 0, flags [DF], proto IGMP (2), length 32, options (RA))
192.168.21.12 > 230.20.20.133: igmp v2 report 230.20.20.133
在这两种情况下,路线都是:
224.0.0.0 * 240.0.0.0 U 0 0 0
同一局域网,没有防火墙,没有 iptables 规则,在 UPS 故障之前运行良好。
不工作的机器是 ubuntu 14,工作的机器是 debian jessie
尝试用 iperf 测试,ubuntu 机器可以发送多播数据包,但无法接收它们。
还可以检查什么?
答案1
在 Ubuntu 上切换到 IGMPv2
echo "2" > /proc/sys/net/ipv4/conf/eth1/force_igmp_version
然后重试。如果您遇到同样的问题,请检查反向路径过滤
cat /proc/sys/net/ipv4/conf/default/rp_filter
1 表示内核将通过确认反向路径来进行源验证。
0 表示没有源验证。
使用 0