I want to map the IP adress 192.168.1.222 to 127.0.0.1 so that if I use 192.168.1.222 in the web browser or ping command I get the response (and that from my 127.0.0.1).

Is this possible via routing tables or do I have to add some sort of virtual network adapter?

I try to deal with this problem on a Windows 7 machine and have no other options then a Windows XP maybe.

I'm stuck right here.

link|improve this question
Don't know if that's possible, but it's easy to do with hostnames. Is it just for one computer? – Luke Nov 30 '11 at 15:46
Okay, two questions here: 1. If you're trying to get to the local system in a web browser, why not just use 127.0.0.1 all the time? 2. If this is for the local system, why deal with cumbersome IPs at all instead of using the reserved hostname localhost? – Iszi Rory or Isznti Nov 30 '11 at 17:11
@DiogoRocha Please make your edits more substantial than these. A single character or capitalization of a term aren't nearly relevant enough for an edit that push topics to the front page. This and this topic apply to suggested edits, but the principle holds even once you have editing privileges. Thanks. – Daniel Beck Nov 30 '11 at 21:35
@Luke: I can't work with hostnames so the hosts file is not viable here – Sebastian Dec 1 '11 at 7:39
@Iszi: I need it to get a software think, that there is another machine present. – Sebastian Dec 1 '11 at 7:39
show 1 more comment
feedback

1 Answer

This should work in both Windows 7 and XP, from command window:

route ADD 192.168.1.222 MASK 255.255.255.255 127.0.0.1

If you want the new route to be persistent between reboots:

route -p ADD 192.168.1.222 MASK 255.255.255.255 127.0.0.1
link|improve this answer
This method doesn't work. I don't get the ping on 192.168.1.222 to return a response. What I did now was to add multiple IPs to the interface (IP Aliasing) but even this doesn't work since the service I try to communicate with seems to listen to 1 IP only. – Sebastian Dec 1 '11 at 7:38
Now that I think of it, I'm pretty sure this won't work unless 192.168.1.222 is an IP that actually belongs to the local machine, in which case it would be redundant anyway. It will force the computer to send packets destined for 192.168.1.222 to the loopback, but on the receiving end they'll be dropped if that's not the local IP. – Iszi Rory or Isznti Dec 1 '11 at 14:09
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.