I enabled ip-forwarding between my interfaces wlan0 and eth0 :

  • in /etc/sysctl.conf
  • sh "echo 1 > proc/etc..."
  • 3 iptables rules.

IpTables rules:

sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT 
sudo iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT


  • wlan0 is joinable by clients
  • eth0 is connected to the Internet

Tools & config:

  • hostapd
  • dhcpd (with option domain-name-servers;,;
  • iptables

That done, when a client joins wlan0, s/he cannot browse the WWW Error, not connected to Internet. But he can ping sites (ping google.fr, ping 75.XX.XX.XX) with success.

I removed Network Manager (cause of conflicts with hostapd, at boot). Is Network Manager needed to make it work ?

  • Check if a wireless client receives a DNS configuration from dhcpd correctly. If you don't run a DNS server, you should run it or push some public DNS servers to the client, i.e. google ones. option domain-name-servers; – Tim Sep 3 '15 at 10:59
  • @Tim Thank you. Checked: In dhcpd, i exactly use option domain-name-servers;. I confirm DNS is solving well, cause in case of redirecting all (instead of ip forwarding all), only solved domain-name are redirected, unsolved ones display error. – ArchiT3K Sep 3 '15 at 11:11
  • Check the MTU values on both interfaces. It is likely the culprit. You can verify by increasing the ping packet size at some point likely around 2KB you won't be able to ping from a wireless client - this is a typical manifestation of the MTU mismatch. – galaxy Sep 3 '15 at 12:57
  • @galaxy Thanks. ifconfig=>eth0 MTU:1500 ; wlan0 MTU:1500 . What should I do ? ( lo MTU:65536) – ArchiT3K Sep 3 '15 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.