Map non-127.x.x.x address back to own machine?

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Wed Sep 14 07:51:50 UTC 2011


On Wed, 14 Sep 2011, Amanda Yilmaz wrote:

> Hi all,
>
> Is there a way to make an IP address outside the 127.x.x.x range (say, 
> 192.168.56.101) map back to your own machine when accessed from your own 
> machine, as if it were another alias for localhost? I'd like this to 
> happen only on my own machine, and not interfere with anyone else's use 
> of said IP address on the local network. This is for testing purposes 
> only.
>
> I've been poring over the documentation for route, arp, tun/tap, etc., 
> but don't have a deep enough understanding of Linux networking to know 
> where to begin.

It actually turns out to be pretty simple.  I know there have been a few 
posts already.

You can assign an additional IP address to an existing real network 
interface (eg, eth0).  The traffic will not transmit on the NIC and will 
instead be dealt with locally (subject to firewall rules, etc).

If you don't want to put it on a real NIC you can use the dummy kernel 
module to make a dummy network interface.  Dummy interfaces have been 
around on Linux since the 90s.  I know they still work as I used one 
recently.

I know a few people have mentioned putting it on localhost but the dummy 
interface was considered better for reasons that I don't remember right 
now.

Cheers,

Rob

-- 
Email: robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org		Linux counter ID #16440
IRC: Solver (OFTC & Freenode)
Web: http://www.practicalsysadmin.com
Director, Software in the Public Interest (http://spi-inc.org/)
Open Source: The revolution that silently changed the world
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list