ich bastel gerade an einer Machbarkeitsstudie bzw. einem Blog-Beitrag zu folgendem Konstrukt:
vServer mit Public IPv4-Adresse als OpenVPN-Server - Tunnel - pfSense als OpenVPN-Client - LAN
Auf dem vServer läuft Debian 10 Buster.
Die VPN-Verbindung läuft soweit und das Routing scheint i.O. zu sein, da sich die Gegenstellen anpingen können.
Ein Anliegen ist nun, wie man mit nftables ein Port-Forwarding vom vServer beispielsweise zu einem Webserver im LAN realisieren kann.
Ich habe schon einiges recherchiert und probiert, leider ohne Erfolg. Mir fehlt es da schlicht auch an Erfahrung mit Linux-Firewalls (hab' meistens mit pfSense und Securepoint UTM zu tun).
Anbei die aktuelle nftables.conf, die im wesentlichen von hier stammt: https://superuser.com/questions/985800/ ... ux/1480121
Code: Alles auswählen
#!/usr/bin/nft -f
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
# allow established/related connections
ct state {established, related} accept
# early drop of invalid connections
ct state invalid drop
# allow from loopback
iifname lo accept
# Allow from internal network
iifname lan0 accept
# allow icmp
ip protocol icmp accept
# allow ssh
tcp dport 22 accept comment "SSH in"
# allow OpenVPN
udp dport 1194 accept
reject
}
chain forward {
type filter hook forward priority 0;
# Allow outgoing via eth0
oifname eth0 accept
# Allow incoming on eth0 for related & established connections
iifname eth0 ct state related, established accept
# Drop any other incoming traffic on eth0
iifname eth0 drop
}
chain output {
type filter hook output priority 0;
}
}
table ip nat {
chain prerouting {
type nat hook prerouting priority 0;
# Forward traffic from eth0 to a LAN server
iifname eth0 tcp dport 80 dnat 192.168.1.2 comment "Port forwarding to web server"
}
chain postrouting {
type nat hook postrouting priority 0;
# Masquerade outgoing traffic
oifname eth0 masquerade
}
}
Vielen Dank im Voraus.
Gruß
Andy