Single eth interface - multiple IP addr

Single eth interface - multiple IP addr

Post by Drew Linsalat » Tue, 30 Jan 1996 04:00:00



Hi all,

For the life of me I cannot find the docs on how to alias a given IP address to an ethernet interface.

Simple - we want a 1.3.45 box with one ethernet card (eth0) to answer for several ip addresses..  
The eth0 is configured as 204.89.131.110 now.  I want to add at least the address 204.89.131.3

Please, refresh my memory before I go nuts! (g)  Ifconfig does not seem to do the trick (no alias
argument in the docs).

Thanks in advance.

Drew

 
 
 

Single eth interface - multiple IP addr

Post by Tim Baversto » Tue, 30 Jan 1996 04:00:00


: For the life of me I cannot find the docs on how to alias a given
: IP address to an ethernet interface.

There's a better way - I found something called vif on Apache's site,
under multihoming. It's a fake network device, something like dummy0,
but it sucks in extra IP addresses.

I've not had the nerve to install it, myself, so we're using two
ethernet cards. Works fine, except that eth0 can't tall to eth1. :(

I'm very interested in any other answers you get to this.


! Tim Baverstock, IP Network Admin !   http://www.mmm.co.uk [/~warwlck]
!    Opinions are probably mine    !
`----------------------------------'   plan:"Level 1 RFC1149 compliance."

 
 
 

Single eth interface - multiple IP addr

Post by John Timmer » Tue, 30 Jan 1996 04:00:00



> Hi all,

> For the life of me I cannot find the docs on how to alias a given IP address to an ethernet interface.

<bite>

Quote:> Thanks in advance.

> Drew

Hello, this will give you an idea:

# now install the first dummy module                                        
/sbin/insmod -o dummy1 /lib/modules/`/bin/uname -r`/net/dummy.o                
/sbin/ifconfig dummy1 192.168.121.18 up                                        
/sbin/route add 192.168.121.18 dummy1                                                    
/sbin/arp -s 192.168.121.18 00:20:AF:D2:D6:63 pub

This is in /etc/rc.d/rc.local.  You have to recompile your kernel, and say no
to dummy divice support (the later 1.3.* kernels allow you to use "M" for
module, but I'm using 1.2.13 here).  Then just install as many modules as you
require with insmod dummy.o ad infinitum.  If you're using my example change
the IP number (I don't have a valid domain, therefore the strange looking IP
number here) to the one you want, and of course change to MAC address to that
of your ethernet card (ifconfig eth0 to see that...)
--
Regards

...my other signature is illegible...


 
 
 

Single eth interface - multiple IP addr

Post by Brad Killebr » Sun, 04 Feb 1996 04:00:00


: I've not had the nerve to install it, myself, so we're using two
: ethernet cards. Works fine, except that eth0 can't tall to eth1. :(
: I'm very interested in any other answers you get to this.

If eth0 = 206.100.100.1 and eth1 = 206.100.101.1 then this assumes
two different class C's.  Here's an example:

route add -net 206.100.100.0 gw 206.100.100.1 netmask 255.255.255.0
route add -net 206.100.101.0 gw 206.100.101.1 netmask 255.255.255.0

If the two cards are in the same class C, they should be able to
talk to each other (given they're on the same physical ethernet).
If they are both on seperate ethernets, then do something like this
to get the two nets to talk to each other:

eht0 = 206.100.100.1 and eth1 = 206.100.100.128

route add 206.100.100.1 gw 206.100.100.128

I think these are right... check the man page before you try these.

--
Brad Killebrew N5LJV                   Unix Systems Administrator

The Admin's prayer: "Our OS who art in CPU, UNIX be thy name.
  Thy programs run, thy syscalls done, in kernel as it is in version."

 
 
 

Single eth interface - multiple IP addr

Post by Scott Bark » Sun, 04 Feb 1996 04:00:00




> : For the life of me I cannot find the docs on how to alias a given
> : IP address to an ethernet interface.

If you've got the alias patches for 1.2.13, or having a newer kernel with
aliasing built-it, you just deal with the aliased device as if it were a real
device, appending :x to it.

For example, to give eth0 an alias, ifconfig the eth:0 device. You can have
more than one alias as well: eth:0, eth0:1, eth0:2, etc.

Quote:> There's a better way - I found something called vif on Apache's site,
> under multihoming. It's a fake network device, something like dummy0,
> but it sucks in extra IP addresses.

If you use this method, make sure you have a kernel with ip forwarding
compiled in.

--
Scott Barker
Linux Consultant

http://www.cuug.ab.ca:8001/~barkers/   (under construction)

[ I try to reply to all e-mail within 5 days. If you don't  ]
[ get a response by then, I probably didn't get your e-mail ]
[ (we have a sometimes sporadic connection to the internet) ]

"American induction is when you do something three times and get the idea."
   - Dr. Karl Petersen (UNC Professor)