[1269] in linux-net channel archive
Re: Info needed on use of dummy interface to give two IPs on one e
daemon@ATHENA.MIT.EDU (Al Longyear)
Fri Oct 27 21:36:40 1995
From: "Al Longyear" <longyear@sii.com>
To: steven.kraft@Connects.Com (KRAFT Steven D.)
Date: Fri, 27 Oct 1995 07:06:46 -0700 (PDT)
Cc: linux-net@vger.rutgers.edu
In-Reply-To: <30902787@mssmtpgw> from "KRAFT, Steven D." at Oct 26, 95 05:33:00 pm
Steven Kraft steven.kraft@connects.com> writes:
> I need additional info on using a dummy interface to allow a server to
> have two separate addresses on one ethernet interface. The only mention
> of the dummy interface I find in the HOWTO's relates to dialup use, to
> let a local address be available even when the dialup link is down.
>
> I have set up a Linux server (slackware 2.3, not my choice but that's not
> the issue here...) to act as an HTTP proxy using the CERN httpd. It has
> one ethernet interface, and it needs to be reachable both from the
> Internet using its "real" Internic-registered IP address, and also
> reachable from the internal 172.16.0.0 RFC1597 private network.
>
> The private network number is assigned to the dummy interface. I
> followed the guidelines I saw posted a couple of months ago. (I think it
> was from Alan Cox, but I don't have the original email available just
> now). I have not been successful in getting the Linux server to
> recognize any traffic addressed to its private network address.
I have the same problem. I have one system which is attached to a
single NIC. On that network for the NIC are two separate IP domains. I
need that system on both networks.
The solution is to use the dummy device. The procedure is as follows:
/sbin/insmod -o dum0 dummy
/sbin/ifconfig dum0 205.162.169.254 up
/sbin/route add 205.162.169.254 dev dum0
/sbin/route add -net 205.162.169.0 netmask 255.255.255.0 dev eth0
/sbin/arp -s 205.162.169.254 00:00:0C:3B:A7:70 pub
My networks used are 205.162.169 and the 192.112.246 values assigned
to sii.com. (205.162.169 is not invented. It is registered as well.)
The eth0 device is properly configured for the 192.112.246 network. I
use the dum0 device to also have the system respond to the
205.162.169.254 IP address.
The first statement just uses the modules to load the support. Skip it
if you have the dummy device in the kernel.
The second statement assigns the device route to the dummy device. It
is needed so that the frames sent by this system for the IP address of
the dummy device will go to the proper system; this one.
The third statement assigns the IP address and brings it up. This is
against the dummy device.
The fourth adds the network route so that frames on the second network
are routed to the eth0 device. Don't forget the netmask. Also, this is
for the 'real' interface card, eth0, and not the dummy device.
The fifth statement adds the ARP entry so that the ARP requests will
be satisfied on the second network against the second IP address. Get
the hardware address used in the arp command from the ifconfig program
against the eth0 device. DON'T MAKE A MISTAKE WITH THE HARDWARE
ADDRESS. If you do then you may be waiting a long time for someone to
send you data.
That's it. Now the computer will appear to be on the two networks at the
same time. Of course, you need to have the frames flowing across the wire
attached to the single ethernet for both IP networks.
Make any suitable changes, SUCH AS THE IP ADDRESSES, so that the
values match your configuration and not mine.
Perhaps Terry Dawson will update the Net-2-HOWTO to reflect this other
use of the dummy device. It would help in the future since this is now
the second person who has asked this question. :)
--
Al Longyear longyear@sii.com
The above opinions do not necessarily represent those of the Management
of System Integrators nor any of its subsidiaries.