LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   port fowarding on linux (https://www.linuxquestions.org/questions/linux-newbie-8/port-fowarding-on-linux-783068/)

guylux 01-18-2010 05:10 PM

port fowarding on linux
 
I am trying to route a security video server wich is inside my network to the internet.
my network is two interface eth0 (internet network xxx.xxx.xxx.198 and internal network 192.168.5.1

I am trying to see an web server on 192.168.5.184
Can somebody help.

Newbi lost in route..

rweaver 01-19-2010 09:58 AM

You need to setup NAT on the router between the host and the internet. eg: forward port xyz to port xyz on whatever internal machine.

If memory serves me something like this (as root):

Code:

iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.198 --dport 80 -j DNAT --to 192.168.5.184:80
iptables -A FORWARD -p tcp -i eth0 -d 192.168.5.184 --dport 80 -j ACCEPT


guylux 01-19-2010 11:55 AM

Quote:

Originally Posted by rweaver (Post 3832281)
You need to setup NAT on the router between the host and the internet. eg: forward port xyz to port xyz on whatever internal machine.

If memory serves me something like this (as root):

Code:

iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.198 --dport 80 -j DNAT --to 192.168.5.184:80
iptables -A FORWARD -p tcp -i eth0 -d 192.168.5.184 --dport 80 -j ACCEPT


Fantastic it work perfectly .
Thaks a lot

Guy


All times are GMT -5. The time now is 01:34 AM.