Source of traffic forwarded from router to another device

I have a router running openWrt configured as a dumb AP. I want to add another device between the router and WAN which should see traffic per client connected to the router and not from the router itself.

(192.168.2.0/24 & 192.168.3.0/24) router <-------> device1 <--------> WAN
                                192.168.1.2      192.168.1.1

device1 will forward traffic from router to WAN and it should see incoming traffic source as client1(192.168.2.1) or client2(192.168.3.1) and not as all traffic coming from router(192.168.1.2).

device1 can be another device running openWrt. I'm wondering if this is possible and I'm not really sure how to configure it this way.

1 Like
  • Create a static route to 192.168.2.0/23 via 192.168.1.2 on the device.
  • Disable masquerading on the WAN firewall zone on the router.
1 Like

I added the static route on device1

network.@route[0]=route
network.@route[0].interface='lan'
network.@route[0].netmask='255.255.255.0'
network.@route[0].gateway='192.168.1.2'
network.@route[0].target='192.168.2.0/24'

On the router I disabled masquerading by removing below config on WAN zone.

firewall.@zone[1].masq='1'

Then I tried pinging a client(192.168.2.4) from device1. I didn't get a response. Am I missing something?

Remove that.

No, it should be /23.

This also requires to enable the WAN to LAN zone forwarding on the router.

Accessing clients behind the router from the device is a separate task.

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.