In the work occasionally encountered in 1 machines configured 2 or more than 2 of the same network segment of the public network IP;
In the actual configuration process found that when the configuration of multiple public IP network segment, only one public network IP is pass;
Reasons for this:
reverse route checking is enabled by default on Linux
If 2 network cards are inside a LAN, then the server may find the gateway from eth0 or eth1, if a packet from eth0 into the gateway on eth1, then from the eth1 is out of the way, it will not pass. The reverse route check asks where it came from to go back.
Workaround: turn off reverse route checking
echo 0 >/proc/sys/net/ipv4/conf/eth1/rp_filter
echo 0 >/proc/sys/net/ipv4/conf/eth2/rp_filter
Note: Eth1,eth2 for my side configuration of public IP network card, need to be configured according to their own situation
Write/etc/rc.local, set power on automatically turn off reverse route check
Linux configuration 2 or more than 2 public network IP