<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - nftables DNAT not working"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1051">1051</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>nftables DNAT not working
</td>
</tr>
<tr>
<th>Product</th>
<td>nftables
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>x86_64
</td>
</tr>
<tr>
<th>OS</th>
<td>Gentoo
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>critical
</td>
</tr>
<tr>
<th>Priority</th>
<td>P5
</td>
</tr>
<tr>
<th>Component</th>
<td>kernel
</td>
</tr>
<tr>
<th>Assignee</th>
<td>pablo@netfilter.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>andrey.aleksandrovich@googlemail.com
</td>
</tr></table>
<p>
<div>
<pre>Hi,
The issue is simple, `table nat` with prerouting hooks does not receive
appropriate traffic.
Here is config commands (1.2.3.4 is just a placeholder for the address actually
used here):
# nft add table inet filter
# nft add chain inet filter input { type filter hook input priority 0 \; policy
drop\; }
# nft add rule inet filter input ct state invalid counter drop
# nft add rule inet filter input ct state {established, related} counter accept
# nft add rule inet filter input tcp dport 8080 counter accept
# nft add chain inet filter forward { type filter hook forward priority 0 \;
policy accept\; }
# nft add rule inet filter forward counter
# nft add chain inet filter output { type filter hook output priority 0 \;
policy accept\; }
# nft add rule inet filter output counter
# nft add table nat
# nft add chain nat prerouting { type nat hook prerouting priority 0 \; }
# nft add rule nat prerouting ip daddr 1.2.3.4 tcp dport 80 counter dnat
1.2.3.4:8080
# nft add chain nat postrouting { type nat hook postrouting priority 0 \; }
But the traffic doesn't redirect to 8080 (there is 0 bytes/packets)
# nft list table nat -a -nn
table ip nat {
chain prerouting {
type nat hook prerouting priority 0; policy accept;
ip daddr 1.2.3.4 tcp dport 80 counter packets 0 bytes 0 dnat
1.2.3.4:8080 # handle 3
}
chain postrouting {
type nat hook postrouting priority 0; policy accept;
}
}
I've searched solution over the net, and find out that it affects not only me:
<a href="https://bugs.launchpad.net/ubuntu/+source/nftables/+bug/1503695">https://bugs.launchpad.net/ubuntu/+source/nftables/+bug/1503695</a>
<a href="http://www.spinics.net/lists/netfilter/msg56390.html">http://www.spinics.net/lists/netfilter/msg56390.html</a>
<a href="http://permalink.gmane.org/gmane.comp.security.firewalls.netfilter.general/48283">http://permalink.gmane.org/gmane.comp.security.firewalls.netfilter.general/48283</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>