Monday, April 30, 2007

Define Two IPs on a Network Interface Card (NIC)

A friend and I were talking about creating a virtual network connection. In this case, we were thinking about defining two IPs on one physical Network Interface Card (NIC). I will use the FastEthernet interface, hme, as an example.

#vi /etc/hostname.hme0

For the virtual
#vi /etc/hostname.hme0:1

To activate virtual connection without rebooting
#ifconfig hme0:1 plumb
#ifconfig hme0:1 inet netmask broadcast
#ifconfig hme0:1 up
#ifconfig -a

Ensure that you populate the name service (files, nis, nis+, etc) with the virtual's IP address.


Unknown said...

Congratulations ,very good idea .I hope you guys do that "real".

PD sorry for the bad english.

esofthub said...

Don't worry about the English. I appreciate your comment.

We've done it before and it was just one of those things that came up in conversation when we needed another NIC card but didn't want to pay for it.