Static NAT between two lan

Hello all,

I am trying to configure OpenWRT to interconnect two networks, using two different switches.

I have two computers (10.10.6.11 and 10.10.6.12) on a local machine network that I need to show on the local network with fixed IPs I want to NAT static (10.130.130.25 and 10.130.130.26)

I tried to find how I could do that but I am lost in the configuraion and the interfaces.

OpenWRT is running on a raspberry Pi 4, eth0 is the onboard RJ45 connected to the local network and eth1 is a USB to RJ45 adapter connected to the machine network

If someone could explain me the way to go, it would be nice.

Are you sure you do need to configure a NAT and not just proper routes to reach one subnet from the other?

4 Likes

Hello bernd,

Yes I need a NAT, as SW2 is also communicating with a third network, and this third network should see 10.10.6.11 as a 10.130.130.x device

It'll probably be a lot simpler for people to assist if you explain the full setup, rather than a small snippet.

1 Like

It woubld be best to avoid NAT and create a static route on the gateway of your third network to the 10.10.6.0/24 subnet via the IP of OpenWrt in the 10.130.130.0/24 subnet.

Otherwise, enable masquerading on the firewall zone assigned for the 10.130.130.0/24 subnet on OpenWrt.