0

I have few Linux RHEL 6 Server where i have configured 2 separate NICS in the same subnet with 2 diffrent IP's.

> example:
>     eth0 : 172.23.23.1
>     eth1:  172.23.23.2

Initially i faced the problem with "rp_filter" reverse packet filtering which i enabled with "net.ipv4.conf.default.rp_filter = 2" into the sysctl.conf file tp persist across reboot, both nic are pinging but the odd i see if we un-plug primary ie NIC eth0 then host will stop responding. Secondly, on the switch side it takes only the single MAC address for the both the IP's.

please advise if anyone faced this!

7
  • What exactly are you pinging when it fails? Mar 16, 2017 at 16:51
  • @TeroKilkanen.. When primary NIC goes down then Server will not be reachable by second IP. We have same default gateway for both the IPS.
    – krock1516
    Mar 16, 2017 at 16:55
  • Are you sure the second nic is actually correctly connected to the network, configured properly in the switch, on the right vlan, etc? What happens if you disable the config for the first interface completely? Can you get the second interface to work at all?
    – Zoredache
    Mar 16, 2017 at 17:02
  • @Zoredache.. yes the NIC is correctly configured and working, When both the interfaces are up at that time i can login with both IP's into the system.. There is problem on RHEL6 system by default where it doesn't take the secondary IP which needs to enable on the sysctl.conf and i have done that to allow second NIC/IP to work by adding : "net.ipv4.conf.default.rp_filter = 2 net.ipv4.conf.all.rp_filter = 2 " The only problem when primary nic goes down then secondaru as well not accessible.
    – krock1516
    Mar 16, 2017 at 17:13
  • How do you know the second one is working? What test have you done to prove it? If one interface being disconnected breaks both, then it seems likely to me that your other interface isn't working.
    – Zoredache
    Mar 16, 2017 at 18:31

2 Answers 2

0

This is the expected behavior with your setup. What you did by setting rp_filter to 2 was to instruct the kernel to accept packets whose reverse path would differ from inbound interface, as otherwise they would be dropped. Now, they are accepted, but the reverse path (that is, a routing table entry) still points to the different interface, which is down, and you're getting no replies.

How do you deal with a situation depends on the original intent. If it was an L2 redundancy, set up a bundle on a switch and a bonding interface on a server side.

1
  • your explanation is good, but i'm compel to use this config , i need to have some kind of routing mechanism to pass the packets via either nic in case one is down another can host the service.
    – krock1516
    Mar 17, 2017 at 4:06
0

I am able to overcome the problem after adding the routing rules for both the interfaces ..

1) Need to add the tables into the iproute2 Files as below:

T_eth0 for eth0 interface
T_eth1 for eth1 interface

-> /etc/iproute2/rt_tables
1  T_eth0
2  T_eth1

2) after adding the iproute2 tables , one would require to add the ip route and ip rules and then build a route to the gateway and build a default route via that gateway.

ip route add 172.23.15.0/21 dev eth0 table T_eth0
ip route add default via 172.23.23.134 dev eth0 table T_eth0

ip route add 172.23.15.0/21 dev eth1 table T_eth1
ip route add default via 172.23.23.134 dev eth1 table T_eth1

3) Next, you set up the routing rules. These actually choose what routing table to route with. You want to make sure that you route out a given interface if you already have the corresponding source address:

ip rule add from 172.23.23.1 table T_eth0
ip rule add from 172.23.23.2 table T_eth1

above all commands makes sure all answers to traffic coming in on a particular interface get answered from that interface in specific.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .