IPv6 Firewall Router: Unterschied zwischen den Versionen

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen
Zeile 45: Zeile 45:
 
ct state new iif "ens5" accept
 
ct state new iif "ens5" accept
 
ct state new iifname "lo" accept
 
ct state new iifname "lo" accept
ct state new icmp type echo-request accept
 
 
ip6 nexthdr ipv6-icmp accept
 
ip6 nexthdr ipv6-icmp accept
 
log prefix "--nftables-drop-input--"
 
log prefix "--nftables-drop-input--"
Zeile 54: Zeile 53:
 
ct state established,related accept
 
ct state established,related accept
 
ct state new iif "ens5" oif "ens4" accept
 
ct state new iif "ens5" oif "ens4" accept
ct state new iif "ens4" oif "ens5" ip6 daddr 2a02:24d8:71:2445::102 tcp dport 80 accept
 
 
log prefix "--nftables-drop-forward--"
 
log prefix "--nftables-drop-forward--"
 
}
 
}

Version vom 14. Januar 2024, 07:05 Uhr

Simple IPv4 Firwall

table ip filter {
	chain input {
		type filter hook input priority filter; policy drop;
		ct state established,related accept
		ct state new iif "ens4" tcp dport 22 accept
		ct state new iif "ens5" accept
		ct state new iifname "lo" accept
		log prefix "--nftables-drop-input--"
	}

	chain forward {
		type filter hook forward priority filter; policy drop;
		ct state established,related accept
		ct state new iif "ens5" oif "ens4" accept
		log prefix "--nftables-drop-forward--"
	}

	chain output {
		type filter hook output priority filter; policy drop;
		ct state established,related accept
		ct state new accept
		log prefix "--nftables-drop-output--"
	}
}
table ip nat {
	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oif "ens4" masquerade
	}
}

Simple Dual Stack Firewall

table inet filter {
	chain input {
		type filter hook input priority filter; policy drop;
		ct state established,related accept
		ct state new iif "ens4" tcp dport 22 accept
		ct state new iif "ens5" accept
		ct state new iifname "lo" accept
		ip6 nexthdr ipv6-icmp accept
		log prefix "--nftables-drop-input--"
	}

	chain forward {
		type filter hook forward priority filter; policy drop;
		ct state established,related accept
		ct state new iif "ens5" oif "ens4" accept
		log prefix "--nftables-drop-forward--"
	}

	chain output {
		type filter hook output priority filter; policy drop;
		ct state established,related accept
		ip6 nexthdr ipv6-icmp accept
		ct state new accept
		log prefix "--nftables-drop-output--"
	}
}
table ip nat {
	chain postrouting {
		type nat hook postrouting priority srcnat; policy accept;
		oif "ens4" masquerade
	}
}