Score:0

IPv6 DHCP PD reply going to FORWARD rule in iptables firewall?

th flag

On my Fedora 34 Linux firewall/router box I noticed

  • that IPV6 DHCP PD requests are sent out fine.
  • that IPV6 DHCP PD replies do arrive on the wire
  • that the firewall kernel for some reason sends the DHCP PD reply in the FORWARD rule even though dhclient is local
  • that addresses in the packets were correct, match with DHCP-server and local firewall.

Details can be found at redhat.

We have a ppp interface:

# ip -6 a s dev ppp0
20: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc cbq state UNKNOWN group default qlen 3
inet6 fe80::c5d5:e942:39c7:7eb7 peer    fe80::9ecc:83ff:fec6:e7e5/128 scope link 
   valid_lft forever preferred_lft forever

We have dhclient listening at ppp0:

# lsof -p 4066992 -n
COMMAND      PID USER   FD   TYPE             DEVICE SIZE/OFF     NODE NAME
dhclient 4066992 root  cwd    DIR              254,0     4096    40961 /root
dhclient 4066992 root  rtd    DIR              254,0     4096        2 /
dhclient 4066992 root  txt    REG              254,2  2018144   141553 /usr/sbin/dhclient
dhclient 4066992 root  mem    REG              254,2    53728    22104 /usr/lib64/libnss_files-2.33.so
dhclient 4066992 root  mem    REG              254,2  1913544    21939 /usr/lib64/libc-2.33.so
dhclient 4066992 root  mem    REG              254,2    32696    30196 /usr/lib64/libcap-ng.so.0.0.0
dhclient 4066992 root  mem    REG              254,2   842360    30776 /usr/lib64/ld-2.33.so
dhclient 4066992 root    0u   CHR              136,4      0t0        7 /dev/pts/4 (deleted)
dhclient 4066992 root    1u   CHR              136,4      0t0        7 /dev/pts/4 (deleted)
dhclient 4066992 root    2u   CHR              136,4      0t0        7 /dev/pts/4 (deleted)
dhclient 4066992 root    3u  unix 0x000000001f2593f7      0t0 16525445 type=DGRAM (UNCONNECTED)
dhclient 4066992 root    4w   REG              254,4       64      251 /var/lib/dhclient/dhclient6.leases
dhclient 4066992 root    5w  FIFO                0,8      0t0 16525446 pipe
dhclient 4066992 root    6u  IPv6           16524541      0t0      UDP [fe80::c5d5:e942:39c7:7eb7]:dhcpv6-client 

That appears to be all correct.

Then the packets that come in:

# tcpdump -i ppp0 -vn port 546
dropped privs to tcpdump
tcpdump: listening on ppp0, link-type LINUX_SLL (Linux cooked v1), snapshot length 262144 bytes
06:53:09.236781 IP6 (flowlabel 0x7f0d8, hlim 1, next-header UDP (17) payload length: 60) fe80::c5d5:e942:39c7:7eb7.dhcpv6-client > ff02::1:2.dhcpv6-server: [udp sum ok] dhcp6 solicit (xid=b68ba1 (client-ID hwaddr/time type 1 time 394565497 004063f60200) (option-request DNS-server DNS-search-list) (elapsed-time 65535) (IA_PD IAID:0 T1:3600 T2:5400))
06:53:09.469530 IP6 (class 0xc0, hlim 64, next-header UDP (17) payload length: 141) fe80::9ecc:83ff:fec6:e7e5.dhcpv6-server > fe80::c5d5:e942:39c7:7eb7.dhcpv6-client: [udp sum ok] dhcp6 advertise (xid=b68ba1 (client-ID hwaddr/time type 1 time 394565497 004063f60200) (server-ID vid 0000058339633a63) (IA_PD IAID:0 T1:3600 T2:5760 (IA_PD-prefix 2001:981:a812::/48 pltime:7200 vltime:7200)) (DNS-server 2001:888:0:6::66 2001:888:0:9::99))
06:53:09.469756 IP6 (class 0xc0, hlim 63, next-header UDP (17) payload length: 141) fe80::9ecc:83ff:fec6:e7e5.dhcpv6-server > fe80::c5d5:e942:39c7:7eb7.dhcpv6-client: [udp sum ok] dhcp6 advertise (xid=b68ba1 (client-ID hwaddr/time type 1 time 394565497 004063f60200) (server-ID vid 0000058339633a63) (IA_PD IAID:0 T1:3600 T2:5760 (IA_PD-prefix 2001:981:a812::/48 pltime:7200 vltime:7200)) (DNS-server 2001:888:0:6::66 2001:888:0:9::99))
^C

Appear to be addressed correctly, to the dhclient interface.

So why doesn't dhclient receive?

I did test without an active firewall: no change. I simplified routing, etc but no change.

It is not the problem from https://stackoverflow.com/questions/19702489/response-udp-packets-not-arriving-regardless-of-right-ip-and-port-after-sending as the dhcp-server can be contacted due to the routes present.

Where do I look to find out why a DHCP reply packet with a PD in it does not arrive locally?

Please post. Udo

Michael Hampton avatar
cz flag
Why do you say the reply is sent to a FORWARD rule?
udovdh avatar
th flag
An UDPv6_Dropped message is logged in the FORWARD rule unless I open up the FORWARD, but then the problem has already occurred.
Michael Hampton avatar
cz flag
I don't see your iptables rules? I don't see a packet capture? Where are all your details?
udovdh avatar
th flag
Some details can be found at [redhat](https://bugzilla.redhat.com/show_bug.cgi?id=1956209). As the issue also persists without firewall I did not post firewall details yet; it's an ADSL4Linux derivative.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.