On Wed, May 26, 2021 at 6:34 PM Denis Kenzior wrote: > > Hi Keith, > > On 5/25/21 12:21 PM, KeithG wrote: > > I have been trying to get ap mode to NAT and am unsuccessful. Is this possible? > > > > I can get AP mode to work with this in /etc/iwd/main.conf > > > > and I can get an IP address associated and I can connect to the > > computer running iwd in ap mode. What I cannot do is NAT the wifi > > connected device to the eth0 which has a valid connection. > > > > [General] > > UseDefaultInterface=true > > EnableNetworkConfiguration=true > > APRanges=192.168.5.0/24 > > > > After I get my AP running and connect, I tried to run these commands > > to enable NAT: > > > > # sysctl net.ipv4.ip_forward=1 > > # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE > > # iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT > > # iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT > > > > When I try this, I get no 'internet' traffic from eth0. > > > > Is this due to dns? Do I need to use iptables to NAT this? > > > > When I run connman in tether mode it works. I can connect and I get > > internet traffic over wlan connected devices. When I have iwd running > > in AP mode, though, I cannot figure out how to share the eth0 > > connection to the wifi connected device(s). > > > > Is there a guide on how to use the ap.iwd provisioning file? I am not > > clear on how to use it. I created a file: /etc/iwd/ap.iwd and it does > > not seem to use it. Where do you set the hostname? > > > > There isn't, so I came up with a very simple tutorial. Feel free to improve it, > add on to it, etc. > > https://iwd.wiki.kernel.org/ap_mode > > Regards, > -Denis Denis, Thanks, google did not help me find that page. It works for me. The only thing I would ask is: why do we have to set the 'APRanges=' in /etc/iwd/main.conf? Can this be set in ssid.ap? This is the only setting that I have found that needs to be set in main.conf for ap mode to work. Keith