Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ip forwarding

Status
Not open for further replies.

RicardoPereira

Programmer
Jun 3, 2003
255
PT
It is possible configure linux to force an ip forward to another?

Here is what i need:

I have 2 servers, Server1 with 1 network adapter (internal) and Server2 with 2 network adapters (one internal and the another external).
From Server2 i what to have an external ip that forward the reply to the internal dapter.

Server1: 10.2.255.2
Server2: 192.168.10.1

I need to had another ip (like 192.168.10.2) that forward to 10.2.255.2.

something like:

> ping 192.168.10.2
64 bytes from 10.2.255.2: icmp_seq=1 ttl=255 time=1.83 ms
64 bytes from 10.2.255.2: icmp_seq=2 ttl=255 time=0.446 ms


what have now is;
> ping 192.168.10.2
PING 192.168.10.2 (192.168.10.2) from 192.168.10.1 : 56(84) bytes of data.
From 192.168.10.2 icmp_seq=1 Destination Host Unreachable
From 192.168.10.2 icmp_seq=2 Destination Host Unreachable
From 192.168.10.2 icmp_seq=3 Destination Host Unreachable


I really need help.
 
You can't do that, IP doesn't work that way. I'm curious as to why you want to, we may be able to tell you why you don't or suggest a work around.
 
I want to access the 906 port of the local network 1(nic 1) throught the External network 3 (nic 3).
But the External network is not linked with the internal network. That is why i need to redirect from nic 2 to nic 3.

nic1 Local Network 1 ----
|---
nic 2 Local Network 2 ----
|---
nic 3 External Network ---

Any tip for this ?
 
Since this is a linux forum, I'll assume that Server2 is running linux of some sort.

You should be able to turn on port-forwarding and have the server also act as a switch/router. The exact process varies a bit between distributions.

Be careful! If you enable port forwarding within this server you'll very likely want to configure iptables so that the box also acts as a firewall!

And you may have to turn on NAT, depending on exactly what addresses you're using on the private network.


Kent
 
You want to NAT the internal address using IPTables and forward connections to that port to the appropriate machine on your private network. Your pings won't look like you want, but that's not important.

You could set up your intermediate linux box to proxy arp and forward, but that's not really the right way to do it.
 
Yes, i know that the solution is turn on the port forwarding, NAT and configure iptables. My problem is how.
Could you please give me an example ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top