WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: AP Hostapd.conf  (Read 3022 times)

Offline irineucaldeira89

  • Newbie
  • *
  • Posts: 1
AP Hostapd.conf
« on: June 03, 2019, 03:54:38 PM »
Hi
My name is Irineu.
I live in Brazil.
I wish I could share the Wifi from the notebook with my cell phone.

I edited the hostapd.conf file ...

Then the SSID appears, and I connect to it, but the client, in this case my cell phone, tries to get an IP address ... and does not connect.

Offline bela.d

  • Newbie
  • *
  • Posts: 8
Re: AP Hostapd.conf
« Reply #1 on: July 18, 2019, 06:49:37 AM »
Do you have a DHCP server listening on the wireless interface?

Offline GNUser

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 1530
Re: AP Hostapd.conf
« Reply #2 on: July 18, 2019, 03:59:21 PM »
Hello, Irineu. bela is right. For your notebook to function as a wireless access point, you need hostapd plus a dhcp server. There are different dhcp servers you could choose, I happen to like dnsmasq. If you want to try dnsmasq, after installing the dnsmasq extension ($ tce-load -wi dnsmasq) you can use my script below. Just make sure to change the two variables as appropriate for you, then run the script as root.

Code: [Select]
#!/bin/sh

# user variables
lan_if=wlan0
ip_stem=192.168.10

# set lan_if ip address
ifconfig $lan_if $ip_stem.1

# create dnsmasq.conf
echo "listen-address=$ip_stem.1
dhcp-range=$ip_stem.100,$ip_stem.200,255.255.255.0,24h
dhcp-option-force=option:router,$ip_stem.1
dhcp-option-force=option:dns-server,$ip_stem.1
dhcp-option-force=option:mtu,1500" >/tmp/dnsmasq.conf

# start dnsmasq
dnsmasq -C /tmp/dnsmasq.conf

« Last Edit: July 18, 2019, 04:00:54 PM by GNUser »

Offline bonbob

  • Jr. Member
  • **
  • Posts: 99
Re: AP Hostapd.conf
« Reply #3 on: July 21, 2019, 01:10:12 PM »
There is no need to install DHCP-server. udhcpd   already present in distro. Also you have to add some iptables rules to share internet. Enable network forwarding and NAT for IPv4. For IPv6 you need to start some route advertisement server. For example RAdvd