Fehlermeldungen und Iptable Konfiguration
von RedRocket88- SNIPPET_TEXT:
-
- Ausgabe test als bashscript:
- [code]
- root@raspberrypi:/home/pi/IpTablesKillswitchVPN# bash -x ipv4_2.sh
- + iptables -P INPUT DROP
- + iptables -P FORWARD DROP
- + iptables -P OUTPUT DROP
- + iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- + iptables -A OUTPUT -o lo -j ACCEPT
- + iptables -A OUTPUT -o tun0 -p icmp -j ACCEPT
- + iptables -A OUTPUT -d 192.168.2.0/24 -j ACCEPT
- + iptables -A INPUT -s 192.168.2.0/24 -j ACCEPT
- + iptables -A OUTPUT -d 192.168.1.0/24 -j ACCEPT
- + iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
- + iptables -A OUTPUT -d 208.67.222.222 -j ACCEPT
- + iptables -A OUTPUT -d 208.67.220.220 -j ACCEPT
- + iptables -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
- + iptables -A OUTPUT -o tun0 -j ACCEPT
- [/code]
- Ausgabe test iptables-restore bzw iptables-nft-restore und xtable-restore und iptables-restore-translate:
- [code]
- root@raspberrypi:/home/pi# iptables-restore < /home/pi/IpTablesKillswitchVPN/ipv4
- iptables-restore v1.8.2 (nf_tables): no command specified
- Error occurred at line: 33
- root@raspberrypi:/home/pi/IpTablesKillswitchVPN# iptables-nft-restore < /etc/ipv4
- iptables-restore v1.8.2 (nf_tables): no command specified
- Error occurred at line: 33
- root@raspberrypi:/home/pi# xtables-restore -4 -T </home/pi/IpTablesKillswitchVPN/ipv4>
- bash: Syntaxfehler beim unerwarteten Wort `newline'
- Ausgabe Iptables convert:
- root@raspberrypi:/home/pi/IpTablesKillswitchVPN# iptables-restore-translate -f ipv4 > ipv4_nf.txt
- iptables-translate-restore: line 2 failed
- [/code]
- Meine IpTable Konfiguration
- [code]
- *filter
- # IPTable VPN Killswitch, von https://linuxconfig.org/how-to-create-a-vpn-killswitch-using-iptables-on-linux
- # Eingerichtet am 26.03.2020
- # Kompletten Verkehr erstmal verbieten, drop traffic by default
- -P INPUT DROP
- -P FORWARD DROP
- -P OUTPUT DROP
- # Only allow inbound traffic from established or related connections
- -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
- # Allow the loopback interface and ping
- -A OUTPUT -o lo -j ACCEPT
- -A OUTPUT -o tun0 -p icmp -j ACCEPT
- # LAN Verkehr erlauben sowohl Input als auch Output,
- # für SSH, Weboberflächen usw
- -A OUTPUT -d 192.168.2.0/24 -j ACCEPT
- -A INPUT -s 192.168.2.0/24 -j ACCEPT
- -A OUTPUT -d 192.168.1.0/24 -j ACCEPT
- -A INPUT -s 192.168.1.0/24 -j ACCEPT
- # DNS Server die erlaubt sind zu kontaktieren
- # Ich wähle hier OpenDNS, ich halte die für vertrauenswürdig und zuverlässig
- -A OUTPUT -d 208.67.222.222 -j ACCEPT
- -A OUTPUT -d 208.67.220.220 -j ACCEPT
- # VPN Server Port, UDP/TCP und Interface(tun0) erlauben
- -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
- -A OUTPUT -o tun0 -j ACCEPT
- COMMIT
- [/code]
Quellcode
Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN