From: Florian Westphal <fw@strlen.de>
To: G H <uothrawn@yahoo.com>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Rewrite arp response with nft
Date: Sat, 20 Apr 2024 19:31:18 +0200 [thread overview]
Message-ID: <20240420173118.GA21662@breakpoint.cc> (raw)
In-Reply-To: <48471547.724608.1713545266678@mail.yahoo.com>
G H <uothrawn@yahoo.com> wrote:
> On early versions of Linux, I could use ebtables to rewrite the ARP packet using the below command. This ensures that the switch would only see MAC address 00:50:56:96:12:5e, not aa:18:f0:55:79:1e.
>
> ebtables -t nat -I POSTROUTING --logical-out br0 --src aa:18:f0:55:79:1e \
> -j snat --to-src 00:50:56:96:12:5e --snat-arp --snat-target ACCEPT
>
> I can get close to recreating this with nftables, but it is missing the functionality provided by the --snat-arp argument.
>
> table bridge filter {
> chain POSTROUTING {
> type filter hook postrouting priority 0; policy accept;
> ether saddr aa:18:f0:55:79:1e ether saddr set 00:50:56:96:12:5e
> }
> }
>
> My outgoing ARP packet has its source MAC address rewritten successfully, but the "is-at" still points to the original MAC address. How do I alter the outbound ARP response to set "is-at" to point to 00:50:56:96:12:5e?
No idea, but you might want to look at the "arp" payload expression.
Maybe:
arp operation reply arp daddr ether set ...
prev parent reply other threads:[~2024-04-20 17:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <48471547.724608.1713545266678.ref@mail.yahoo.com>
2024-04-19 16:47 ` Rewrite arp response with nft G H
2024-04-20 17:31 ` Florian Westphal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240420173118.GA21662@breakpoint.cc \
--to=fw@strlen.de \
--cc=netfilter@vger.kernel.org \
--cc=uothrawn@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.