Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] IP address substitution
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
bongosmoker
n00b
n00b


Joined: 13 Jul 2006
Posts: 22

PostPosted: Sat Sep 15, 2007 11:27 am    Post subject: [SOLVED] IP address substitution Reply with quote

Hey. Is it possible to somehow substitute a destination IP address to a different one? In more details: I have a small network with few boxes, and a Linux router. I want to create a situation where every request from some box inside the network to the local address 192.168.0.113 will be redirected to external IP 80.50.50.50 (a DNS server) and the data obtained from 80.50.50.50 will be passed to the local IP which requested the connection with 192.168.0.113.

I don't think I have any other option. Right now I got another computer that I want to connect to the network, but I can't change the parameters of its IP configuration (the laptop must work in it's original network environment as well), and it has a fixed DNS address of 192.168.0.113. If only I could somehow force the 192.168.0.113 address to be seen as "80.50.50.50" in the network, the connection should work. Pinging IPs (even external ones) is working, only DNS resolving isn't. It is a Windows box btw.

Or maybe there is another way to do it (not counting using VMWare to create a bridged host that will have an ip of 192.168.0.113 which will forward DNS requests to 80.50.50.50)?


Last edited by bongosmoker on Sat Sep 15, 2007 7:44 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10589
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Sep 15, 2007 12:43 pm    Post subject: Reply with quote

You could put another NIC in one of your computers, assign that NIC the fixed IP address 192.168.0.113, and then run a DNS proxy like "dnsmasq" to forward DNS requests on to your real DNS.[/list] Kind of messy, but not expensive.

- John
Back to top
View user's profile Send private message
bongosmoker
n00b
n00b


Joined: 13 Jul 2006
Posts: 22

PostPosted: Sat Sep 15, 2007 4:44 pm    Post subject: Reply with quote

That would fix the problem I suppose, but I was hoping to find some answer without adding new hardware, maybe some iptables rules or spoofing softs :), this solution will be only a temporary one, so it doesn't need to be elegant, it just needs to work. I'll buy a new NIC as a fallback, if everything else will fail. Thanks for the dnsmasq hint :)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21633

PostPosted: Sat Sep 15, 2007 5:21 pm    Post subject: Reply with quote

What is the layout of your internal network? You might be able to get away with assigning your existing internal NIC a second address, if it is on the right subnet. See ip addr add for details.
Back to top
View user's profile Send private message
Beju
Apprentice
Apprentice


Joined: 30 Mar 2006
Posts: 171

PostPosted: Sat Sep 15, 2007 5:28 pm    Post subject: Re: IP address substitution Reply with quote

bongosmoker wrote:
I have a small network with few boxes, and a Linux router.

What is the router's IP? I don't know if I get it right and also how complicated Your network is, but maybe You can switch Your router to 192.168.0.113?
Back to top
View user's profile Send private message
bongosmoker
n00b
n00b


Joined: 13 Jul 2006
Posts: 22

PostPosted: Sat Sep 15, 2007 7:43 pm    Post subject: Reply with quote

Hu wrote:
What is the layout of your internal network? You might be able to get away with assigning your existing internal NIC a second address, if it is on the right subnet. See ip addr add for details.


@Hu: You're a genius. It worked :) I have a very basic network setup, the router at 192.168.0.1 connected with a few computer boxes by a switch, so everything is on the same subnet. I've invoked ip address add dev eth1 local 192.168.0.113 (eth1 being the LAN netword card) and from my desktop I can arping both 192.168.0.1 and 192.168.0.113, seeing the same MAC, so it means it's working :). The DNS queries on the Windows laptop (which was the source of all evil - it runs Windows afterall) are also working, so operation is complete. :)

@Beju: As you can see from above paragraph, it worked by using ip addr add :). Changing the IP of the router was out of the question anyway, as I have several NFS shares configured across some computers and I'd be too lazy to update everything to the new ip ;).

Thanks again.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum