Debian Bullseye natting klappt nicht

Alle weiteren Dienste, die nicht in die drei oberen Foren gehören.
Antworten
jamesDebNovice
Beiträge: 1
Registriert: 10.09.2023 07:32:47

Debian Bullseye natting klappt nicht

Beitrag von jamesDebNovice » 10.09.2023 07:59:48

Moin liebe DebFreunde,

ich bräuchte einen Rat wie ich das Traffic Forwarding in Bullseye aktivieren kann.

Ich hatte vorher einen ubuntu 18.x bei ionos gehabt, wo ich einen strongswan server betrieben hatte.
Diese ubuntu Version wird nun leider nicht mehr supportet, sodass ich mir einen neuen Server gemietet habe mit debian bullseye drauf.
Die Konfigurationen hatte ich soweit übertragen. Lediglich die IP und das Serverzertifikat hatte ich ausgetauscht.
Durchgestartet hatte ich die Dienste immer mit ipsec restart.

Auf dem neuen Server klappt die Verbindung auch wie erwartet, ich konnte mittels iptables den ssh port 22 im 10. Netz setzen, sodass er von außen nicht mehr erreichbar ist und nur vpn user auf 22 connecten können.
Alles gut.

Nur das Traffic Forwarding klappt nicht mehr. Andere Endpunkte, außer den Server, erreiche ich nicht mehr. Und ich hab keine Ahnung warum das so ist.

Ich hatte erst gedacht, dass der Provider das irgendwie blockiert. Aber selbst in virtualbox bekomme ich das natting nicht mehr hin.
Der Server hatte damals immer nur eine Netzwerkkarte.

Vielleicht könnte ihr mir hier weiterhelfen.

Server
4 GB Ram
20GB HDD
1x Netzwerkkarte
OS Debian Bullseye

iptable Befehle von früher

Code: Alles auswählen

iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -F
iptables -Z
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p tcp -s 10.10.10.0/24 --dport 22 -j ACCEPT
iptables -A OUTPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp --sport 22 -m conntrack --ctstate ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp --dport  500 -j ACCEPT
iptables -A INPUT -p udp --dport 4500 -j ACCEPT
iptables -A FORWARD --match policy --pol ipsec --dir in  --proto esp -s 10.10.10.0/24 -j ACCEPT
iptables -A FORWARD --match policy --pol ipsec --dir out --proto esp -d 10.10.10.0/24 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -m policy --dir out --pol ipsec -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.10.10.0/24 -o eth0 -j MASQUERADE
iptables -t nat -I POSTROUTING -m policy --pol ipsec --dir out -j ACCEPT
iptables -t mangle -A FORWARD --match policy --pol ipsec --dir in -s 10.10.10.0/24 -o eth0 -p tcp -m tcp --tcp-flags SYN,RST SYN -m tcpmss --mss 1361:1536 -j TCPMSS --set-mss 1360
iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP

sysctl.conf

Code: Alles auswählen

echo "net.ipv4.ip_forward = 1" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.accept_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.all.send_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.rp_filter = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.accept_source_route = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.conf.default.send_redirects = 0" |  tee -a /etc/sysctl.conf
echo "net.ipv4.icmp_ignore_bogus_error_responses = 1" |  tee -a /etc/sysctl.conf
sysctl -p
Beste Grüße

Antworten