Answers:
似乎大多数内核(版本v1)默认情况下确实支持多播,或者在编译时启用了CONFIG_IP_MULTICAST。要检查已编译并正在运行的内核是否订阅了任何多播组,我将使用netstat -g
。
似乎大多数内核(后v1)默认都支持多播。
[root@centos module]# grep CONFIG_IP_MULTICAST /usr/src/kernels/2.6.18-274.7.1.el5-i686/.config
CONFIG_IP_MULTICAST=y
[root@centos module]# netstat -g
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 all-systems.mcast.net
eth0 1 224.0.0.251
eth0 1 all-systems.mcast.net
我看到主机上的eth0接口认为其已订阅224.0.0.251基本mcast组。另外,或者,如果我对组或网络执行ping操作,然后将所有已知的启用多播的主机网络返回给我,我会说多播正在主机上运行。您可以尝试netstat -g
还是cat /proc/net/igmp
查看它是否在您的主机上返回任何组?
在您的Linux机器上:
ip maddr show
提供:
@4Gtest ~]$ ip maddr show
1: lo
inet 224.0.0.1
inet6 ff02::1
2: p3p1
link 01:00:5e:00:00:01
link 33:33:00:00:00:01
link 33:33:ff:bd:7e:0f
link 01:00:5e:00:00:fb
link 01:00:5e:7f:ff:05
inet 224.127.255.5
inet 224.0.0.251
inet 224.0.0.1
inet6 ff02::1:ffbd:7e0f
inet6 ff02::1
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:F1:FF:EA
inet addr:78.46.74.27 Bcast:78.46.74.31 Mask:255.255.255.224
inet6 addr: fe80::20c:29ff:fef1:ffea/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5339836 errors:0 dropped:0 overruns:0 frame:0
TX packets:5486444 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:820300389 (782.2 MiB) TX bytes:1929979381 (1.7 GiB)
Base address:0x1400 Memory:e8820000-e8840000
禁用多播:
ifconfig eth0 -multicast
结果:
# ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:0C:29:F1:FF:EA
inet addr:78.46.74.27 Bcast:78.46.74.31 Mask:255.255.255.224
inet6 addr: fe80::20c:29ff:fef1:ffea/64 Scope:Link
UP BROADCAST MTU:1500 Metric:1
RX packets:5339836 errors:0 dropped:0 overruns:0 frame:0
TX packets:5486444 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:820300389 (782.2 MiB) TX bytes:1929979381 (1.7 GiB)
Base address:0x1400 Memory:e8820000-e8840000
接口中没有组播
启用多播:
ifconfig eth0 multicast
ifconfig