I have a Linux server running CentOS 6.4 that is used as an iSCSI target. The server is multi-homed with two NICs, both on the same subnet. iSCSI multipathing takes care of the load-balancing/failover, so all I need is for each NIC to operate independently. How do I configure this system to avoid all the weird routing and ARP issues that always come along with a multi-homed setup, such as traffic being returned on a different interface from the source, or one interface accepting traffic sent to the IP of the other. The bonding solution is not an option, as it has issues with the iSCSI connection.
The important stuff:
- eth0: IP 10.1.1.242 / SN 255.255.252.0 / GW 10.1.1.254
- eth1: IP 10.1.1.243 / SN 255.255.252.0 / GW 10.1.1.254
I realized I never followed up to this question. Using some excellent internet resources here and here, I came up with the following configuration. Hopefully this helps someone out.
Assume you have two interface,
eth0
andeth1
, with IP addresses of 10.1.1.242 and 10.1.1.243. This is all on a /22 network with a default gateway of 10.1.1.254.First create two routing tables, one for each NIC:
Next, add routes for each interface to the appropriate tables:
Finally, add rules to determine which table is used:
This should keep traffic from crossing NICs internally, allowing you to preserve redundancy or use each NIC for different functionality.
You're looking for
ip route
and doing policy routing, each interface will have it's own routing table, and make routing decisions (including which interface to send traffic on, and from which address) based on those tables.This is an excellent site explaining the concepts from the beginning, but you can jump right into policy routing if you'd like..
You will need to look at the arp_announce and arp_ignore variables to make certain that the adapters respond as you would expect.
I'd suggest reviewing the documentation here. The values in that doc for VIPs would probably be appropriate.
In /etc/sysctl.conf: