Подскажите пожалйста как сделать проброс порта для того что бы ФТП был виден извне сети.Есть шлюз Дебиан, за ним находится сетевое хранилище данных с ФТП.
пишу не дебиане в iptablese:
#!/bin/bash
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -F
iptables -t nat -F
iptables -t mangle -F
iptables -X
iptables -t nat -X
iptables -t mangle -X
#################################################################
# filter #
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
# nat #
iptables -t nat -P PREROUTING ACCEPT
iptables -t nat -P OUTPUT ACCEPT
iptables -t nat -P POSTROUTING ACCEPT
# mangle #
iptables -t mangle -P PREROUTING ACCEPT
iptables -t mangle -P OUTPUT ACCEPT
#################################################################
# drop #
iptables -A FORWARD -m string --string "XXXXXXX.com.ua" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXX.ru" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXX.com" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXXXX.ru" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXX.net" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXX.org.ru" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "xXXXXX.com.ua" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXXXX.com" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXXXX.ua" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXXXX.ru" --algo kmp --to 65535 -j DROP #
iptables -A FORWARD -m string --string "XXXXXX.com" --algo kmp --to 65535 -j DROP #
# probros portov #
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 51000 -j DNAT --to-destination 192.168.1.7:51000 #
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 50000 -j DNAT --to-destination 192.168.1.7:50000 #
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 3389 -j DNAT --to-destination 192.168.1.13:3389 # RD Ilya
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 50021 -j DNAT --to-destination 192.168.1.8:21 # FTP za wluzom
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 41000 -j DNAT --to-destination 192.168.1.9:41000
iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip.ip --dport 3388 -j DNAT --to-destination 192.168.1.235:3389 # RDP Jyrakovsky
#################################################################
# nat #
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -d 0.0.0.0/0 -j SNAT --to-source ip.ip.ip.ip # pravilo vsem kyda ygodno
#################################################################
cat /proc/sys/net/ipv4/ip_forward