Replies: 1 comment
-
|
this is my current configuration iptables -t mangle -N XRAY_SELF |
Beta Was this translation helpful? Give feedback.
-
|
this is my current configuration iptables -t mangle -N XRAY_SELF |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, I have a local xray proxy (tproxy) running with inbound port 12345, and I set up iptables for proxying. Recently I had a requirement to build a k3s cluster. Since k3s uses CoreDNS as the default DNS, after finishing the setup I found that Pods could not use my host machine’s proxy.
When I checked using
kubectl logs -n kube-system -l k8s-app=kube-dns, I saw that the upstream DNS was pointing to my wireless router (192.168.124.1:53). So I redirected back to 192.168.124.1:53, and then inside the Pod I rannslookup www.baidu.com. It returned both IPv6 and IPv4. On the host machine, runningnslookup www.baidu.comalso returned IPv4 and IPv6, but the only difference was the order — inside the Pod, IPv6 came first.Next, I used an
ubuntu:22.04Pod:Inside the container, I ran
apt update, but it kept hanging at:Then it failed with:
However, if I add the iptables rule:
and restart the service, I find that inside the Pod I cannot ping
www.google.com, but I can pingwww.baidu.com. Also, inside theubuntu:22.04Pod,apt updateworks fine without errors.If I use:
I can fetch the webpage data. I know that in this case traffic from
cni0does not go through the xray proxy.But my requirement is: all Pod traffic, including DNS, must go through xray.
How should I set this up correctly in order to achieve my requirement?
Beta Was this translation helpful? Give feedback.
All reactions