How do you setup dual NIC, multi-homed host?
1. What is multi-homed host?
A multi-homed host is known as a computer that has multiple network connections, of which the connections may or may not be the same network. Web hosts and application service providers setup a multihomed router (or system) to connect to two or more upstream Internet Service Providers, and setup network redundancy. The term, multihomed, is used to denote that a system is connected to multiple networks.
A single NIC (Network Interface Card) with multiple IP Addresses is not generally called multi-homed, but it is referred to as setting up an IP aliasing.
2. Why setup multi-homed host?
There are many reasons why one would setup a computer as a multi-homed host. You may wish to setup a network redundancy for higher availabilty (or fault tolerancy), setup your machine as a network gateway (a function of router) for sharing Internet with multiple hosts within the LAN, or connect your host to both Internet and Intranet. There may be other reasons, but the basic fundamental is to connect a host to two separate network (although it is possible to connect dual NIC to a same network).
3. How do you setup a host with dual NICs, and connect to dual ethernet networks?
When setting up a dual NIC cards (multi-homed host), only one default gateway should be assigned to one of the two network adapters. If a NIC is used to connect to the Internet, the default gateway should be assigned to that NIC card. For a NIC card that is connected to the LAN, a static routing entry should be entered into the computer's routing table if the host needs to obtain network resources outside of its subnet.
For example, if the NIC interface is assigned to an IP address of 192.168.1.0 network and a router is is used to interconnect it to 10.10.10.0 network, a static routing table must be entered to let the host know how to route packets destined to 10.10.10.0 network. A Linux and Windows machines have a slightly different syntax, but general idea is the same.
### On the Windows Box,
C:\> ROUTE ADD 10.10.10.0 MASK 255.255.255.0 192.168.1.1
### One a Linux Box,
bash# route add -net 10.10.10.0/24 gw 192.168.1.1
The commands shown above instructs Windows (or Linux) to send all traffic that is destined for the 10.10.10.0 network to the 192.168.1.1 interface on the router. To verify that the ROUTE ADD command was successful, use the ROUTE PRINT command on Windows (or "netstat -rn" or "route" command on Linux) to view the current routing table. If multiple routers are being used on the LAN segment, a separate ROUTE ADD is needed for each router.
Note that the routing table does not survive system reboots on both Windows and Linux, so if persistent routing table is needed a static routing table must be created. On a Red Hat Linux, routes are made permanent by adding entries in /etc/sysconfig/static-routes file. The default gateway is defined in /etc/sysconfig/network file. On a Windows machine, you'll have to create a batch file with the necessary ROUTE ADD commands and place it in the Windows StartUp folder so that it can be executed each time Windows starts.
If DHCP is used to assign IP addresses on the LAN, the DHCP server should be configured to not provide a default gateway.
RFC 1787: Routing in a Multi-provider Internet
RFC 1998: An Application of the BGP Community Attribute in Multi-home Routing
RFC 2260: Scalable Support for Multi-homed Multi-provider Connectivity
RFC 2270: Using a Dedicated AS for Sites Homed to a Single Provider
RFC 2901: Guide to Administrative Procedures of the Internet Infrastructure