Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Masquerade of outbound IPVS traffic uses wrong source ip when loopback has an ip alias #667

Closed
lucasmundim opened this issue Feb 10, 2019 · 0 comments · Fixed by #668
Closed

Comments

@lucasmundim
Copy link
Contributor

If I add an ip alias on loopback interface IPVS outbound traffic masquerade uses that ip instead of nodeIP.

Example:

Given a container with host-network=true and dnsPolicy=ClusterFirstWithHostNet

From container (works)

$ getent hosts kubernetes.default.svc.cluster.local.
10.255.2.1        kubernetes.default.svc.cluster.local.  kubernetes.default.svc.cluster.local.

tcpdump

[Interface:tun-1022413915] 06:23:59.104003 IP 10.224.64.6.31403 > 10.244.2.125.53: 43707+ AAAA? kubernetes.default.svc.cluster.local. (54)
[Interface:tun-1022413915] 06:23:59.104841 IP 10.244.2.125.53 > 10.224.64.6.31403: 43707* 0/1/0 (147)
[Interface:tun-1022413915] 06:23:59.104983 IP 10.224.64.6.44205 > 10.244.2.124.53: 8538+ A? kubernetes.default.svc.cluster.local. (54)
[Interface:tun-1022413915] 06:23:59.105618 IP 10.244.2.124.53 > 10.224.64.6.44205: 8538* 1/0/0 A 10.255.2.1 (106)
[Interface:tun-1022413915] 06:23:59.105732 IP 10.224.64.6.52080 > 10.244.2.125.53: 53493+ A? kubernetes.default.svc.cluster.local. (54)
[Interface:tun-1022413915] 06:23:59.106206 IP 10.244.2.125.53 > 10.224.64.6.52080: 53493* 1/0/0 A 10.255.2.1 (106)

From host

$ ip addr add 192.168.124.81/32 dev lo label lo:2

From container (stops working)

$ getent hosts kubernetes.default.svc.cluster.local.
# no output = timeout

tcpdump

[Interface:tun-1022413915] 06:23:02.411767 IP 192.168.124.81.53081 > 10.244.2.124.53: 51862+ AAAA? kubernetes.default.svc.cluster.local. (54)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant