Frequently asked questions about VIF

This is just a start! Please send updates and comments to: Steinar Haug <sthaug@nethelp.no>

You can find further information in the VIF README.


  1. How many virtual interfaces can I have?

    I have never tried more than 32 interfaces myself, but I don't know of any specific limit. I would not be surprised if the operating system refuses more than 256 virtual interfaces per real interface, though.

  2. netstat gives me garbage!

    If you've tried to install vif with for instance 16 interfaces on SunOS 4.1.x, using

    #define NVIF 16
    in vif.h, you'll find that the netstat output looks strange.

    netstat, at least on SunOS 4.1.x, has a bug for more than 10 interfaces. The interfaces above vif9 will show up as vif:, vif;, etc. You simply get the next characters in the ASCII character set. On HP-UX, netstat works fine, and the interfaces show up as vif10, vif11 etc. as they should.

    ifconfig, however, does not have this bug. This means that the interface which shows up as vif: in the netstat output can be configured as vif10, vif; can be configured as vif11 etc. Here is the netstat output from a SunOS system with

    #define NVIF 32
    after I had done:

    # ifconfig vif9 129.241.36.2 netmask 0xffffff00
    # ifconfig vif10 129.241.36.3 netmask 0xffffff00
    # ifconfig vif20 129.241.36.13 netmask 0xffffff00
    # ifconfig vif30 129.241.36.23 netmask 0xffffff00
    
    # netstat -ian
    Name  Mtu  Net/Dest      Address        Ipkts  Ierrs Opkts  Oerrs Collis Queue 
    le0   1500 129.241.1.0   129.241.1.16   34700992 42   14737736 1834 3350636 0     
    lo0   1536 127.0.0.0     127.0.0.1      2480261 0    2480261 0    0      0     
    vif0* 1536 none          none           0       0    0       0    0      0     
    vif1* 1536 none          none           0       0    0       0    0      0     
    vif2* 1536 none          none           0       0    0       0    0      0     
    vif3* 1536 none          none           0       0    0       0    0      0     
    vif4* 1536 none          none           0       0    0       0    0      0     
    vif5* 1536 none          none           0       0    0       0    0      0     
    vif6* 1536 none          none           0       0    0       0    0      0     
    vif7* 1536 none          none           0       0    0       0    0      0     
    vif8* 1536 none          none           0       0    0       0    0      0     
    vif9  1536 129.241.36.0  129.241.36.2   0       0    0       0    0      0     
    vif:  1536 129.241.36.0  129.241.36.3   0       0    0       0    0      0     
    vif;* 1536 none          none           0       0    0       0    0      0     
    vif<* 1536 none          none           0       0    0       0    0      0     
    vif=* 1536 none          none           0       0    0       0    0      0     
    vif>* 1536 none          none           0       0    0       0    0      0     
    vif?* 1536 none          none           0       0    0       0    0      0     
    vif@* 1536 none          none           0       0    0       0    0      0     
    vifA* 1536 none          none           0       0    0       0    0      0     
    vifB* 1536 none          none           0       0    0       0    0      0     
    vifC* 1536 none          none           0       0    0       0    0      0     
    vifD  1536 129.241.36.0  129.241.36.13  0       0    0       0    0      0     
    vifE* 1536 none          none           0       0    0       0    0      0     
    vifF* 1536 none          none           0       0    0       0    0      0     
    vifG* 1536 none          none           0       0    0       0    0      0     
    vifH* 1536 none          none           0       0    0       0    0      0     
    vifI* 1536 none          none           0       0    0       0    0      0     
    vifJ* 1536 none          none           0       0    0       0    0      0     
    vifK* 1536 none          none           0       0    0       0    0      0     
    vifL* 1536 none          none           0       0    0       0    0      0     
    vifM* 1536 none          none           0       0    0       0    0      0     
    vifN  1536 129.241.36.0  129.241.36.23  0       0    0       0    0      0     
    vifO* 1536 none          none           0       0    0       0    0      0     
    

    Since vif is entirely unsupported, and SunOS 4.1.x is not exactly the highest priority for Sun these days, I do not expect this bug to be fixed.

  3. I cannot ping one of the virtual addresses from other machines.

    The most frequent problem here is forgetting to manually add a permanent, published ARP entry. This is essential - the operating system will not do it for you.

    If you already have added a permanent, published ARP entry, please check the routing tables on the machine you're trying to ping from. You may also wish to use tcpdump, snoop or a similar packet sniffer to verify that packets are being sent with the correct IP address and Ethernet address.

    If you don't know the Ethernet address of your machine: On SunOS, ifconfig when run as root will list the Ethernet address. On HP-UX, landiag will list the Ethernet address (menu choices lan -> display). In both cases, you can ping the machine from another machine, and then look at ARP table on the other machine to find the Ethernet address.

  4. I am unable to add ARP entries for the virtual interfaces on HP-UX.

    On HP-UX, it's essential that the permanent, published ARP entries are added before you ifconfig the virtual interfaces.

    It's probably a good idea for other operating systems also, so the updated INSTALL file will simply say that the ARP entry should always be added first.

  5. I cannot ping one of the virtual addresses from the host itself.

    On SunOS this should work right away, without any more configuration. If it doesn't, you probably have other problems as well.

    On HP-UX you need to add a host route to the loopback interface in order to ping the host from itself. Using the vif9 interface from the example above, you would do:

    # route add host 129.241.36.2 127.0.0.1 0
    
  6. The vif configuration disappears when I reboot the machine.

    You'll have to add suitable commands to the startup files in order to configure the virtual addresses on each reboot. On SunOS you would probably add something like this to /etc/rc.local:

    cd <vif installation directory>
    modload vif.o -entry _vif_vdcmd -exec `pwd`/vif_exec
    echo > /dev/vif
    arp -s 129.241.220.244 0:80:3f:f5:b:b9 pub
    ifconfig vif0 129.241.220.244 netmask 0xffffff00
    
    See http://fy.chalmers.se/~appro/VIF.html for a nice vif.rc script that can do this for you.

    On HP-UX you would probably add something like this to /etc/netlinkrc:
    echo > /dev/vif
    arp -s 129.241.220.244 0:80:3f:f5:b:b9 pub
    ifconfig vif0 129.241.220.244 netmask 0xffffff00