想做棋牌网站怎么做,全国医院网站建设,成都市住房与城乡建设厅网站,中文书店网站模板目录 问题查找解决方式参考 问题
linux 在使用双网卡系统时#xff0c;当这两个不同网段的网口接到同一个交换机上#xff0c;会出现 eth0 的 arp 请求#xff0c;会在 eth1 上收到并回复#xff0c;相当于自己检测到了自己的 ip。
查找
linux 的底层#xff0c;默认情… 目录 问题查找解决方式参考 问题
linux 在使用双网卡系统时当这两个不同网段的网口接到同一个交换机上会出现 eth0 的 arp 请求会在 eth1 上收到并回复相当于自己检测到了自己的 ip。
查找
linux 的底层默认情况下多网卡的 arp 是互通的。
解决
可通过配置 arp_ignore 解决
arp_ignore - INTEGERDefine different modes for sending replies in response toreceived ARP requests that resolve local target IP addresses:0 - (default): reply for any local target IP address, configuredon any interface1 - reply only if the target IP address is local addressconfigured on the incoming interface2 - reply only if the target IP address is local addressconfigured on the incoming interface and both with thesenders IP address are part from same subnet on this interface3 - do not reply for local addresses configured with scope host,only resolutions for global and link addresses are replied4-7 - reserved8 - do not reply for all local addressesThe max value from conf/{all,interface}/arp_ignore is usedwhen ARP request is received on the {interface}arp_ignore 参数常用的取值主要有 0、1、23~8 较少用到
copy 解释如下
0 - 响应任意网卡上接收到的对本机IP地址的arp请求包括环回网卡上的地址
而不管该目的IP是否在接收网卡上。1 - 只响应目的IP地址为接收网卡上的本地地址的arp请求。2 - 只响应目的IP地址为接收网卡上的本地地址的arp请求并且arp请求的源IP
必须和接收网卡同网段。3 - 如果ARP请求数据包所请求的IP地址对应的本地地址其作用域scope为
主机host则不回应ARP响应数据包如果作用域为全局global或链路link
则回应ARP响应数据包。4~7 - 保留未使用8 - 不回应所有本地的arp请求方式
1、直接修改 arp_ignore
echo 1 /proc/sys/net/ipv4/conf/all/arp_ignore2、通过 sysctl -w 命令写入
sysctl -w net.ipv4.conf.all.arp_ignore13、通过 sysctl 的配置文件 /etc/sysctl.conf 修改
net.ipv4.conf.all.arp_ignore1然后通过命令 sysctl -p 更新配置
参考
https://www.kernel.org/doc/Documentation/networking/ip-sysctl.txt https://www.jianshu.com/p/734640384fda https://blog.csdn.net/bandaoyu/article/details/126669168