<div dir="ltr"><div>This is for recursive, and our recursive got 10X more queries than our authoritative ones, and we had to disable conntrack on our DNS servers last summer by using raw table and everything works for IPv4 including fragmentation, we just noticed fragment fails for IPv6 when using raw table, query not trigger fragment works fine, like this one:<br>dig @2001:500:60::30 <a href="http://isc.org" target="_blank">isc.org</a> <br><br></div><div>I've added the trace to the ip6table, and here is the pcap:<br>15:51:48.746691 IP6 (hlim 64, next-header UDP (17) payload length: 44) 2001:0468:2:183::20.45955 > 2001:500:60::30.53: [udp sum ok] 59884+ [1au] ANY? <a href="http://isc.org" target="_blank">isc.org</a>. ar: . OPT UDPsize=4096 OK (36)<br>15:51:48.846080 IP6 (hlim 52, next-header Fragment (44) payload length: 1240) 2001:500:60::30 > 2001:0468:2:183::20: frag (0xefa32c05:0|1232) 53 > 45955: 59884*- q: ANY? <a href="http://isc.org" target="_blank">isc.org</a>. 27/0/16 <a href="http://isc.org" target="_blank">isc.org</a>. RRSIG, <a href="http://isc.org" target="_blank">isc.org</a>. SPF, <a href="http://isc.org" target="_blank">isc.org</a>. RRSIG, <a href="http://isc.org" target="_blank">isc.org</a>. RRSIG, <a href="http://isc.org" target="_blank">isc.org</a>. DNSKEY, <a href="http://isc.org" target="_blank">isc.org</a>. DNSKEY, <a href="http://isc.org" target="_blank">isc.org</a>. RRSIG[|domain]<br>15:51:48.846101 IP6 (hlim 52, next-header Fragment (44) payload length: 1240) 2001:500:60::30 > 2001:0468:2:183::20: frag (0xefa32c05:1232|1232)<br>15:51:48.846122 IP6 (hlim 52, next-header Fragment (44) payload length: 1240) 2001:500:60::30 > 2001:0468:2:183::20: frag (0xefa32c05:2464|1232)<br>15:51:48.846126 IP6 (hlim 52, next-header Fragment (44) payload length: 318) 2001:500:60::30 > 2001:0468:2:183::20: frag (0xefa32c05:3696|310)<br><br></div><div>Here is the dmesg:<br>TRACE: raw:OUTPUT:rule:3 IN= OUT=eth0 SRC=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 DST=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 LEN=84 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=UDP SPT=38537 DPT=53 LEN=44 UID=0 GID=0<br>TRACE: raw:OUTPUT:policy:5 IN= OUT=eth0 SRC=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 DST=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 LEN=84 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=UDP SPT=38537 DPT=53 LEN=44 UID=0 GID=0<br>TRACE: filter:OUTPUT:policy:1 IN= OUT=eth0 SRC=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 DST=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 LEN=84 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=UDP SPT=38537 DPT=53 LEN=44 UID=0 GID=0<br>TRACE: raw:PREROUTING:policy:5 IN=eth0 OUT= MAC=00:50:56:a9:44:68:00:23:<wbr>9c:f5:67:f0:86:dd SRC=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 DST=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 LEN=1280 TC=0 HOPLIMIT=52 FLOWLBL=0 OPT ( FRAG:0 INCOMPLETE ID:90c4bbe8 ) PROTO=UDP SPT=53 DPT=38537 LEN=4006<br>TRACE: filter:INPUT:rule:1 IN=eth0 OUT= MAC=00:50:56:a9:44:68:00:23:<wbr>9c:f5:67:f0:86:dd SRC=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 DST=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 LEN=1280 TC=0 HOPLIMIT=52 FLOWLBL=0 OPT ( FRAG:0 INCOMPLETE ID:90c4bbe8 ) PROTO=UDP SPT=53 DPT=38537 LEN=4006<br>TRACE: raw:PREROUTING:policy:5 IN=eth0 OUT= MAC=00:50:56:a9:44:68:00:23:<wbr>9c:f5:67:f0:86:dd SRC=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 DST=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 LEN=1280 TC=0 HOPLIMIT=52 FLOWLBL=0 OPT ( FRAG:1232 INCOMPLETE ID:90c4bbe8 ) PROTO=UDP<br>TRACE: raw:PREROUTING:policy:5 IN=eth0 OUT= MAC=00:50:56:a9:44:68:00:23:<wbr>9c:f5:67:f0:86:dd SRC=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 DST=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 LEN=1280 TC=0 HOPLIMIT=52 FLOWLBL=0 OPT ( FRAG:2464 INCOMPLETE ID:90c4bbe8 ) PROTO=UDP<br>TRACE: raw:PREROUTING:policy:5 IN=eth0 OUT= MAC=00:50:56:a9:44:68:00:23:<wbr>9c:f5:67:f0:86:dd SRC=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 DST=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 LEN=358 TC=0 HOPLIMIT=52 FLOWLBL=0 OPT ( FRAG:3696 ID:90c4bbe8 ) PROTO=UDP<br>TRACE: raw:OUTPUT:rule:3 IN= OUT=eth0 SRC=2001:0468:0002:0183:0000:<wbr>0000:0000:0020 DST=2001:0500:0060:0000:0000:<wbr>0000:0000:0030 LEN=84 TC=0 HOPLIMIT=64 FLOWLBL=0 PROTO=UDP SPT=38537 DPT=53 LEN=44 UID=0 GID=0<br><br><br></div><div>Thanks!<br><br></div><div>Larry <br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 1, 2016 at 2:21 PM, /dev/rob0 <span dir="ltr"><<a href="mailto:rob0@gmx.co.uk" target="_blank">rob0@gmx.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Sep 30, 2016 at 11:55:18PM -0400, Larry Larson wrote:<br>
> I've followed instructions in this BIND Knowledge base article and<br>
> installed ip6tables on my DNS server, using raw table with no<br>
> conntrack for DNS:<br>
> <a href="https://kb.isc.org/article/AA-01183/0/Linux-connection-tracking-and-DNS.html" rel="noreferrer" target="_blank">https://kb.isc.org/article/AA-<wbr>01183/0/Linux-connection-<wbr>tracking-and-DNS.html</a><br>
<br>
</span>This is mostly for authoritative servers which must be open to<br>
queries from anywhere.  Perhaps this is not a real issue, as it<br>
sounds like you might be setting up a recursive server?  Of course,<br>
it CAN be a problem for recursive-only servers too; it just depends<br>
how many users and concurrent queries you need to support.  If your<br>
userbase can flood your conntrack table, you need this.<br>
<span class=""><br>
> But for IPv6 it drops fragmented packets, for example this query<br>
> fails once the ip6table is on:<br>
> dig +dnssec  <a href="http://isc.org" rel="noreferrer" target="_blank">isc.org</a> any  @2001:500:60::30<br>
<br>
</span>Can you show us how you found out that it was affecting fragments?<br>
Is this query falling back to TCP?  Do you have a pcap?<br>
<span class=""><br>
> Everything works great for IPv4 with similar rules, can someone<br>
> help shed some light on what might be wrong:<br>
><br>
> # Firewall configuration written by system-config-firewall<br>
<br>
</span>A minor issue, the NOTRACK target is deprecated by CT with the<br>
--notrack option. (That's not the problem, however.)<br>
<br>
We can test things with a few TRACE rules.  Let's add rules as<br>
follows:<br>
<span class=""><br>
> *raw<br>
> :PREROUTING ACCEPT [0:0]<br>
> :OUTPUT ACCEPT [0:0]<br>
</span>-A PREROUTING -s 2001:500:60::30 -j TRACE<br>
-A PREROUTING -d 2001:500:60::30 -j TRACE<br>
<span class="">> -A PREROUTING -p udp -m udp --dport 53 -j NOTRACK<br>
> -A PREROUTING -p udp -m udp --sport 53 -j NOTRACK<br>
</span>-A OUTPUT -s 2001:500:60::30 -j TRACE<br>
-A OUTPUT -d 2001:500:60::30 -j TRACE<br>
<span class="">> -A OUTPUT -p udp -m udp --dport 53 -j NOTRACK<br>
> -A OUTPUT -p udp -m udp --sport 53 -j NOTRACK<br>
> COMMIT<br>
> *filter<br>
> :INPUT ACCEPT [0:0]<br>
> :FORWARD ACCEPT [0:0]<br>
> :OUTPUT ACCEPT [0:0]<br>
> -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED,UNTRACKED -j ACCEPT<br>
> -A INPUT -p ipv6-icmp -j ACCEPT<br>
> -A INPUT -i lo -j ACCEPT<br>
> #tcp dns<br>
> -A INPUT -m conntrack --ctstate NEW -m tcp -p tcp --dport 53 -j ACCEPT<br>
> -A INPUT -m conntrack --ctstate NEW -m tcp -p tcp --sport 53 -j ACCEPT<br>
> -A INPUT -j REJECT --reject-with icmp6-adm-prohibited<br>
> -A FORWARD -j REJECT --reject-with icmp6-adm-prohibited<br>
> COMMIT<br>
<br>
</span>For TRACE rules to work the LOG module must be loaded.  A quick,<br>
temporary way to do that:<br>
   # ip6tables -A INPUT -i bogus -j LOG<br>
   # ip6tables -D INPUT -i bogus -j LOG<br>
(That adds and then removes a no-op rule using the LOG target.)<br>
<br>
Then repeat your test,<br>
<span class="">> dig +dnssec  <a href="http://isc.org" rel="noreferrer" target="_blank">isc.org</a> any  @2001:500:60::30<br>
</span>on this machine.<br>
<br>
Then show us "ip6tables-save -c" along with all the "TRACE" lines<br>
from dmesg.  A quick way which should work for that:<br>
   # dmesg | grep TRACE<br>
<br>
After the test, you might want to disable those TRACE rules, in case<br>
you had other business with 2001:500:60::30 -- they can get very<br>
noisy, very quickly.<br>
<br>
Coincidentally, I happen to be working on this very issue, with a<br>
different approach: shortened TTL for conntrack entries for UDP DNS.<br>
It came up on the Netfilter mailing list recently.  I'll be sure to<br>
post here when that (a documentation patch) is completed.<br>
<span class="HOEnZb"><font color="#888888">--<br>
  <a href="http://rob0.nodns4.us/" rel="noreferrer" target="_blank">http://rob0.nodns4.us/</a><br>
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:<br>
______________________________<wbr>_________________<br>
Please visit <a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a> to unsubscribe from this list<br>
<br>
bind-users mailing list<br>
<a href="mailto:bind-users@lists.isc.org">bind-users@lists.isc.org</a><br>
<a href="https://lists.isc.org/mailman/listinfo/bind-users" rel="noreferrer" target="_blank">https://lists.isc.org/mailman/<wbr>listinfo/bind-users</a><br>
</font></span></blockquote></div><br></div>