Здравствуйте помогите настроить доступ к Ftp серверу из внешки.
vlan1 - внешка x.x.x.x
eth0 - локальная сеть 192.168.0.1
ftp proftpd - 192.168.0.254 ; PassivePorts 50000-50100
на маршрутизаторе ввел следующие правила iptables
iptables -I INPUT -p tcp --dport 20:21 -j ACCEPT
iptables -t nat -I PREROUTING -d x.x.x.x -p tcp --dport 20:21 -j DNAT --to 192.168.0.254:20-21
iptables -I FORWARD -i vlan1 -p tcp -d 192.168.0.254 --dport 20:21 -j ACCEPT
iptables -t nat -I PREROUTING -p tcp -d x.x.x.x --dport 50000:50100 -j DNAT --to 192.168.0.254:50000-50100
iptables -I FORWARD -i vlan1 -p tcp -d 192.168.0.254 --dport 50000:50100 -j ACCEPT
но доступ к
ftp://x.x.x.x есть только из локальной сети.
root@DD-WRT:~# iptables -t nat -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DNAT udp -- anywhere host.miran.ru udp dpt:39471 to:192.168.0.136:39471
DNAT tcp -- anywhere host.miran.ru tcp dpt:39471 to:192.168.0.136:39471
DNAT tcp -- anywhere host.miran.ru tcp dpts:50000:50100 to:192.168.0.254:50000-50100
DNAT tcp -- anywhere host.miran.ru tcp dpts:ftp-data:ftp to:192.168.0.254:20-21
DNAT tcp -- anywhere host.miran.ru tcp dpt:ssh to:192.168.0.1:22
DNAT icmp -- anywhere host.miran.ru to:192.168.0.1
DNAT tcp -- anywhere host.miran.ru tcp dpt:55876 to:192.168.0.119:55876
DNAT udp -- anywhere host.miran.ru udp dpt:55876 to:192.168.0.119:55876
DNAT udp -- anywhere host.miran.ru udp dpt:59423 to:192.168.0.107:59423
DNAT tcp -- anywhere host.miran.ru tcp dpt:59423 to:192.168.0.107:59423
DNAT udp -- anywhere host.miran.ru udp dpt:62867 to:192.168.0.119:62867
DNAT tcp -- anywhere host.miran.ru tcp dpt:62867 to:192.168.0.119:62867
DNAT udp -- anywhere host.miran.ru udp dpt:6666 to:192.168.0.136:6666
DNAT tcp -- anywhere host.miran.ru tcp dpt:6666 to:192.168.0.136:6666
DNAT tcp -- anywhere host.miran.ru tcp dpt:39471 to:192.168.0.136:39471
DNAT udp -- anywhere host.miran.ru udp dpt:39471 to:192.168.0.136:39471
DNAT tcp -- anywhere host.miran.ru tcp dpt:25037 to:192.168.0.126:25037
DNAT udp -- anywhere host.miran.ru udp dpt:25037 to:192.168.0.126:25037
DNAT tcp -- anywhere host.miran.ru tcp dpts:50000:50100 to:192.168.0.254
DNAT udp -- anywhere host.miran.ru udp dpts:50000:50100 to:192.168.0.254
TRIGGER 0 -- anywhere host.miran.ru TRIGGER type:dnat match:0 relate:0
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
SNAT 0 -- 192.168.0.0/24 anywhere to:x.x.x.x
MASQUERADE 0 -- anywhere anywhere MARK match 0x1
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
root@DD-WRT:~#
root@DD-WRT:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpts:ftp-data:ftp
DROP tcp -- anywhere anywhere tcp dpt:webcache
DROP tcp -- anywhere anywhere tcp dpt:www
DROP tcp -- anywhere anywhere tcp dpt:https
DROP tcp -- anywhere anywhere tcp dpt:69
DROP tcp -- anywhere anywhere tcp dpt:telnet
Chain FORWARD (policy ACCEPT)
target prot opt source destination
ACCEPT udp -- anywhere 192.168.0.126 udp dpt:25037
ACCEPT tcp -- anywhere 192.168.0.126 tcp dpt:25037
ACCEPT udp -- anywhere 192.168.0.136 udp dpt:39471
ACCEPT tcp -- anywhere 192.168.0.136 tcp dpt:39471
ACCEPT tcp -- anywhere 192.168.0.254 tcp dpts:50000:50100
ACCEPT tcp -- anywhere 192.168.0.254 tcp dpts:ftp-data:ftp
ACCEPT 0 -- anywhere anywhere state RELATED,ESTABLISHED
lan2wan 0 -- anywhere anywhere
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT 0 -- anywhere anywhere
ACCEPT tcp -- anywhere 192.168.0.119 tcp dpt:55876
ACCEPT udp -- anywhere 192.168.0.119 udp dpt:55876
ACCEPT udp -- anywhere note3 udp dpt:59423
ACCEPT tcp -- anywhere note3 tcp dpt:59423
ACCEPT udp -- anywhere 192.168.0.119 udp dpt:62867
ACCEPT tcp -- anywhere 192.168.0.119 tcp dpt:62867
ACCEPT udp -- anywhere 192.168.0.136 udp dpt:6666
ACCEPT tcp -- anywhere 192.168.0.136 tcp dpt:6666
ACCEPT tcp -- anywhere 192.168.0.254 tcp dpts:50000:50100
ACCEPT udp -- anywhere 192.168.0.254 udp dpts:50000:50100
TRIGGER 0 -- anywhere anywhere TRIGGER type:in match:0 relate:0
trigger_out 0 -- anywhere anywhere
ACCEPT 0 -- anywhere anywhere state NEW
http пробрасывал успешно и правилами iptables и через веб интерфейс маршрутизатора , а ftp не удается. Что я делаю не так?