请教LINUX中2个VLAN相同组播数据路由

xujie381 2018-01-10 06:34:46
各们大神:

我在CentOS环境下, 取光猫VLAN里面的组播数据,路由只能通一个
eth0 : 172.31.1.99, 255.255.255.0, 172.31.1.1
eth1 : vlan 801 (192.168.0.101/24), vlan 802 (192.168.0.102/24)
组播源地址只有 222.85.81.200 , 222.85.81.197, 如果不加这个也取不到组播数据

我配置成这样, 就可以同时读取 eth1.801 和 eth1.802 的数据
route add -net 222.85.81.200 netmask 255.255.255.255 dev eth1.801
route add -net 222.85.81.197 netmask 255.255.255.255 dev eth1.802
route add -net 239.16.20.41 netmask 255.255.255.255 dev eth1.801
route add -net 239.16.20.221 netmask 255.255.255.255 dev eth1.802


但是我有7,8个这样的光猫,我只想每个光猫里面取1个组播节目数据,我不知道如何配置路由,根据网上的这种路由配置,也不能取到组播数据,
echo "252 tel" >> /etc/iproute2/rt_tables
echo "251 cnc" >> /etc/iproute2/rt_tables

ip route flush table tel
ip route add default via 192.168.0.1 dev eth1.801 src 192.168.0.101 table tel
ip rule add from 192.168.0.101 table tel

ip route flush table cnc
ip route add default via 192.168.0.1 dev eth1.802 src 192.168.0.102 table cnc
ip rule add from 192.168.0.102 table cnc



不知道应该如何配置路由才能达到
光猫1,VLAN 801
route add -net 222.85.81.200 netmask 255.255.255.255 dev eth1.801
route add -net 239.16.20.41 netmask 255.255.255.255 dev eth1.801


光猫2,VLAN 802
route add -net 222.85.81.200 netmask 255.255.255.255 dev eth1.802
route add -net 239.16.20.221 netmask 255.255.255.255 dev eth1.802



光猫3,VLAN 803
route add -net 222.85.81.197 netmask 255.255.255.255 dev eth1.803
route add -net 239.16.20.34 netmask 255.255.255.255 dev eth1.803



就是我绑定哪个网卡,我就能过这个网卡的路由出去取数据,还请各位大神帮忙分析一下。

...全文
253 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

18,773

社区成员

发帖
与我相关
我的任务
社区描述
Linux/Unix社区 专题技术讨论区
社区管理员
  • 专题技术讨论区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧