Firewall Regeln für IPv6

For topics beyond KeyHelp. / Für Themen jenseits von KeyHelp.
Post Reply
trollolol
Posts: 144
Joined: Wed 18. Sep 2019, 10:18
Location: Eisenach

Firewall Regeln für IPv6

Post by trollolol »

Servus zusammen,

eine Frage an die Firewall-Experten unter Euch:

Ich habe mir ein kleines Script gebastelt, wo ich Firewall Regeln laden kann. Auf dem Server läuft kein KeyHelp, sondern ist ein nackter Server mit einem Testsystem. Dieses Script ist nur für IPv4. IPv6 hätte ich auch gern mit drin, nur da bin ich mir nicht ganz sicher wie ich diese eintragen soll.

Code: Select all

#!/bin/bash
# Firewall Regeln 

iptables -F
iptables -X

iptables -N DENY
iptables -A DENY -p tcp -m tcp -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with tcp-reset
iptables -A DENY -m limit --limit 30/sec --limit-burst 100 -m comment --comment "Anti-DoS" -j REJECT --reject-with icmp-proto-unreachable
iptables -A DENY -m comment --comment "Alles andere ignorieren" -j DROP

iptables -N SERVICES
iptables -A SERVICES -p tcp -m tcp --dport 53 -m comment --comment "Erlaube: DNS" -j ACCEPT
iptables -A SERVICES -p udp -m udp --dport 53 -m comment --comment "Erlaube: DNS" -j ACCEPT
iptables -A SERVICES -p tcp -m tcp --dport 443 -m comment --comment "Erlaube: Web-HTTPS" -j ACCEPT
iptables -A SERVICES -p udp -m udp --dport 21 -m comment --comment "Erlaube: FTP-Zugriff" -j ACCEPT
iptables -A SERVICES -p tcp -m tcp --dport 22 -m comment --comment "Erlaube: SSH-Zugriff" -j ACCEPT
iptables -A SERVICES -j RETURN

iptables -A INPUT -i lo -m comment --comment "Erlaube: Loopback" -j ACCEPT
iptables -A INPUT -m state --state RELATED,ESTABLISHED -m comment --comment "Erlaube: Related und Established Verbindungen" -j ACCEPT
iptables -A INPUT -m comment --comment "Erlaube Standard Dienste" -j SERVICES
iptables -A INPUT -p icmp -m comment --comment "Erlaube: ICMP" -j ACCEPT
iptables -A INPUT -m comment --comment "Ignoriere alles andere" -j DENY
iptables -P INPUT DROP
Insbesondere würde mich interessieren, ob ich die gleichen Einstellungen nehmen kann (also z.B.

Code: Select all

ip6tables -A INPUT -i lo -m comment --comment "Erlaube: Loopback" -j ACCEPT
und ob ich die darunter einfügen sollte, oder ob ich die in SERVICES mit eintragen muss.


Ich danke schon jetzt für Eure Hilfe :)
trollolol
Posts: 144
Joined: Wed 18. Sep 2019, 10:18
Location: Eisenach

Re: Firewall Regeln für IPv6

Post by trollolol »

Hallo zusammen

Ich habe vor ein paar Tagen meinen 2ten Server auf Debian 10 umgestellt. Auf diesem Server läuft NICHT Keyhelp sondern mein Teamspeak - Server. Oben genanntes Script läuft einwandfrei (zumindest bis jetzt noch keine Probleme gehabt)

Nun würde ich gern auf NFTABLES wechseln. Meine Frage an Euch: Hat schon ein mal jemand dieses

Code: Select all

iptables-restore-translate
"getestet"?

Kann ich die Übersetzung ohne Probleme übernehmen, oder sind noch händisch Anpassungen vorzunehmen? Ich möchte es nicht unbedingt am Produktivsystem testen :)

Vielen Dank für Eure antworten :) und ein schönes Wochenende
Post Reply