: Hi! Can I use a virtual interface to allow my Linux box to respond to
: two different IPs on two different networks? I want to have my Linux
: box use say 192.168.0.1 and 10.0.0.1 on the same network interface. Can
: I use virtual interfaces to do this or must ALL the IPs on a virtual
: interface belong to the same network?
Easy answer: you can put ALL possible IP addresses to a single NIC.
More complex answer: virtual interfaces are really a cheat and for all
ethernet cards I have seen so far will result in the card being set to
promiscuous mode (i.e. forwarding ALL packets to the kernel rather than
only those for it's IP/MAC).
So really you do not need a virtual interface but it makes it easier to
generically configure an interface (routing and stuff).
Caveats:
* I have as yet found no way to run multiple dhcp clients on a
promiscuous interface ... of course that makes sense because BOOTP
uses the MAC address as default identifier but the process breaks
before that stage ...
* Be carefull when setting up default gateways ... make sure they will
route for you and be aware that the last interface to be mounted will
set the default gateway (if desired).
* Of course you can only get packets that live on the physical segment
you are on, i.e. traffic. Thus you should have a good reason to split
the IP ranges because (a) everyone can sell all the packets anyhow
and (b) it does not reduce the load on the segment ...
Have fun
Rudolf