Home > IT Notes

Adding a 2nd Ethernet card to Linux

  1. Make Linux autoprobe for a second card at boot time by adding

    append = "ether=0,0,eth1"

    to the top of /etc/lilo.conf, then re-run lilo.

  2. Assign an IP address to the new card using ifconfig:

    ifconfig eth1 192.168.100.2 netmask 255.255.255.0

    Where 192.168.100.2 is the address of the card & 255.255.255.0 is the netmask of the network the card is connected to.

  3. Define a network to be accessed via the card using route:

    route add -net 192.168.100.0 netmask 255.255.255.0

    Where 192.168.100.0 is the address and 255.255.255.0 is the netmask of the network the card is connected to.

  4. If necessary, redefine the default route to point to the Internet gateway:

    route add default gw 192.168.100.1 netmask 0.0.0.0

    Where 192.168.100.1 is the address of the Internet gateway

  5. Put the ifconfig & route commands into /etc/rc.d/rc.inet1 so they are set up when the machine is restarted

    Home > IT Notes