muszę stworzyć firewalla na komputerze klienckim za natem internet poprzez ruter który będzie spełniał następujące założenia:
wszystkie otwarte poprty wychodzące wszystkie porty przyhodzące zablokowane z wyjątkiem 4 usłóg
ssh samba rtorrent vnc
firewall conf
Kod: Zaznacz cały
# wlaczenie w kernelu forwardowania
echo 1 > /proc/sys/net/ipv4/ip_forward
# czyszczenie starych regul
iptables -F
iptables -X
iptables -t nat -X
iptables -t nat -F
# ustawienie polityki dzialania
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# zezwolenie na laczenie sie z naszym zewnetrznym ip po ssh
iptables -A INPUT -i lo -j ACCEPT
iptables -A FORWARD -o lo -j ACCEPT
iptables -A INPUT -s 0/0 -d 192.168.1.2 -p tcp --dport 22 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 192.168.1.2 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -s 0/0 -d 192.168.1.2 -p udp --dport 22 -j ACCEPT
iptables -A OUTPUT -s 0/0 -d 192.168.1.2 -p udp --dport 22 -j ACCEPT
# polaczenia nawiazane
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Otwarte Porty
# SSH
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 22 -m state --state NEW -j ACCEPT
# RTORRENT
iptables -A INPUT -p tcp --dport 58580 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 58580 -m state --state NEW -j ACCEPT
# SAMBA
iptables -A INPUT -p tcp --dport 135 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 137 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 138 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 139 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 445 -m state --state NEW -j ACCEPT
# VNC
iptables -A INPUT -p tcp --dport 5500 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 5500 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 5800 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 5800 -m state --state NEW -j ACCEPT
iptables -A INPUT -p tcp --dport 5900 -m state --state NEW -j ACCEPT
iptables -A INPUT -p udp --dport 5900 -m state --state NEW -j ACCEPT
google przeglądam cały czas w poszukiwaniu odpowiedzi
za pomoc thx