Ok, sorry for the delay, but have now been able to turn my attention to this finally! It worked, sort of. I needed a bit of tweaking, and I have some follow-on items that I am not sure are possible, but I will ask anyway. Here is a summary of my findings:
1- I created the following setup:
module->has IP 192.168.20.5 on the 192.168.20.0/24 net via wifi interface mlan0
ethernet-> manually assigned IP 192.168.21.10, and has interface eth0
2- I ran the following steps according to your answer above:
On the module->
$ iptables -A FORWARD -i mlan0 -j ACCEPT
$ iptables -A FORWARD -i eth0 -j ACCEPT
$ iptables -t nat -A POSTROUTING -o mlan0 -j MASQUERADE
$ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
$ sysctl -w net.ipv4.ip_forward=1
3- I manually assigned an IP of 192.168.21.20 to my ethernet-connected device, with a default gateway of 192.168.21.10 (module’s eth0 IP), and then connected it to the module’s ethernet port
4- On a separate device connected to the wifi network, I found that if I added the default route in the way you suggested, I lost any other routing for normal network operations (i.e., if I wanted to search Google for something, the new default route “overrode” the normal default route?) In any case, I deleted your default route and added the following route instead:
$ sudo ip route add to 192.168.21.0/24 via 192.168.20.5
Doing the above, and I am successfully able to ping the ethernet connected device at 192.168.21.20 from another wifi device on the 192.168.20.0/24 net. However, a few things I noticed:
5- On the ethernet connected device, I can only ping to the 192.168.20.0/24 net. I cannot reach anywhere outside that net, say to the larger Internet, etc. This is true whether or not I assign a route or not, whether or not I have the DNS servers configured properly or not, etc. Clearly I’m missing something there…
6- Is there a way to automate all this in a way that I don’t have to manually assign a route or IP on the wifi side of things for each subnet on each module? I’d like to get to the point where I can just “plug and play”…
7- How about if I don’t want to subnet off the ethernet port? Perhaps I want it so that when I connected my ethernet device, it becomes part of the same network that the wifi devices are on?