This code lets you have multiple IP addresses for a single interface. It is useful in those situations where you have multiple logical nets on the same physical network segment, or for instance if you need several IP address for virtual Web hosting. Further information about using vif for virtual Web hosting can be found at http://www.thesphere.com/~dlp/TwoServers/.
You can download the code from ftp://ftp.nethelp.no/pub/net/vif-1.11.tar.gz. There are mirrors at ftp://ftp.ntnu.no/pub/unix/network/vif-1.11.tar.gz, ftp://ftp.netcom.com/pub/he/henderso/vif-1.11.tar.gz and ftp://ftp.mindlink.net/pub/crypto/sun-stuff/vif-1.11.tar.gz.
The code was originally written by John Ioannidis. I have included part of his original message in the README.ji file. Note that with my version of the code, the extraneous network route mentioned by John Ioannidis does not appear, and therefore does not need to be deleted.
I have cleaned up the code a little, ported it to HP-UX 9.05, and made it modloadable (and unloadable) on SunOS 4.1.3/4.1.4. Please note that I have tested the code myself only on the following hardware/OS combinations:
SunOS 4.1.3 sun4c SunOS 4.1.3_U1 sun4m SunOS 4.1.4 sun4m, sun4c HP-UX 9.05 HP 700Other have reported success on
HP-UX 9.x HP 300 Mike Ferrara <email@example.com> HP-UX 9.x HP 800 John Sullivan <firstname.lastname@example.org> Ultrix DECstation Phil Brandenberger <email@example.com>For a slightly different Ultrix version, courtesy of John Hascall, check ftp://ftp.iastate.edu/pub/unix/ultrix/vif/.
Note that using this code is entirely unsupported, and you are very much on your own if it crashes your machine! It is not recommended for people who have never configured a new Unix kernel. Root privileges are (obviously) needed for installation.
If you have problems getting vif to work, please read the FAQ!
I expect vif should be portable to other operating systems with BSD based networking code. However, most newer systems with BSD based networking code (e.g. all systems based on 4.4 BSD) already support multiple IP addresses per interface.
HP gotcha #1: The code will almost certainly not work on interfaces using checksum offload (eg. FDDI).
HP gotcha #2: You won't be able to add a published ARP entry after the virtual interface has been ifconfig'ed. But you can do it before the ifconfig.
WARNING: Do not use vif on a host which runs RIP. RIP is not prepared to handle several interfaces with the same Ethernet address.
I would be happy to receive feedback on this code, ports to other operating systems etc.
Notes on multiple IP address support in other operating systems and versions:
Here is the description from Casper Dik's FAQ for Solaris 2, http://www.fwi.uva.nl/pub/solaris/solaris2.html:
Solaris 2.x provides a feature in ifconfig that allows having more than one IP address per interfaces. (Undocumented but existing prior to 2.5, documented in 2.5)
ifconfig IF:N ip-address up
where "IF" is an interface (e.g., le0) and N is a number between 1 and 255. Removing the pseudo interface and associated address is done with "ifconfig IF:N 0.0.0.0 down". As with physical interfaces, all you need to do is make the appropriate /etc/hostname.IF:X file.
News flash: It seems HP has listened to their customers. There are now patches available for HP-UX 10.01 and HP-UX 10.10 which give you the multiple IP addresses per interface functionality in the form of an 'ifalias' program. The patch numbers are currently:
PHNE_7107 s700_800 10.01 'ifalias' command for IP address aliasing PHNE_7108 s700_800 10.10 'ifalias' command for IP address aliasingThe patches are available from the HP support site, http://us-support.external.hp.com/.
Another note for HP-UX 10.x: There have been versions of the networking jumbo patch which have broken the ability to have multiple IP addresses per interface. Please check Julian Perry's URL (see above) for further information.
I believe Linux 1.3.x supports it without any patches. Linux 2.0 and newer certainly does.