public inbox for netfilter@vger.kernel.org
 help / color / mirror / Atom feed
From: Adam Nielsen <a.nielsen@shikadi.net>
To: Alon Bar-Lev <alon.barlev@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Static bidirectional static NAT for duplicate IP devices using iptables
Date: Sun, 16 Feb 2025 12:40:22 +1000	[thread overview]
Message-ID: <20250216124022.127f90f3@gnosticus> (raw)
In-Reply-To: <CAOazyz3dGP+QJ_BOvXQ7gnQzTvOhGcxwA9y-RRJx=CjmMNmWhw@mail.gmail.com>

> Summary: I am trying to access two devices with the same IP address
> connected locally to a Linux computer, each resides in its own VLAN.
> 
> I made yet another progress, I use arptables to mangle the ARP request
> of the host side, but I am still missing ARP response to the device.

Isn't arptables the wrong approach here?  If you're using NAT then by
definition you're mapping IPs to the target subnet, so then there
should be no need to mess with ARP as the packets leaving the machine
are already on the right IP for the subnet?

I am by no means an expert but I would've thought that all you're
trying to do is to convert a 192.x address into the same target IP, and
just control which interface the packet goes out on based on whatever
the original IP address was.

Is ARP mangling needed at all for this?

Cheers,
Adam.

  reply	other threads:[~2025-02-16  3:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-14 23:57 Static bidirectional static NAT for duplicate IP devices using iptables Alon Bar-Lev
2025-02-15  4:09 ` Alon Bar-Lev
2025-02-15 19:05   ` Alon Bar-Lev
2025-02-16  2:40     ` Adam Nielsen [this message]
2025-02-16  9:28       ` Alon Bar-Lev
2025-02-16 10:12         ` Adam Nielsen
2025-02-16 10:20           ` Alon Bar-Lev
2025-02-16 10:40             ` Slavko
2025-02-16 11:17             ` Adam Nielsen

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=20250216124022.127f90f3@gnosticus \
    --to=a.nielsen@shikadi.net \
    --cc=alon.barlev@gmail.com \
    --cc=netfilter@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox