Take the 2-minute tour ×

I have a machine that has eth0 and eth1, and now I want to create an eth2 and assign it some IP address.

What's the command for doing this?

share|improve this question
Based on your description I believe this answer will suite your demands better: http://stackoverflow.com/questions/2082722/how-do-i-create-virtual-ethernet-dev‌​ices-in-linux –  mnmnc Jul 22 at 23:21

2 Answers 2

On Linux machines, eth0 and eth1 correspond to real network ports. To add an eth2, you'll need to add another NIC, either by adding an internal PCI(e) network card, or by adding a USB network adapter. See Redhat network interface configuration.

If all you want is another IP address, you can create an ethernet alias on one of your existing adapters. An alias is like a virtual network card -- it lets you assign another IP address to an existing port. Let's assume your eth0 has the IP address

To do this once, run (as root) ifconfig eth0:0 up. (Use eth0:1 for a second alias on eth0, eth0:2 for a third, or eth1:0 to alias eth1 instead of eth0.) This configuration will be lost at reboot.

To configure it permanently, add it to a configuration script. Make a copy of /etc/sysconfig/network-scripts/ifcfg-eth0 to the file ifcfg-eth0:0 in the same directory. Change the new file so it looks like this:


The remove or comment out any GATEWAY lines in both files, and add the GATEWAY line to your /etc/sysconfig/network file. Then you can start the new alias with ifup eth0:0 or restart networking entirely with service network restart.

share|improve this answer
adding NM_CONTROLLED="no" can help too (rhel6) –  sje397 Nov 30 '12 at 6:30

Follow these steps:

  1. Shutdown the computer
  2. Disconnect from power
  3. Open case
  4. Insert NIC
  5. Close case
  6. Reconnect power
  7. Boot computer
share|improve this answer

Your Answer


