Jump to content
  • Advertisement
Sign in to follow this  
Aidamina

[Closed]Route.exe help

This topic is 4770 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to get a program which connects to a server on the internet to connect to the same port only localhost with route.exe, but this fails. I know its a bit offtopic, but hey gd is sweet. im calling route add TargetInetip 127.0.0.1 or route add TargetInetip 192.168.1.3 where TargetInetip is the ip of the server connected to the internet and 192.168.1.3 the current ip of the computer in its network. Both things failed. I wrote a basic tcp server which should receive the connectiong but it doesnt detect any connection attempts ( it works with telnet though so there shouldn't be anything wrong with the server application ) Any suggestions, Maybe i ****'ed up in the route.exe syntax?? Thanks [Edited by - Aidamina on July 31, 2005 1:56:52 AM]

Share this post


Link to post
Share on other sites
Advertisement
Using route you instruct your computer that packets meant for the program's server (say 12.34.56.78) should be sent through your loopback device or the network card of your backend network respectively.
However, on the networks connected to these cards, nobody is listening to the IP 12.34.56.78.

To pull this off, you have some options:
1. Disconnect from the internet, assign that IP 12.34.56.78 to your computer and see it connect. (Don't know if this fits your goal, though)
2. If you know the host name of the server you might pull this off by adding a line in your HOSTS-file, containing your own IP and the name of the server. Hopefully, when looking up the name, it will use your own IP and connect to your homegrown server.
3. Have a look at ARP.exe.

Share this post


Link to post
Share on other sites
its not a host thats resolved just direct ip. Its not my goal to connect to localhost. eventually its just my goal to let the program connect to 98.76.54.32 instead of 12.34.45.67.

Need some help badly :P

Share this post


Link to post
Share on other sites
Is the route registering in your routing table??

I always add a metric.....

route add connectIP 127.0.0.1 metric 1 if xxx

Where xxx specifies the network interface.
Add -p for a persistent route.

Share this post


Link to post
Share on other sites
It doesnt work, the route shows up when i do route -a but for some reason its not connecting, by the way using 127.0.0.1 fails because the gateway isnt in the same network any suggestion?

Share this post


Link to post
Share on other sites
"route" only tells IP which *route* to use. It does not change the destination IP address, only the path to get to that address.

As DaBono said, you have to add the ip address to the host. However, you should not need to disconnect it from the internet. Go into the control panel->network and add an IP address to the network card in question.

Share this post


Link to post
Share on other sites
You can't do packet re-writing or IP tunneling only using "route". "Route" just tells the computer that, given a packet headed for address X, forward it along to the next hop of Y.

Share this post


Link to post
Share on other sites
So what DO i need?
How do i make the program connect to a different ip,
dont tell me what not todo,
but tell me something what i should do!

[Edited by - Aidamina on July 29, 2005 2:25:50 PM]

Share this post


Link to post
Share on other sites
I am still a bit unclear what you are trying to do. You need a bit more detail.
You say "connect on the same port" ?? Do you want it to reroute or to are you trying to duplicate traffic. You need to clarify it a bit.

I took your post as simply trying to take all traffic heading out on an IP to be rerouted back on loopback. This is not hard. Use ethereal to so what your traffic is doing. It should tell you where is is going. If you are still confused maybe show us some of your traffic with ping and your "route print".

Share this post


Link to post
Share on other sites
You can multi-home your machine to have two IP addresses; one for the actual address, and one for the address you're faking out.

The easiest way to do this is to stick in a second ethernet adapter, and configure a static IP for that. When a machine is multi-homed, a route will already exist that forwards packets to your machine when they come from your machine.

Just don't expect other machines to be able to send to your machine, as the second IP will not ARP or route correctly compared to the network it sits on...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!