<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - STATELESS, rules with notrack into a map"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1410#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_ASSIGNED "
title="ASSIGNED - STATELESS, rules with notrack into a map"
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1410">bug 1410</a>
from <span class="vcard"><a class="email" href="mailto:e.lohmann@mdex.de" title="e.lohmann@mdex.de">e.lohmann@mdex.de</a>
</span></b>
<pre>Hi Pablo,
both rules are accepted by nft, and I think it will do the job.
nft add rule raw PREROUTING ip daddr set ip daddr map { 1.1.1.1 : 2.2.2.2,
1.1.1.2 : 2.2.2.3 } notrack
nft add rule raw PREROUTING ip saddr set ip saddr map { 2.2.2.2 : 1.1.1.1,
2.2.2.3 : 1.1.1.2 } notrack
table ip raw {
chain PREROUTING {
type filter hook prerouting priority -300; policy accept;
ip daddr set ip daddr map { 1.1.1.1 : 2.2.2.2, 1.1.1.2 : 2.2.2.3 }
notrack
ip saddr set ip saddr map { 2.2.2.2 : 1.1.1.1, 2.2.2.3 : 1.1.1.2 }
notrack
}
}
<span class="quote">> nft add rule raw PREROUTING ip daddr set ip saddr . ip daddr map { 1.1.1.1 . 2.2.2.2 : 3.3.3.3, 1.1.1.2 . 2.2.2.1 : 4.4.4.4 } notrack</span >
Nice possibility to do a rewrite on saddr and daddr inside a map!
The stateless snat example in mangle POSTROUTING is also a good idea, thank you
for that!
Yes please put this into the Wiki, it will help, to understand what is possible
with nft.
Is it also possible to add a network or range into a map and do a saddr/daddr
rewrite? Like it was possible with netmap in iptables?
Regards, Eike</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>