Re: loopback net device

David Woodhouse (Dave@imladris.demon.co.uk)
Thu, 26 Feb 1998 22:54:56 +0000


Dominique.LARCHEY-WENDLING@loria.fr said:
> I would like to be able to have a loopback net with another IP addr
> than 127.0.0.1.

> It should be possible to do that with ifconfig/route but isn't it
> dangerous as the IP addr 127.0.0.1 might be hard-coded into some
> programs, or even into the kernel as it seems from <linux/in.h> ?

It is indeed hard-coded into some programs. Don't take down your existing
loopback route, just add another:

dwmw2 /root # ifconfig lo:0 192.168.0.1 netmask 255.255.0.0
dwmw2 /root # ping 192.168.0.2
PING 192.168.0.2 (192.168.0.2): 56 data bytes
64 bytes from 192.168.0.2: icmp_seq=0 ttl=255 time=0.3 ms

You'll need IP aliasing configured into your kernel for this.

---- ---- ----
David Woodhouse, Robinson College, CB3 9AN, England. (+44) 0976 658355
Dave@imladris.demon.co.uk http://dwmw2.robinson.cam.ac.uk
finger pgp@dwmw2.robinson.cam.ac.uk for PGP key.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu