how to port forward
hello everyone..
what is the command to forward port 21(ftp) request to 192.168.x.xx(this acts as a ftp server) in my linux gateway.i am using mandrake 10.can anybody pls help me.i cannot connect to my ftp server when i try to access it outside.:( |
Usually 'iptables', but I don't know Mandrake. Iptables is discussed plenty and recently on linuxquestions.
You probably have NAT-HOWTO.html right on your coputer, maybe in /usr/share/doc/iptables/html/ -- otherwise see http://www.netfilter.org/documentati...NAT-HOWTO.html. It states that port forwarding is a form of DNAT, and explains how to do it. |
port forwarding
I dont know why u need to forward the port as 21 port data connefction port already assigned for ftp service ...used for enabling data control connection for ftp server
|
Quote:
|
yah.i have a linux gateway which is also a proxy cahing server(squid)and i want to forward ftp connections to my ftp server(cerberus ftp)that runs on windows 2003 which is inside my network.i have no bright idea about port forwarding on linux so i jump into this forum for help and info..anyway i have done searching and looking at some linux forums and someone suggested that i should used rinetd but further searching revealed that rinetd does not redirect ftp because ftp uses more that one socket.another one suggested that i should do this iptable rule on my firewall script:
iptables -t nat -I PREROUTING -p tcp -i INTERNET --dport 21 -j DNAT --to 192.168.x.xx:21 where INTERNET is my gateway(eth0). is that correct? or is there anything else that i should do.how about rinetd?is it true that rinetd wont work on ftp or is there a workaround for it? thanks for all the help and suggestions. :newbie: :study: |
Quote:
turn on ip forwarding: Code:
echo "1" > /proc/sys/net/ipv4/ip_forward Code:
echo "0" > /proc/sys/net/ipv4/ip_forward Code:
iptables -A FORWARD -p tcp -i INTERNET --dport 21 -d 192.168.x.xx -j ACCEPT Code:
/sbin/modprobe ip_nat_ftp |
All times are GMT -5. The time now is 01:57 AM. |