Multiple Ethernet Cards

Multiple Ethernet Cards

You might use a Linux PC as a gateway between two Ethernet networks. In that case, you might have two Ethernet cards in the PC. The Linux kernel can support more than one Ethernet card; however, it does not detect multiple cards automatically. The kernel looks for only the first Ethernet card. If you happen to have two Ethernet cards, you should specify the parameters of the cards on the boot command line. (The two cards must have different IRQs and I/O addresses, of course.) Following is a typical boot command line for two Ethernet cards:

ether=10,0x220,eth0 ether=5,0x300,eth1

If you happen to have two Ethernet cards and you use LILO as your boot loader, you can place the necessary LILO boot parameters in the /etc/lilo.conf file so that you don't have to enter the arguments every time you boot Linux. For the preceding example, the line in /etc/lilo.conf looks like the following:

append="ether=10,0x220,eth0 ether=5,0x300,eth1"

If you use GRUB as the boot loader, you can add the option on the kernel line in /etc/ grub.conf.

If you plan to use a Linux PC with two network interfaces as a TCP/IP gateway, you have to recompile the kernel with IP forwarding enabled. Chapter 21 explains how to rebuild the kernel. During the rebuilding process, when you use the make config command, you should enable CONFIG_NETFILTER, CONFIG_IP_ADVANCED_ROUTER, CONFIG_IP_MULTIPLE_ TABLES, CONFIG_IP_ROUTE_NAT, and CONFIG_IP_ROUTE_FWMARK.