没有promisc,UDP多播不能工作。 已经尝试rp_filter = 0

我在Ubuntu Maverick中遇到了多播stream量问题。 它只有在卡处于promisc模式时才起作用(即,如果我手动设置,或使用诸如tcpdump之类的工具)。

添加组播路由…

user@pc-149:~$ sudo ip route add multicast 224.0.0.0/4 dev eth0 user@pc-149:~$ cat /proc/net/igmp Idx Device : Count Querier Group Users Timer Reporter 1 lo : 1 V3 010000E0 1 0:00000000 0 2 eth0 : 2 V3 FB0000E0 1 0:00000000 0 010000E0 1 0:00000000 0 3 eth1 : 1 V3 010000E0 1 0:00000000 0 

启动mplayerstream转储…

 user@pc-149:~$ mplayer udp://225.0.0.1:9000 -dumpstream -dumpfile /tmp/test.mpg mplayer: Symbol \`ff_codec_wav_tags' has different size in shared object, consider re-linking mplayer: Symbol \`ff_codec_bmp_tags' has different size in shared object, consider re-linking MPlayer 1.0rc4-4.4.5 (C) 2000-2010 MPlayer Team mplayer: could not connect to socket mplayer: No such file or directory Failed to open LIRC support. You will not be able to use your remote control. Playing udp://225.0.0.1:9000. STREAM_UDP, URL: udp://225.0.0.1:9000 Timeout! No data from host 225.0.0.1 udp_streaming_start failed No stream found to handle url udp://225.0.0.1:9000 Exiting... (End of file) 

它正确添加到多播组(尝试读取stream时)

 user@pc-149:~$ cat /proc/net/igmp Idx Device : Count Querier Group Users Timer Reporter 1 lo : 1 V3 010000E0 1 0:00000000 0 2 eth0 : 3 V3 010000E1 1 0:00000000 0 FB0000E0 1 0:00000000 0 010000E0 1 0:00000000 0 3 eth1 : 1 V3 010000E0 1 0:00000000 0 

但tcpdump看到的stream量

 user@pc-149:~$ sudo tcpdump -vv -i eth0 dst 225.0.0.1 tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes 09:47:40.698483 IP (tos 0x0, ttl 64, id 23281, offset 0, flags [none], proto UDP (17), length 1344) ls5.3203 > 225.0.0.1.9000: [udp sum ok] UDP, length 1316 09:47:40.698793 IP (tos 0x0, ttl 64, id 23283, offset 0, flags [none], proto UDP (17), length 1344) ls5..3203 > 225.0.0.1.9000: [udp sum ok] UDP, length 1316 

棘手的部分是,只要卡处于promisc模式(即运行tcpdump),mplayer还可以看到交通…

我已经检查过rp_filter的东西了…

 root@pc-149:~# sysctl -a | grep \\.rp_filter error: "Invalid argument" reading key "fs.binfmt_misc.register" error: permission denied on key 'net.ipv4.route.flush' net.ipv4.conf.all.rp_filter = 0 net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.lo.rp_filter = 0 net.ipv4.conf.eth0.rp_filter = 0 net.ipv4.conf.eth1.rp_filter = 0 error: permission denied on key 'net.ipv6.route.flush' 

这是我的路线信息

 root@pc-149:~# ip route show 10.10.14.0/24 dev eth0 proto kernel scope link src 10.10.14.100 metric 1 169.254.0.0/16 dev eth0 scope link metric 1000 multicast 224.0.0.0/4 dev eth0 scope link default via 10.10.14.xxx dev eth0 proto static root@pc-149:~# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 5c:26:0a:xx:xx:xx inet addr:10.10.14.xxx Bcast:10.10.14.255 Mask:255.255.255.0 inet6 addr: fe80::5e26:aff:xxxx:xxxx/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:155843 errors:0 dropped:0 overruns:0 frame:0 TX packets:82366 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:189808267 (189.8 MB) TX bytes:7068802 (7.0 MB) Interrupt:20 Memory:e9600000-e9620000 

更新:所以,看了这里的另一个post后,似乎我可以得到它使用smcroute后,但我不认为这是解决底层的问题。 顺便说一句,只需添加多播路由就可以在centos 5.5上正常工作,所以Ubuntu在做这件事情上有一些根本性的不同