bibi-phoque
10-02-2009, 18:26
Hello,
this thing is driving me really crazy so I wanted to see if anybody could clear things up for me. First of all, I did get it working, but the way I did it is not logical.
I have the latest Oleg's firmware so I'm using vsftp.
My post-firewall is simple and used only to open specific ports (ftp, ssh, web server, etc..)
#!/bin/sh
# this opens the ssh port to internet! Be sure to have strong passwords!
iptables -I INPUT -m tcp -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 81 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 9091 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 21 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 51413 -j ACCEPT
I have followed Wengi's tutorial at the letter.
ssh works from wan, webserver works from wan but ftp is giving me trouble (FTP from LAN works no problem).
- First, without a virtual server defined in the GUI, I cannot connect.
- If I setup a virtual server (port forwarding) for 20:21 and direct to 21 on 192.168.1.1, the ftp client is able to connect but is unable to print the listing which then produce a timout error (both in passive and active mode using filezilla).
- If I setup a virtual server, but this time forwarding port 20 and 21 to my wl500 WAN IP, then I can connect no problem and transfer data.
Even though I got it working, I don't understand the logic behind it and I'm sure there is another way to achieve this.
I did a lot of research and played a bit with the post-firewall, adding PREROUTING rule like this one (and removing my virtual server):
iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 21 -j DNAT --to-destination $4:21
But it doesn't work.
Can somebody tell me if what I'm doing is correct? Anybody could share settings (post-firewall, virtual server, ftp client settings) of a working FTP from WAN?
Thanks in advance,
Yann
this thing is driving me really crazy so I wanted to see if anybody could clear things up for me. First of all, I did get it working, but the way I did it is not logical.
I have the latest Oleg's firmware so I'm using vsftp.
My post-firewall is simple and used only to open specific ports (ftp, ssh, web server, etc..)
#!/bin/sh
# this opens the ssh port to internet! Be sure to have strong passwords!
iptables -I INPUT -m tcp -p tcp --dport 443 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 81 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 9091 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 21 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 80 -j ACCEPT
iptables -I INPUT -m tcp -p tcp --dport 51413 -j ACCEPT
I have followed Wengi's tutorial at the letter.
ssh works from wan, webserver works from wan but ftp is giving me trouble (FTP from LAN works no problem).
- First, without a virtual server defined in the GUI, I cannot connect.
- If I setup a virtual server (port forwarding) for 20:21 and direct to 21 on 192.168.1.1, the ftp client is able to connect but is unable to print the listing which then produce a timout error (both in passive and active mode using filezilla).
- If I setup a virtual server, but this time forwarding port 20 and 21 to my wl500 WAN IP, then I can connect no problem and transfer data.
Even though I got it working, I don't understand the logic behind it and I'm sure there is another way to achieve this.
I did a lot of research and played a bit with the post-firewall, adding PREROUTING rule like this one (and removing my virtual server):
iptables -t nat -A PREROUTING -i vlan1 -p tcp --dport 21 -j DNAT --to-destination $4:21
But it doesn't work.
Can somebody tell me if what I'm doing is correct? Anybody could share settings (post-firewall, virtual server, ftp client settings) of a working FTP from WAN?
Thanks in advance,
Yann