I understand it might be a very unusual question:
I've setup openwrt as a standalone router (since raspberry's wifi is really weak) like this:
- WAN and LAN ports merged together
- openwrt default gateway: external modem
- clients use Wifi provided by external modem
- openwrt set as default gw
- openwrt running wireguard VPN client
The purpose of this setup is to use wifi antenna of external modem (which itself provides internet connection), but pass internet traffic through wireguard tunnel (with added network shares, upnp, etc)
To this point, everything works smoothly:
Clients (Lan Subnet) -> External Modem (as AP) (Lan Subnet) -> OpenWRT (Lan Subnet) -> Wireguard -> External Modem (as Router) (Lan Subnet) -> Internet
The problem occurs when I disable wireguard client, which leads openwrt to use the external modem (which is naturally on the same subnet as clients) as second priority gw. Since everything is on the same subnet, it seems like openwrt doesn't forward the traffic to the modem, leading the internet connection of clients to be disconnected.
Clients (Lan Subnet) -> External Modem (as AP) (Lan Subnet) -> OpenWRT (Lan Subnet) -> External Modem (as Router) (Lan Subnet) -> Internet
So the question: Is there any way I can configure openwrt to NAT the traffic from clients to external modem?