Linux多网卡同网段问题
来源:互联网 发布:linux字符集 编辑:程序博客网 时间:2024/06/03 22:52
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 1
net.ipv4.conf.default.arp_announce = 1
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
arp_ignore - INTEGER
Define different modes for sending replies in response to
received ARP requests that resolve local target IP addresses:
0 - (default): reply for any local target IP address, configured
on any interface
1 - reply only if the target IP address is local address
configured on the incoming interface
2 - reply only if the target IP address is local address
configured on the incoming interface and both with the
sender's IP address are part from same subnet on this interface
3 - do not reply for local addresses configured with scope host,
only resolutions for global and link addresses are replied
4-7 - reserved
8 - do not reply for all local addresses
The max value from conf/{all,interface}/arp_ignore is used
when ARP request is received on the {interface}
arp_announce - INTEGER
Define different restriction levels for announcing the local
source IP address from IP packets in ARP requests sent on
interface:
0 - (default) Use any local address, configured on any interface
1 - Try to avoid local addresses that are not in the target's
subnet for this interface. This mode is useful when target
hosts reachable via this interface require the source IP
address in ARP requests to be part of their logical network
configured on the receiving interface. When we generate the
request we will check all our subnets that include the
target IP and will preserve the source address if it is from
such subnet. If there is no such subnet we select source
address according to the rules for level 2.
2 - Always use the best local address for this target.
In this mode we ignore the source address in the IP packet
and try to select local address that we prefer for talks with
the target host. Such local address is selected by looking
for primary IP addresses on all our subnets on the outgoing
interface that include the target IP address. If no suitable
local address is found we select the first local address
we have on the outgoing interface or on all other interfaces,
with the hope we will receive reply for our request and
even sometimes no matter the source IP address we announce.
The max value from conf/{all,interface}/arp_announce is used.
Increasing the restriction level gives more chance for
receiving answer from the resolved target while decreasing
the level announces more valid sender's information.
rp_filter - INTEGER
0 - No source validation.
1 - Strict mode as defined in RFC3704 Strict Reverse Path
Each incoming packet is tested against the FIB and if the interface
is not the best reverse path the packet check will fail.
By default failed packets are discarded.
2 - Loose mode as defined in RFC3704 Loose Reverse Path
Each incoming packet's source address is also tested against the FIB
and if the source address is not reachable via any interface
the packet check will fail.
Current recommended practice in RFC3704 is to enable strict mode
to prevent IP spoofing from DDos attacks. If using asymmetric routing
or other complicated routing, then loose mode is recommended.
conf/all/rp_filter must also be set to non-zero to do source validation
on the interface
Default value is 0. Note that some distributions enable it
in startup scripts.
两块网卡在同一网段会出现一块断线但是ping这块网卡的ip依然能够ping通,这两个ip被指向了同一的MAC地址
eth0 192.168.1.10
eth1 192.168.1.11
echo "252 net2" >> /etc/iproute2/rt_tables
echo "251 net3" >> /etc/iproute2/rt_tables
ip route add 192.168.1.0/24 dev eth0 src 192.168.1.10 table net2
ip route add 192.168.1.0/24 dev eth1 src 192.168.1.253 table net3
ip route add default dev eth0 table net2
ip route add default dev eth1 table net3
ip rule add from 192.168.1.10 table net2
ip rule add from 192.168.1.11 table net3
ip route flush cache
ping通,然后arp验证mac地址不一样
arp -a
- Linux多网卡同网段问题
- linux下多网卡配置同网段IP的问题以及解决方法
- 关于双网卡同网段的广播问题
- Linux双网卡设置IP属于同一网段的问题
- Linux双网卡设置IP属于同一网段的问题
- Linux双网卡设置IP属于同一网段的问题
- 多网卡在同一网段内的问题
- 多网卡下同网段内所有网卡共用一个IP的问题分析
- Linux下多块网卡同一网段连通配置
- Linux系统根据网段信息查询网卡
- 单主机多网卡位于同一个网段
- Linux多网卡拉同一组播导致数据异常
- Linux下多网卡不同IP在同一网段的情况
- linux 单网卡来绑定多IP实现多网段访问以及多网卡绑定单IP实现附载均衡
- CentOS7 不能ping同其他网段的问题
- linux服务器间同网段IP伪装端口映射
- 同网段地址判断
- 同网段修改VIP
- 远程服务器项目发布
- bash 中 trim 字符串(去除首尾空格)
- POJ 1012 Joseph
- 小强学Python+OpenCV之-1.4.2裁剪
- 微信小程序开发之不能使用eval函数的问题
- Linux多网卡同网段问题
- LabVIEW的 Session In 和 motion in
- java实现笛卡尔积算法
- ffmpeg视频压缩命令
- 深入理解:overflow:hidden——溢出,坍塌,清除浮动
- iOS打包上传App Store一直报-22421
- 海航陈峰回忆创业史:那是一个非常有趣的时代!
- 今天开通了博客
- bzoj 2599 [IOI2011]Race