Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
I’m unsure if the rules for handling IPv6 traffic are configured correctly.
I’m trying to set up redirection for traffic coming through OpenVPN to be routed through Xray using the VLESS protocol. Specifically, I have the dokodemo-door inbound configured on port 20000 in Xray. My goal is to redirect traffic going to one server through OpenVPN, so that it gets forwarded to another server through Xray. I’m using iptables for this setup, but I’m encountering some issues.
Could someone suggest what I might have missed or how I can improve the configuration? Any advice on debugging would also be appreciated.
Here are my current iptables and ip6tables configurations:
iptables Configuration:
< code > iptables -I INPUT -p tcp --dport 38465 -j ACCEPT
iptables -I FORWARD -s 10.8 . 0 . 0 / 24 -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -s 10.8 . 0 . 0 / 24 -p tcp -j REDIRECT --to-port 20000
iptables -t nat -A POSTROUTING -s 10.8 . 0 . 0 / 24 -o ens3 -j MASQUERADE
<code>iptables -I INPUT -p tcp --dport 38465 -j ACCEPT
iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -s 10.8.0.0/24 -p tcp -j REDIRECT --to-port 20000
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ens3 -j MASQUERADE
</code>
iptables -I INPUT -p tcp --dport 38465 -j ACCEPT
iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -s 10.8.0.0/24 -p tcp -j REDIRECT --to-port 20000
iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o ens3 -j MASQUERADE
ip6tables Configuration:
< code > ip6tables -I FORWARD -s fddd: 1194 : 1194 : 1194 ::/ 64 -j ACCEPT
ip6tables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
ip6tables -t nat -A PREROUTING -s fddd: 1194 : 1194 : 1194 ::/ 64 -p tcp -j REDIRECT --to-port 20000
ip6tables -t nat -A POSTROUTING -s fddd: 1194 : 1194 : 1194 ::/ 64 -o ens3 -j MASQUERADE
<code>ip6tables -I FORWARD -s fddd:1194:1194:1194::/64 -j ACCEPT
ip6tables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
ip6tables -t nat -A PREROUTING -s fddd:1194:1194:1194::/64 -p tcp -j REDIRECT --to-port 20000
ip6tables -t nat -A POSTROUTING -s fddd:1194:1194:1194::/64 -o ens3 -j MASQUERADE
</code>
ip6tables -I FORWARD -s fddd:1194:1194:1194::/64 -j ACCEPT
ip6tables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
ip6tables -t nat -A PREROUTING -s fddd:1194:1194:1194::/64 -p tcp -j REDIRECT --to-port 20000
ip6tables -t nat -A POSTROUTING -s fddd:1194:1194:1194::/64 -o ens3 -j MASQUERADE