NoPaste

Fehlermeldungen und Iptable Konfiguration

von RedRocket88

SNIPPET_TEXT:
  1. Ausgabe test als bashscript:
  2.  [code]
  3. root@raspberrypi:/home/pi/IpTablesKillswitchVPN# bash -x ipv4_2.sh
  4. + iptables -P INPUT DROP
  5. + iptables -P FORWARD DROP
  6. + iptables -P OUTPUT DROP
  7. + iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
  8. + iptables -A OUTPUT -o lo -j ACCEPT
  9. + iptables -A OUTPUT -o tun0 -p icmp -j ACCEPT
  10. + iptables -A OUTPUT -d 192.168.2.0/24 -j ACCEPT
  11. + iptables -A INPUT -s 192.168.2.0/24 -j ACCEPT
  12. + iptables -A OUTPUT -d 192.168.1.0/24 -j ACCEPT
  13. + iptables -A INPUT -s 192.168.1.0/24 -j ACCEPT
  14. + iptables -A OUTPUT -d 208.67.222.222 -j ACCEPT
  15. + iptables -A OUTPUT -d 208.67.220.220 -j ACCEPT
  16. + iptables -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
  17. + iptables -A OUTPUT -o tun0 -j ACCEPT
  18. [/code]
  19.  
  20. Ausgabe test iptables-restore bzw iptables-nft-restore und xtable-restore und iptables-restore-translate:
  21. [code]
  22.  
  23. root@raspberrypi:/home/pi# iptables-restore < /home/pi/IpTablesKillswitchVPN/ipv4
  24. iptables-restore v1.8.2 (nf_tables): no command specified
  25. Error occurred at line: 33
  26.  
  27. root@raspberrypi:/home/pi/IpTablesKillswitchVPN# iptables-nft-restore < /etc/ipv4
  28. iptables-restore v1.8.2 (nf_tables): no command specified
  29. Error occurred at line: 33
  30.  
  31. root@raspberrypi:/home/pi# xtables-restore -4 -T </home/pi/IpTablesKillswitchVPN/ipv4>
  32. bash: Syntaxfehler beim unerwarteten Wort `newline'
  33.  
  34. Ausgabe Iptables convert:
  35. root@raspberrypi:/home/pi/IpTablesKillswitchVPN# iptables-restore-translate -f ipv4 > ipv4_nf.txt
  36. iptables-translate-restore: line 2 failed
  37. [/code]
  38.  
  39. Meine IpTable Konfiguration
  40. [code]
  41. *filter
  42. # IPTable VPN Killswitch, von https://linuxconfig.org/how-to-create-a-vpn-killswitch-using-iptables-on-linux
  43. # Eingerichtet am 26.03.2020
  44.  
  45. # Kompletten Verkehr erstmal verbieten, drop traffic by default
  46. -P INPUT DROP
  47. -P FORWARD DROP
  48. -P OUTPUT DROP
  49.  
  50. # Only allow inbound traffic from established or related connections
  51. -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
  52.  
  53. # Allow the loopback interface and ping
  54. -A OUTPUT -o lo -j ACCEPT
  55. -A OUTPUT -o tun0 -p icmp -j ACCEPT
  56.  
  57. # LAN Verkehr erlauben sowohl Input als auch Output,
  58. # für SSH, Weboberflächen usw
  59. -A OUTPUT -d 192.168.2.0/24 -j ACCEPT
  60. -A INPUT -s 192.168.2.0/24 -j ACCEPT
  61. -A OUTPUT -d 192.168.1.0/24 -j ACCEPT
  62. -A INPUT -s 192.168.1.0/24 -j ACCEPT
  63.  
  64. # DNS Server die erlaubt sind zu kontaktieren
  65. # Ich wähle hier OpenDNS, ich halte die für vertrauenswürdig und zuverlässig
  66. -A OUTPUT -d 208.67.222.222 -j ACCEPT
  67. -A OUTPUT -d 208.67.220.220 -j ACCEPT
  68.  
  69. # VPN Server Port, UDP/TCP und Interface(tun0) erlauben
  70. -A OUTPUT -p tcp -m tcp --dport 443 -j ACCEPT
  71. -A OUTPUT -o tun0 -j ACCEPT
  72.  
  73. COMMIT
  74. [/code]

Quellcode

Hier kannst du den Code kopieren und ihn in deinen bevorzugten Editor einfügen. PASTEBIN_DOWNLOAD_SNIPPET_EXPLAIN