Hi,
hab mal wieder mit nem neuen Skript IPTables rumgespielt und jetzt bekomm ich folgenden Fehler.
root@rt-102:/# root@rt-102:/# ./firewall.sh stop Stoppe IP-Paketfilter Deaktiviere IP-Routing root@rt-102:/# ./firewall.sh start Starte IP-Paketfilter iptables: No chain/target/match by that name iptables: No chain/target/match by that name root@rt-102:/#
Was findert der nicht ?? Ich dem Skript sieht für mich alles richtig aus. Bitte schaut mal drüber und helft mir bei meinem Problem, danke.
Skript:
#!/bin/bash #----------------------------------------------------------------------------- # # IPTabels fuer CPN-Router-102 # #----------------------------------------------------------------------------- case "$1" in ####################################################### start) echo "Starte IP-Paketfilter" # proc Konfiguration # Aktiviert das ROUTING echo " 1" > /proc/sys/net/ipv4/ip_forward echo "1" > /proc/sys/net/ipv4/tcp_syncookies echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses # Alte Regeln loeschen iptables -F INPUT iptables -F OUTPUT iptables -F FORWARD iptables -F firewall iptables -X firewall iptables -N firewall iptables -A firewall -i lo -j ACCEPT iptables -A firewall -m state --state INVALID -j DROP iptables -A firewall -m state --state RELATED,ESTABLISHED -j ACCEPT iptables -t nat -F POSTROUTING iptables -t nat -F PREROUTING iptables -t nat -F OUTPUT iptables -F #* -> fw #iptables -A INPUT -j ACCEPT #iptables -A INPUT -i eth0 -s 192.168.10.0/24 -j ACCEPT #iptables -A INPUT -i eth2 -s 192.168.200.0/24 -j ACCEPT # intern2 - LAN-CPN #iptables -A firewall -i eth0 -o eth2 -d 0.0.0.0/0.0.0.0 -j ACCEPT # LAN-CPN - intern2 #iptables -A firewall -i eth2 -o eth0 -d 192.168.10.0/255.255.255.0 -j ACCEPT #rest abweisen #iptables -A firewall -p tcp -j REJECT --reject-with tcp-reset #Pakete in Regelwerk geben #iptables -A INPUT -j firewall #iptables -A FORWARD -j firewall # erlaube Pings iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT # erlaube SSH iptables -A INPUT -p tcp --dport 22 --tcp-flags ALL SYN -j ACCEPT # Masquerading aktivieren iptables -A POSTROUTING -o eth02 -s 192.168.10.0/24 -t nat -j MASQUERADE # NAT fue die Clients im LAN /sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward ;; ############################################ #Beenden stop) echo "Stoppe IP-Paketfilter" # Tabelle flushen iptables -F iptables -t nat -F iptables -t mangle -F iptables -X iptables -t nat -X iptables -t mangle -X echo "Deaktiviere IP-Routing" echo 0 > /proc/sys/net/ipv4/ip_forward # Default Policies setzen iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT iptables -P FORWARD ACCEPT ;; ############################################ status) echo "Tabelle filter" iptables -L -vn echo "Tabelle nat" iptables -nat -L -vn echo "Tabelle mangle" iptables -t mangle -L -vn ;; ############################################# *) echo "Fehlerhafter Aufruf" echo "Syntax: $0 {start|stop|status}" exit 1 ;; esac
Hab erstmal sehr viel noch auskommentiert um die Fehlersuche zu vereinfachen, aber ich find's einfach nit.