Skip to contentSkip to conversation

Port Forwarding Problem

DISCUSSION Ivan Hernandez 2 participants 2 messages Apr 24, 2008 – Apr 25, 2008

lore
Share & tools
lore
#0 lore raw

I have a problem that seems difficult to resolve.

On a LAN a set of computers in the range 192.168.1.x that have already assigned a default gw 192.168.1.1 run an application that must connect to an internet server 234.56.78.9 to the tcp port 4444 much like a telnet app.

The 192.168.1.1 gw does no serves internet in any way so the 192.168.1.x network is isolated except for 1 computer, that has 2 nic's and is the computer running linux that i need to configure.

That machine has eth0 with 192.168.1.2 and an eth1 with an internet address 200.100.23.4.

Now, i can't touch routing on the clients, and clients only can see 192.168.1.2. I used simpleproxy this way:
simpleproxy -L 4444 -R 234.56.78.9:4444
to solve the problem, but there is any chance to solve it with iptables???

As clients don't have 192.168.1.2 as router, it seems difficult to use DNAT because packets are sent to internet, but as 192.168.1.x -> 234.56.78.9 so they never come back.

Ideally it should receive packets on eth0 like 192.168.1.x -> 192.168.1.2:4444, and send them to eth1 as 200.100.23.4 -> 234.56.78.9:4444 and manage the responses to send back the packets 234.56.78.9:4444 -> 200.100.23.4 from eth1 to 192.168.1.2:4444 -> 192.168.1.x on eth0

i hope i have found a way to explain the problem!!! Thanks a lot

Ivan Hernandez
Kiu System Solutions

#1 lore raw
Quoted 3 lines · Ivan Hernandez

On a LAN a set of computers in the range 192.168.1.x that have already assigned a default gw 192.168.1.1 run an application that must connect to an internet server 234.56.78.9 to the tcp port 4444 much like a telnet app.

The 192.168.1.1 gw does no serves internet in any way so the 192.168.1.x network is isolated except for 1 computer, that has 2 nic's and is the computer running linux that i need to configure.

<snip>

Is there something preventing you from moving your Linux system to 192.168.1.1, i.e. a device that is already there?

If there is a device at 192.168.1.1 what sort of control do you have over it? Can you configure it to use 192.168.1.2 as its default gateway?

I would make your Linux system be the default gateway for the 192.168.1.x network, either by being 192.168.1.1 or by having 192.168.1.1 use 192.168.1.2 as its default gateway.

This way, your client systems can use 192.168.1.1 as the default gateway for the network, even if it is by way of 192.168.1.2.

Grant. . . .