Randomly came across a post looking for a method to disable NAT on the ARM-based UniFi routers… and, as usual, nobody had suggested the easy way.
The hard ways are:
- Reconfigure Networks as VLAN-only, configure DHCP to hand out the address of your other router. Disadvantage: UniFi doesn’t see the routed traffic so lots of information that UniFi provides will no longer be available.
- Use a script to remove NAT rules. Disadvantage: Has to run at boot, and whenever the device re-provisions, and ultimately is fragile across firmware updates and Ubiquiti randomly changing things.
But there is another way that doesn’t require running scripts on the device, doesn’t require reconfiguring all the Networks, and keeps all the traffic flowing through the UniFi router.
Simply have the other router somewhere on the LAN side and create two static routes pointing to it:
- 0.0.0.0/1
- 128.0.0.0/1
And that’s it. Those routes “win” over the NAT-ed WAN 0.0.0.0/0 route because they’re more specific.