Virtual interfaces question

Virtual interfaces question

Post by Tom William » Wed, 10 May 2000 04:00:00



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?

Thanks in advance for your time.

Peace.....

Tom

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Virtual interfaces question

Post by Daniel Roes » Thu, 11 May 2000 04:00:00



> I want to have my Linux box use say 192.168.0.1 and 10.0.0.1
> on the same network interface.

ifconfig eth0 192.168.0.1 netmask ...
ifconfig eth0:0 10.0.0.1 netmask ...

Best regards,
Daniel

 
 
 

Virtual interfaces question

Post by Rudolf Potuc » Thu, 11 May 2000 04:00:00


: 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

 
 
 

Virtual interfaces question

Post by Tom William » Fri, 12 May 2000 04:00:00





> > I want to have my Linux box use say 192.168.0.1 and 10.0.0.1
> > on the same network interface.

> ifconfig eth0 192.168.0.1 netmask ...
> ifconfig eth0:0 10.0.0.1 netmask ...

> Best regards,
> Daniel

Hi!  I tried that and I can't ping 10.0.0.1.  I just get no replies
back.  How did you get it working for you (or do you use this feature)?

Peace.....

Tom

Sent via Deja.com http://www.deja.com/
Before you buy.

 
 
 

Virtual interfaces question

Post by Daniel Roes » Fri, 12 May 2000 04:00:00



> Hi!  I tried that and I can't ping 10.0.0.1.  I just get no replies
> back.

Assuming you're using netmask 255.0.0.0, your routing table has to
include:

Destination  Gateway  Genmask         Flags Metric Ref  Use Iface
10.0.0.1     *        255.255.255.255 UH    0      0      0 eth0
10.0.0.0     *        255.0.0.0       U     0      0      0 eth0

I don't know what routes are auto-configured upon ifconfig (this is
kernel version dependant), so check that.

Quote:> How did you get it working for you (or do you use this feature)?

I use it heavily. What distribution do you use? Red Hat by chance?
Then it's a simple definition in /etc/sysconfig/network-scripts
and your alias interface eth0:0 is correctly setup when booting
and using "ifup eth0:0".

Best regards,
Daniel

 
 
 

1. ipchains & virtual interface question -- help!

I've been looking for days and I can not find any help with this
question. Please help!
I'm running ipchains on my external interface eth0. (I don't have an
internal interface)

I have a bank of IP addresses assigned to me, so I created a virtual
interface eth0:1 for my second IP address.

Now my question is, do I have to make eth0:1 into say an
external_interface2 and repeat all the rules?

Currently, I just added $webserver2="my.new.ip"

and

ipchains -A input -i $EXTERNAL_INTERFACE -p tcp -s $ANYWHERE -d
$WEBSERVER2 80 -j ACCEPT
ipchains -A output -i $EXTERNAL_INTERFACE -p tcp -s $WEBSERVER2 80 -d
$ANYWHERE -j ACCEPT

I can get http traffic, but that's about it.

TIA

2. File Locking over NFS

3. ipchains and virtual interface question -- Help!

4. magic number?

5. Solaris Virtual Interface question

6. X problem with NEC 75F ang MGA450. Monitor switches off.

7. ipchains & virtual interface question -- Help!

8. Token Ring Adapter

9. logins and virtual interface questions

10. Virtual interface/Virtual web hosting

11. Virtual Host/Virtual Interface for NSCA HTTPD 1.5

12. one physical interface, 3 virtual interfaces, and inetd

13. Question -- Virtual Interfaces (network, multiple IP's) Exist?