<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 SNAT is not working"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1255">1255</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>nftables SNAT is 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>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>belkin_a@hotmail.com
</td>
</tr></table>
<p>
<div>
<pre>Set-up:
1. Linux (tried on LEDE@arm, OpenWrt@arm, Ubuntu16@x86)
2. iptables disabled (kernel modules unloaded)
3. nftables (tried v. 0.8, 0.8.2)
4. chains and NAT are created according to official nftables wiki
<a href="https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT">https://wiki.nftables.org/wiki-nftables/index.php/Performing_Network_Address_Translation_(NAT</a>):
% nft add table nat
% nft add chain nat prerouting { type nat hook prerouting priority 0 \; }
% nft add chain nat postrouting { type nat hook postrouting priority 100 \; }
By this set-up, dnat functions as expected, e.g.:
% nft add rule nat prerouting tcp dport 15000 dnat 192.168.0.50:20000
redirects all incoming TCP packets from port 15000 to 192.168.0.50:20000 and
back.
However, no snat rule is processed (neither rule of):
% nft add rule nat postrouting counter ip saddr 192.168.0.50 snat 1.2.3.4
% nft add rule nat postrouting counter tcp sport 20000 snat 1.2.3.4:1234
% nft add rule nat postrouting counter ip protocol tcp drop
I've tried these rules separately or in variations (oif, ip+tcp, ...) - the
packets are still going through unchanged (proved by WireShark) or not dropped.
Though:
1. The postrouting chain is processed, since if I remove postrouting chain,
dnat (by prerouting) stops to work (as expected).
2. Adding a drop rule to input or output chains works.
Any ideas here?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>