[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Connecting to a different LAN



On Sun, May 10, 1998 at 11:29:33AM +1000, Hamish Moffatt wrote:
> On Sat, May 09, 1998 at 12:04:25PM +0100, Ian Lynagh wrote:
> > In article <[🔎] nIJs4AAhzvU1EwYS@lynagh.demon.co.uk>, Ian Lynagh
> > <ian@lynagh.demon.co.uk> writes
> > >However, if I take it to a friends LAN which uses IPs 1.0.x.y then will
> > >I need to change anything? What's the best way of doing this?
> > Something I probably should have mentioned, I don't want my IP address
> > to change. I want to be able to ping the 1.0.x.y addresses from my
> > 192.168.37.mumble address and vica versa.
> 
> In /etc/init.d/network, add a route to 1.0.x.y on your ethernet with no
> gateway. Something like
> 
> route add -net 1.0.x.0 netmask 255.255.255.0 eth0
> 
> should probably do it. Your friend will need to do the same on all his
> hosts, or at least on his gateway, if he has one.
The real solution here is to use ip aliases. If you have the debian kernel
image installed (and are not using a custom one) it is sufficient to use
the ip_alias module

Let's assume a free IP adresss on your friend's subnet is 1.0.2.3
with netmask 255.255.255.0 then the following will do what you want:

# modprobe ip_alias
# ifconfig eth0:0 1.0.2.3 netmask 255.255.255.0 broadcast 1.0.2.255
# route add -net 1.0.2.0

There is no need to do something on the other side.

Nils

--
*-----------------------------------------------------------------------------*
| Quotes from the net:  L> Linus Torvalds, W> Winfried Truemper               |
| L>this is the special easter release of linux, more mundanely called 1.3.84 |
| W>Umh, oh. What do you mean by "special easter release"?. Will it quit      |
* W>working today and rise on easter?                                         *

Attachment: pgpxaePGDM6ie.pgp
Description: PGP signature


Reply to: