I have an openWRT device with a WLAN and no WAN interface. However, one of the 4 clients clients of the WLAN is connected to the internet via it's own eth0
interface. I would like to set up openWRT to use the WLAN client as the gateway.
On the internet connected client(running ubuntu), I added simple masquerading with iptables rules as documented all over the internet, to forward all incoming wlan0
traffic out towards its own default gateway on eth0
.
On OpenWRT, I configured the internet-connected WLAN client to a static DHCP lease (via a host
entry in /etc/config/dhcp
, then tried to set the client's IP as default gateway using `ip r add default via $CLIENT_IP' , but this doesn't work, probably because of iptables rules.
What do I need to do to configure the routing and iptables to make OpenWRT redirect all traffic to the correct place? What am I doing wrong?
Confession: I have also asked the same question on the stackoverflow network, just with more background information which might or might not be relevant.