Точно так. Если повторится скрин сделаю. Было так несколько раз и порт каждый раз другой.
#!/bin/bash
# Adresa routera -------
# LAN
server0=192.168.1.254
# -----------------------
# Interfeis smotrjaschii na klientov
iface_cli=eth0
# Interfeis smotrjaschii vo vneshnii mir
iface_world=ppp0
iface_world1=ppp1
# portu na kotoruckh rabotaet konfigurator i avtorizator
conf_port=5555
user_port1=5555
user_port2=5555
# Razreshaem forvarding paketov mezhdy interfeisami
# Eta shtuka neobjazatel'na, prosto v nekotorux distributivax
# po umolchaniju forvarding razreshon, a v nekotorux - zapreschen
# Esli mu podstrakhuemsja, xuzhe ne budet
echo "1" > /proc/sys/net/ipv4/ip_forward
echo "1" > /proc/sys/net/ipv4/ip_dynaddr
# clear pravila fairvola
iptables -t filter -F
iptables -t filter -X
iptables -t nat -F
iptables -t nat -X
# politika poumolchaniju DROP - vsem vse zaprescheno
iptables -t filter -P INPUT DROP
iptables -t filter -P FORWARD DROP
iptables -t filter -P OUTPUT DROP
################################
#########
# TCP rules
######
# In Microsoft Networks you will be swamped by broadcasts. These lines
# will prevent them from showing up in the logs.
iptables -A INPUT -i $iface_world -p TCP -m multiport --destination-port 22,53,139,445,3128,8080,5555,5900,22222,42111 -j DROP
iptables -A FORWARD -i $iface_world -p TCP -m multiport --destination-port 22,53,139,445,3128,8080,5555,5900,22222,42111 -j DROP
iptables -A INPUT -p UDP -i $iface_world --destination-port 135:139 -j DROP
iptables -A FORWARD -p UDP -i $iface_world --destination-port 135:139 -j DROP
iptables -A INPUT -i $iface_world1 -p TCP -m multiport --destination-port 22,53,139,445,3128,8080,5555,5900,22222,42111 -j DROP
iptables -A FORWARD -i $iface_world1 -p TCP -m multiport --destination-port 22,53,139,445,3128,8080,5555,5900,22222,42111 -j DROP
iptables -A INPUT -p UDP -i $iface_world1 --destination-port 135:139 -j DROP
iptables -A FORWARD -p UDP -i $iface_world1 --destination-port 135:139 -j DROP
# If we get DHCP requests from the Outside of our network, our logs will
# be swamped as well. This rule will block them from getting logged.
iptables -A FORWARD -p UDP -i $iface_world -d 255.255.255.255 --destination-port 67:68 -j DROP
iptables -A FORWARD -p UDP -i $iface_world1 -d 255.255.255.255 --destination-port 67:68 -j DROP
####
# ICMP rules
# Rules for incoming packets from the internet.
iptables -A INPUT -p ALL -i $iface_world -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -p ALL -i $iface_world1 -m state --state ESTABLISHED,RELATED -j ACCEPT
# If you have a Microsoft Network on the outside of your firewall, you may
# also get flooded by Multicasts. We drop them so we do not get flooded by
# logs
iptables -A INPUT -i $iface_world -d 224.0.0.0/8 -j DROP
iptables -A FORWARD -i $iface_world -d 224.0.0.0/8 -j DROP
iptables -A INPUT -i $iface_world1 -d 224.0.0.0/8 -j DROP
iptables -A FORWARD -i $iface_world1 -d 224.0.0.0/8 -j DROP
#########
# 4.1.5 FORWARD chain
#########
# 4.1.6 OUTPUT chain
iptables -A OUTPUT -p ALL -o $iface_world -j ACCEPT
iptables -A OUTPUT -p ALL -o $iface_world1 -j ACCEPT
################################
iptables -t filter -A OUTPUT -p ALL -s $server0 -j ACCEPT
# razreshaem pingam xodit' vezde i vsegda
iptables -t filter -A INPUT -p icmp -j ACCEPT
iptables -t filter -A FORWARD -p icmp -j ACCEPT
# razreshaem vse na lokal'nom interfeise
iptables -t filter -A INPUT -d 127.0.0.1 -j ACCEPT
iptables -t filter -A OUTPUT -s 127.0.0.1 -j ACCEPT
#open port for ssh
iptables -t filter -A INPUT -p tcp -s 192.168.1.0/24 -d $server0 --dport 22 -j ACCEPT
# DNS. Zamechu, DNS pabotaet i po TCP i po UDP
iptables -t filter -A INPUT -p tcp --sport 53 -j ACCEPT
iptables -t filter -A FORWARD -p tcp --sport 53 -j ACCEPT
iptables -t filter -A FORWARD -p tcp --dport 53 -j ACCEPT
iptables -t filter -A OUTPUT -p tcp --dport 53 -j ACCEPT
iptables -t filter -A INPUT -p udp --sport 53 -j ACCEPT
iptables -t filter -A FORWARD -p udp --sport 53 -j ACCEPT
iptables -t filter -A FORWARD -p udp --dport 53 -j ACCEPT
iptables -t filter -A OUTPUT -p udp --dport 53 -j ACCEPT
# Stargazer configurator
iptables -t filter -A INPUT -p tcp -s 192.168.1.0/24 -d $server0 --dport $conf_port -j ACCEPT
# UDP stargazer InetAccess
iptables -t filter -A INPUT -p udp -s 192.168.1.0/24 --sport $user_port2 -d $server0 --dport $user_port1 -j ACCEPT
###################
# for users flyer
iptables -t nat -A PREROUTING -s 192.168.1.110 -j ACCEPT
iptables -t nat -A PREROUTING -s 192.168.1.102 -j ACCEPT
iptables -t nat -A PREROUTING -s 192.168.1.103 -j ACCEPT
# transparent proxi
iptables -t nat -A PREROUTING -p tcp -s 192.168.1.0/24 -d 192.168.1.254 --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -s 192.168.1.0/24 -p tcp --dport 80 -j REDIRECT --to-port 3128
iptables -t nat -A PREROUTING -s 192.168.1.0/24 -j ACCEPT
# na globax
# iptables -t nat -A PREROUTING -i eth0 -p tcp -m multiport --destination-port ! 22,53,139,5555,5900 -j REDIRECT --to-port 8000
# masquerade
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o $iface_world -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o $iface_world1 -j MASQUERADE
# zapusk billinga
stargazer
exit 1