rp_filter及Linux下多网卡接收多播的问题
来源:互联网 发布:非农数据哪里公布 编辑:程序博客网 时间:2024/05/03 08:53
例如:
A: 192.168.8.100
B: (IGMP Query) 10.0.0.1 来自路由器
查找路由表
网卡1为默认路由: 172.17.5.100
网卡2
系统根据路由表,认为10.0.0.1这个IP应该在第一个网卡172.17.5.100上收到,现实的情况是在第二张网卡192.168.8.100上收到了。认为这是不合理的,丢弃该包。致命的问题的,该包是来自路由器的IGMPQuery包。
The rp_filter can reject incoming packets if their sourceaddress doesn’t match the network interface that they’re arrivingon, which helps to prevent IP spoofing. Turning this on, however,has its consequences: If your host has several IP addresses ondifferent interfaces, or if your single interface has multiple IPaddresses on it, you’ll find that your kernel may end up rejectingvalid traffic. It’s also important to note that even if you do notenable the rp_filter, protection against broadcast spoofing isalways on. Also, the protection it provides is only against spoofedinternal addresses; external addresses can still be spoofed.. Bydefault, it is disabled.
解决方法:
系统配置文件
1. /etc/sysctl.conf
把 net.ipv4.conf.all.rp_filter和net.ipv4.conf.default.rp_filter设为0即可
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.all.rp_filter = 0
系统启动后,会自动加载这个配置文件,内核会使用这个变量
2. 命令行
显示一个内核变量 sysctl net.ipv4.conf.all.rp_filter
设置一个内核变量 sysctl -w net.ipv4.conf.all.rp_filter=0
设置完后,会更新内核(实时的内存)中的变量的值,但不会修改sysctl.conf的值
查看 cat /proc/sys/net/ipv4/conf/all/rp_filter
设置 echo "0">/proc/sys/net/ipv4/conf/all/rp_filter
- rp_filter及Linux下多网卡接收多播的问题
- rp_filter及Linux下多网卡接收多播的问题
- rp_filter与多播
- rp_filter与多播
- linux多网卡接收组播丢失问题
- linux 在多网卡下的设备的UDP 组播问题总结
- linux下双网卡接收组播需要修改的参数
- 收不到组播问题 rp_filter
- linux下的多播
- linux udp组播接收问题及原理分析
- linux udp组播接收问题及原理分析
- 关于WIN7 双网卡 多播 问题
- LINUX下添加多个网卡的排序问题
- linux下多网卡绑定设置问题
- 多播报文的发送和接收
- 多播接收不到的处理
- udp多播的发送与接收
- Linux网卡数据包的接收
- hdoj_1503Advanced Fruits
- HTML应用经验
- c++单态模式(不断完善中)
- hdu 1996 汉诺塔VI
- 【php】常见http状态码列表
- rp_filter及Linux下多网卡接收多播的问题
- 三维软件转Unity的系统单位设置研究
- Android中XML数组资源
- ORA-00254/ORA-15173 Archive_log Directory On Asm Being Deleted
- 状态图
- C++基础知识 sizeof运算符应用的总结
- Struts2验证框架的配置及validation.xml常用的验证规则
- hdu 1995 汉诺塔V
- 【BZOJ2753 || SCOI2012】滑雪与时间胶囊