Hallo,
ich habe eine Verbindung zwischen zwei Servern (einer hier der VPS) via wireguard. Ich möchte Traffic der bei dem VPS hier ankommt zu dem anderen Server routen. Das ganze klappt auch großartig für IPv4, nur nicht für IPv6.
Das hier benutze ich um den Traffic zu forwarden:
Code
sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1
# routing Prep
nft add table nat
nft 'add chain nat postrouting { type nat hook postrouting priority 100 ; }'
nft 'add chain nat prerouting { type nat hook prerouting priority -100; }'
nft add table ip6 nat
nft 'add chain ip6 nat postrouting { type nat hook postrouting priority 100 ; }'
nft 'add chain ip6 nat prerouting { type nat hook prerouting priority -100 ; }'
# Port forwarding for IPv4
nft 'add rule nat prerouting ip daddr 1.2.3.4 tcp dport { 80 } dnat 1.2.3.9'
nft 'add rule nat prerouting ip daddr 1.2.3.4 tcp dport { 443 } dnat 1.2.3.9'
nft 'add rule ip6 nat prerouting ip6 daddr 1:2:3:4:c86a:75ff:fe6d:46a6 tcp dport 80 dnat 1:2:3:4:5:6:7:9'
nft 'add rule ip6 nat prerouting ip6 daddr 1:2:3:4:c86a:75ff:fe6d:46a6 tcp dport 443 dnat 1:2:3:4:5:6:7:9'
# Packet masquerading
nft add rule nat postrouting masquerade
Alles anzeigen
Und das hier ist die Ausgabe von ip address:
Code
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether ca:6a:75:6d:46:a5 brd ff:ff:ff:ff:ff:ff
altname enp0s3
altname ens3
inet 1.2.3.4/22 brd 1.2.3.255 scope global eth0
valid_lft forever preferred_lft forever
inet6 1:2:3:4::c86a:75ff:fe6d:46a6/64 scope global
valid_lft forever preferred_lft forever
inet6 1:2:3:4:c86a:75ff:fe6d:46a5/64 scope global
valid_lft forever preferred_lft forever
inet6 fe80::c86a:75ff:fe6d:46a5/64 scope link
valid_lft forever preferred_lft forever
Alles anzeigen
Ich kann alle IPs (also auch die iPv6) von außen pingen, das ist absolut kein Problem, nur der Traffic kommt nicht an.Entsprechend frage ich mich ob ich da irgendwas übersehen habe was vlt. netcup speziell ist oder ob ich sonnst einen Fehler in meiner Config habe.
Danke schon mal
Autchi