All of lore.kernel.org
 help / color / mirror / Atom feed
* How to NAT when using iwd ap mode?
@ 2021-05-25 17:21 KeithG
  2021-05-26 23:34 ` Denis Kenzior
  0 siblings, 1 reply; 5+ messages in thread
From: KeithG @ 2021-05-25 17:21 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

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?

Keith

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-05-28  1:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 17:21 How to NAT when using iwd ap mode? KeithG
2021-05-26 23:34 ` Denis Kenzior
2021-05-27 13:14   ` KeithG
2021-05-27 15:34     ` Denis Kenzior
2021-05-28  1:04       ` KeithG

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.