Linux 上的多播
我正在 Linux 上测试一个简单的多播应用程序。我通过执行以下操作在我的电脑上运行它:
- 禁用防火墙
- 运行命令route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
如果您对详细信息感兴趣,请参阅这篇帖子
为什么需要这两个步骤?有没有替代方案。
我正在本地主机上测试代码。
在另一台电脑上,我尝试在禁用防火墙后运行该程序。它不起作用。 当我运行路线命令时,我收到以下消息
route: netmask 0fffffff doesn't make sense with host route
Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables
route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.
route {-h|--help} [<AF>] Detailed usage syntax for specified AF.
route {-V|--version} Display version/author and exit.
-v, --verbose be verbose
-n, --numeric don't resolve names
-e, --extend display other/more information
-F, --fib display Forwarding Information Base (default)
-C, --cache display routing cache instead of FIB
<AF>=Use '-A <af>' or '--<af>'; default: inet
List of possible address families (which support routing):
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)
解决方案是什么?
I am testing a simple multicast application on linux. I got it working on my pc by doing the following:
- disabling the firewall
- running the command route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
if you are interested in the details, see this post
why are these two steps required? is there an alternative.
i am testing the code on localhost.
on another pc I tried running the program after disabling the firewall. it did not work.
when I run the route command I get the following message
route: netmask 0fffffff doesn't make sense with host route
Usage: route [-nNvee] [-FC] [<AF>] List kernel routing tables
route [-v] [-FC] {add|del|flush} ... Modify routing table for AF.
route {-h|--help} [<AF>] Detailed usage syntax for specified AF.
route {-V|--version} Display version/author and exit.
-v, --verbose be verbose
-n, --numeric don't resolve names
-e, --extend display other/more information
-F, --fib display Forwarding Information Base (default)
-C, --cache display routing cache instead of FIB
<AF>=Use '-A <af>' or '--<af>'; default: inet
List of possible address families (which support routing):
inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25)
netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP)
x25 (CCITT X.25)
what is the solution?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
让它在没有路由命令的情况下工作。
只是一些防火墙配置问题。
我看到这个建议使用路由命令在多播地址上运行 ping。这里不需要。
got it to work without the route command.
just some firewall configuration problem.
i saw this recommendation to use route command for running ping on a multicast address. it is not required here.