Identifying Which NIC Is Which
You have successfully installed two NICs in your new soon-to-be Linux firewall, but you realize that you don't know how to tell which physical card is eth0 and which one is eth1.
The most reliable way is to connect one at a time to another PC and ping them from the second PC. Once you know which one is which, label them. Using two different interface cards with different drivers also helps to keep them sorted out, though it's not required.
If your needs grow to where you need three or four Ethernet adapters, consider purchasing two- or four-port Ethernet adapters. They are configured and managed in exactly the same way as single-port cards, with the advantages of using fewer PCI slots, and requiring fewer interrupts. They're more expensive because they are designed for server duties, so they are more robust, and come with more features.
Soekris single-board computers can have up to eight 10/100 Ethernet ports.
There is no instant method for identifying which NIC is eth0 or eth1 when you install them for the first time, or afterward. It takes just a couple of minutes to do the ping test and label them, and it will save many hassles down the road.
USB Ethernet adapters are worth considering if you shop carefully and purchase only models with native Linux drivers. Don't use ndiswrapper, which is a Linux wrapper that lets you use the device's binary Windows drivers on Linux. It is difficult to install, difficult to upgrade, and using closed, binary device drivers leaves you at the mercy of the vendor for bugfixes and security patches.
Be sure to get USB 2.0 devices, or you won't see any speed at all, because USB 1.1 supports a maximum line speed of 12 Mbps. Most likely you'll top out at 6-8 Mbps, which in these modern times is slower than slow. USB 2.0 supports a theoretical maximum of 480 Mbps. On an unshared USB 2.0 bus, you should hit data transfer rates of around 320 Mbps or so, or around 40 MBps.
In this tutorial:
- Building a Linux Firewall
- Iptables and NAT, SNAT, and DNAT
- iptables
- Assembling a Linux Firewall Box
- Configuring Network Interface Cards on Debian
- Configuring Network Interface Cards on Fedora
- Identifying Which NIC Is Which
- Building an Internet-Connection Sharing Firewall on a Dynamic WAN IP Address
- Building an Internet-Connection Sharing Firewall on a Static WAN IP Address
- Displaying the Status of Your Firewall
- Turning an iptables Firewall Off
- Starting iptables at Boot, and Manually Bringing Your Firewall Up and Down
- Testing Your Firewall
- Configuring the Firewall for Remote SSH Administration
- Allowing Remote SSH Through a NAT Firewall
- Multiple SSH Host Keys Past NAT
- Running Public Services on Private IP Addresses
- Setting Up a Single-Host Firewall
- Setting Up a Server Firewall
- Configuring iptables Logging
- Writing Egress Rules