How to share internet from one interface to another using VintageNet

Hello, I want to share internet from the wlan0 interface to wlan0 which is in Access Point mode or it could be to the eth0 interface.

Any ideas would be very helpful.

Share WAN with other networks

For sharing your WAN connection (e.g. internet access) with other networks iptables must be installed. Currently this means building a custom nerves system. Once this is done the following commands need to be called on each boot:

wan = "eth0" 
cmd "sysctl -w net.ipv4.ip_forward=1" 
cmd "iptables -t nat -A POSTROUTING -o #{wan} -j MASQUERADE" 
cmd "iptables --append FORWARD --in-interface wlan0 -j ACCEPT" 
# Only needed if the connection is blocked otherwise (like a default policy of DROP) 
cmd "iptables -A INPUT -i #{wan} -m state --state RELATED,ESTABLISHED -j ACCEPT"
1 Like

From reading a bit I wonder if the iptables calls are necessary or if the forwarding setting could be enough?

Not an area I know super well and maybe it won’t forward to WAN otherwise?