|
Нужно открыть порты только для входящих соединений.
====================================================================== ====
# Определение ip eth0
LAN_IP=$(ifconfig eth0 | head -n 2 | tail -n 1 | cut -d: -f2 | cut -d" " -f 1)
#1) Local Port: 4662
#Remote Port: each
#Protokoll: TCP
#Direktion: ingoing
#Funktion: Client Port / Verbindung von anderen Clients, Quellentausch zwischen Clients
#
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4662 -j DNAT --to-destination 192.168.1.2
iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 4662 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.1.2 --dport 4662 -j ACCEPT
# 3) Local Port: 4672
#Remote Port: each
#Protokoll: UDP
#Richtung: ingoing
#Funktion: Quellentausch zwischen Clients / erweitertes eMule Protokoll, Queue Rating, File Reask # #Ping
#
iptables -t nat -A PREROUTING -i ppp0 -p udp --dport 4672 -j DNAT --to-destination 192.168.1.2
iptables -t nat -A POSTROUTING -o eth0 -p udp --dport 4672 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p udp -d 192.168.1.2 --dport 4672 -j ACCEPT
#7) Local Port: 4711
#Remote Port: jeder
#Protokoll: TCP
#Richtung: ingoing
#Funktion: Verbindungsport des Webservers
#
iptables -t nat -A PREROUTING -i ppp0 -p tcp --dport 4711 -j DNAT --to-destination 192.168.1.2
iptables -t nat -A POSTROUTING -o eth0 -p tcp --dport 4711 -j SNAT --to-source $LAN_IP
iptables -A FORWARD -i ppp0 -m state --state NEW -p tcp -d 192.168.1.2 --dport 4711 -j ACCEPT
====================================================================== =======
|