Hi *,
so I started to dig deeper, and noticed that SUSE Cloud, being built on OpenStack, uses Linux network namespaces - so my earlier approach was plain wrong. But as it still doesn’t work, here’s the current state of affairs:
- still using linuxbridge
- fixed addresses network is 192.168.123.0, mapped to VLAN 115 on the (real) Ethernet
- the instance can reach 192.168.123.1 perfectly
I’ve traced the traffic flow for our instance’s access to the metadata service, here’s what I found:
- instance wants to send a request for 169.254.169.254:80
- instance sends ARP for 169.254.169.254
- instance receives ARP response with MAC2 ("[FONT=monospace][COLOR=#000000]arp reply 169.254.169.254 is-at fa:16:3e:13:89:6b")[/COLOR]
[/FONT] - instance sends IP packet for 169.254.169.254 to MAC2
That’s where it currently ends.
The situation on the control node is:
- the control node has multiple network name spaces
- one of these netns hosts the vnif with the IP 192.168.123.1, which has MAC1 (not MAC2 as seen in the ARP reply), has the “metadata proxy” service listening on port 9697 (on any interface) and has an iptables rule to map 169.254.169.254:80 to port 9798
[FONT=monospace][COLOR=#000000]root@control[/COLOR][/FONT][COLOR=#000000] # ip netns exec qrouter-e938ca30-295c-405a-8790-94253ad288c2 iptables -t nat -L -vn [/COLOR]
[FONT=monospace][...]
Chain neutron-l3-agent-PREROUTING (1 references)
pkts bytes target prot opt in out source destination
0 0 REDIRECT tcp -- * * 0.0.0.0/0 169.254.169.254 tcp dpt:80 redir ports 9697
[...]
[FONT=monospace]root@control[/FONT][COLOR=#000000] # [/COLOR][/FONT][COLOR=#000000]ip netns exec qrouter-e938ca30-295c-405a-8790-94253ad288c2 ip addr list [/COLOR]
[FONT=monospace]18: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
21: qr-3850d83f-6c: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:7f:d1:51 brd ff:ff:ff:ff:ff:ff
inet 192.168.123.1/24 brd 192.168.123.255 scope global qr-3850d83f-6c
inet6 fe80::f816:3eff:fe7f:d151/64 scope link
valid_lft forever preferred_lft forever
25: qg-8c43ded2-75: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:37:a7:9b brd ff:ff:ff:ff:ff:ff
inet 192.168.126.129/24 brd 192.168.126.255 scope global qg-8c43ded2-75
inet 192.168.126.138/32 brd 192.168.126.138 scope global qg-8c43ded2-75
inet 192.168.126.145/32 brd 192.168.126.145 scope global qg-8c43ded2-75
inet 192.168.126.146/32 brd 192.168.126.146 scope global qg-8c43ded2-75
inet 192.168.126.147/32 brd 192.168.126.147 scope global qg-8c43ded2-75
inet6 fe80::f816:3eff:fe37:a79b/64 scope link
valid_lft forever preferred_lft forever
[/FONT]
[FONT=monospace] [FONT=monospace]root@control[/FONT][COLOR=#000000] # ip netns exec qrouter-e938ca30-295c-405a-8790-94253ad288c2 lsof -i4 -P |grep 9697 [/COLOR]
neutron-n 12435 root 8u IPv4 36404 0t0 TCP *:9697 (LISTEN)
[FONT=monospace]root@control[/FONT][COLOR=#000000] #[/COLOR][/FONT]
- one of these netns hosts a vnif with the MAC address 192.168.123.2 and 169.254.169.254, with MAC2, but has only the dnsmasq service listening (and no iptable rules for any remapping)
[CODE]
[FONT=monospace][COLOR=#000000][FONT=monospace]root@control [/FONT]# [/COLOR][/FONT][COLOR=#000000]ip netns exec qdhcp-e423e6c2-54e1-4e41-99bb-231427cc7c8f ip addr list [/COLOR]
[FONT=monospace]7: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
9: ns-4ee87c22-5a: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:13:89:6b brd ff:ff:ff:ff:ff:ff
inet 192.168.123.2/24 brd 192.168.123.255 scope global ns-4ee87c22-5a
inet 169.254.169.254/16 brd 169.254.255.255 scope global ns-4ee87c22-5a
inet6 fe80::f816:3eff:fe13:896b/64 scope link
valid_lft forever preferred_lft forever
[/FONT]
[FONT=monospace] [FONT=monospace]root@control [/FONT][COLOR=#000000]# ip netns exec qdhcp-e423e6c2-54e1-4e41-99bb-231427cc7c8f lsof -i4 -P -n [/COLOR]
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnsmasq 8575 dnsmasq 3u IPv4 19146 0t0 UDP *:67
dnsmasq 8575 dnsmasq 5u IPv4 19149 0t0 UDP 169.254.169.254:53
dnsmasq 8575 dnsmasq 6u IPv4 19150 0t0 TCP 169.254.169.254:53 (LISTEN)
dnsmasq 8575 dnsmasq 7u IPv4 19151 0t0 UDP 192.168.123.2:53
dnsmasq 8575 dnsmasq 8u IPv4 19152 0t0 TCP 192.168.123.2:53 (LISTEN)
[FONT=monospace]root@control [/FONT][COLOR=#000000]# ps ax|grep 8575 [/COLOR]
2680 pts/2 S+ 0:00 grep 8575
8575 ? S 0:00 dnsmasq --no-hosts --no-resolv --strict-order --bind-interfaces --interface=ns-4ee87c22-5a --except-interface=lo --pid-file=/var/lib/neutron/dhcp/e423e6c2-54e1-4e41-99bb-231427cc7c8f/pid --dhcp-hostsfile=/var/lib/neutron/dhcp/e423e6c2-54e1-4e41
-99bb-231427cc7c8f/host --addn-hosts=/var/lib/neutron/dhcp/e423e6c2-54e1-4e41-99bb-231427cc7c8f/addn_hosts --dhcp-optsfile=/var/lib/neutron/dhcp/e423e6c2-54e1-4e41-99bb-231427cc7c8f/opts --leasefile-ro --dhcp-range=set:tag0,192.168.123.0,static,86400s --dhcp-lease-max=25
6 --conf-file= --server=192.168.103.4 --domain=openstack.local
[FONT=monospace]root@control [/FONT][COLOR=#000000]# ip netns exec qdhcp-e423e6c2-54e1-4e41-99bb-231427cc7c8f iptables -t nat -L -vn [/COLOR]
Chain PREROUTING (policy ACCEPT 176 packets, 23776 bytes)
pkts bytes target prot opt in out source destination
Chain INPUT (policy ACCEPT 176 packets, 23776 bytes)
pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 154 packets, 46727 bytes)
pkts bytes target prot opt in out source destination
Chain POSTROUTING (policy ACCEPT 154 packets, 46727 bytes)
pkts bytes target prot opt in out source destination
[FONT=monospace]root@control [/FONT][COLOR=#000000]#
[/COLOR][/FONT][/CODE][FONT=monospace][COLOR=#000000]
So it’s clear why the instance’s requests don’t reach the metadata proxy: They’re sent do a different netns.
Now the question is either why are there these two distinct netns for these two services (dnsmasq and metadata proxy, router), or why is the metadata proxy listening in that other namespace, which doesn’t have the 169.254.169.254 address active?
Is it a configuration error on our behalf, or might this be a product issue?
Regards,
Jens[/COLOR]
[/FONT]