Masquarade in a CGNAT network

I am trying to replicate the settings in new install of OpenWrt, a friend lent me his router which works in client mode (which is what I am trying to achieve).

I thought I had replicated all settings within Luci but my router does not seem to work, I have scanned for a wifi, set client mode, locked the Mac address, then added a master wifi and mirrored the settings in my friends router.

I am doing it from scratch so that I learn more about OpenWRT, I would like to think I know a bit about networking but I am struggling with OpenWRT terminology.

I noticed this difference between the routers in the Firewall setting and wondered how it can be set from the Luci GUI?

config rule
option name 'masquarade'
option src 'wan'
option masq '1'

How can I add this to my router without just editing?

I have tried the tickbox in Zones under Firewall, it is ticked for wan and I have tried to de-select, save and re-select.then save.

Thanks for your help.

That's an incorrect rule, as the masq option is invalid inside the rule section, so you can safely ignore it.

1 Like


Out of interest, what would be the correct syntax

1 Like

The masq option can be used inside a zone section.

It has this earlier

config zone
option name 'wan'
option input 'REJECT'
option output 'ACCEPT'
option masq '1'
option mtu_fix '1'
option network 'wan6 VPN wwan'
option forward 'ACCEPT'

1 Like

The routed wifi client use case is not far from a default configuration. Avoid going far from the default configuration without a reason.

Starting from a default configuration, set up a wifi client and either attach it to the existing wan network instead of the ethernet port, or create a new network e.g. 'wwan' and place this network in the wan firewall zone.

The network the wifi client is on almost always should be of protocol DHCP client (unless the upstream network does not use DHCP) and it cannot be a bridge.

The IP you get from the upstream network can't be inside your lan subnet (by default 192.168.1.X). If there is a conflict you need to change the LAN IP to let routing work.

1 Like