LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Port Forwarding For Router (http://www.linuxquestions.org/questions/linux-networking-3/port-forwarding-for-router-586137/)

kool_kid 09-20-2007 01:38 PM

Port Forwarding For Router
 
Hiya

i have centos4 and i have configured it as a router with load balance n failover, this machine is connected to internal lan with private ip range 192.168.x.x, my linux macine has a direct ADSL internet with static ip i would like to enable port forward so that i can access my private lan network.Can someone please tell me how to do it thanks in advance.

bsdunix 09-20-2007 04:38 PM

I would think you could use DNAT:
Code:

# iptables -t nat -A PREROUTING -p tcp -d 10.10.20.99 --dport 80 -j DNAT --to-destination 10.10.14.2
http://linux-ip.net/html/nat-dnat.html
http://www.netfilter.org/documentati...O-6.html#ss6.2

kool_kid 09-20-2007 09:32 PM

# iptables -t nat -A PREROUTING -p tcp -d 10.10.20.99 --dport 80 -j DNAT --to-destination 10.10.14.2

is 10.10.20.99 private lan ip from source to destination (10.10.14.2) ?

bsdunix 09-21-2007 01:09 PM

The addresses and port is an example.

When the firewall receives port 80 traffic destined for IP aaa.bbb.ccc.ddd it routes it to IP bbb.ccc.ddd.eee

kool_kid 09-25-2007 02:10 PM

k thanks bro


All times are GMT -5. The time now is 09:28 AM.