public inbox for netfilter@vger.kernel.org
 help / color / mirror / Atom feed
* Static bidirectional static NAT for duplicate IP devices using iptables
@ 2025-02-14 23:57 Alon Bar-Lev
  2025-02-15  4:09 ` Alon Bar-Lev
  0 siblings, 1 reply; 9+ messages in thread
From: Alon Bar-Lev @ 2025-02-14 23:57 UTC (permalink / raw)
  To: netfilter

Hello,

I am sure this was addressed before, I tried to find relevant
information but could not. I appreciate any assistance.

Constraints

* Two devices with the same IP, this cannot be changed.
* Devices do not have a default router, they must communicate with
applications on the same IP network.
* Host applications should access the two devices using UDP and TCP
based protocols.

Network Solution

* To avoid address conflict, each device resides on a different VLAN.

APPLICATION -->
Kernel -->
* v10@eth0 - interface on VLAN=10
* v11@eth0 - interface on VLAN=11

Switch -->
* Port1 VLAN=10
  * DEVICE1 [10.0.0.10]
* Port2 VLAN=11
  * DEVICE2 [10.0.0.10]

Diagram [In fixed width font]:
---
,-----------+--------.       ,----------+-+--------.
|           |v10@eth0|.......|          |1|VLAN=10 |---DEVICE1 [10.0.0.10]
|APPLICATION|    eth0|-------|   Switch +-+--------+
|           |v11@eth0|.......|          |2|VLAN=11 |---DEVICE2 [10.0.0.10]
`-----------+--------'       `----------+-+--------'
---

I would like to have a bidirectional static NAT so that per
application point of view:
* DEVICE1 will be 192.168.110.10
* DEVICE2 will be 192.168.111.10
And per device point of view:
* APPLICATION will be 10.0.0.11

I thought of having v10@eth0 address 192.168.110.1 and v11@eth0
address 192.168.111.0, however, I am unsure how to set up the
bidirectional translation to the device virtual address using SNAT
without creating duplicate addresses.

Any assistance will be appreciated.

Regards,
Alon Bar-Lev

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-16 11:17 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox