OpenWrt Forum Cannot configure WLAN AP connection as LAN, not Internet connection

Hi guys,

Again similar question as in Cannot configure WLAN Client connection as WWAN, but here I have stuck with providing Internet Connection through WLAN AP ...

From my board ping 8.8.8.8 works properly, but ping google.com does not (ping: bad address 'google.com') !! Very strange ... :frowning:
I have default firewall settings ...

Here is my /etc/config/network:

root@Lima:/# cat /etc/config/network 

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'auto'

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0 eth1'
	option proto 'static'
	option ipaddr '192.168.3.2'
	option netmask '255.255.255.0'
	option gateway '192.168.3.1'
	option ip6assign '60'

config interface 'wan'
	option ifname 'eth0'
	option proto 'dhcp'

config interface 'wan6'
	option ifname 'eth0'
	option proto 'dhcpv6'

Here is my /etc/config/wireless:

root@Lima:/# cat /etc/config/wireless 

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/qca953x_wmac'
	option htmode 'HT20'
	option disabled '0'
	option txpower '22'
	option country 'US'

config wifi-iface
	option device 'radio0'
	option mode 'ap'
	option ssid 'OpenWRT'
	option encryption 'psk2'
	option key '********'
	option network 'lan'

Previously I some how have configured Internet Access through WLAN AP, but now by some reason previous settings does not work ...

Any suggestion guys ? I will appreciate any help ...

Same problem previously encountered. Some routers just doesnt allow DNS forwarding. Workaround....

uci set dhcp.dnsmasq.server=8.8.8.8
uci commit dhcp
/etc/init.d/dnsmasq restart

... or simply add 8.8.8.8 in LUCI, DHCP and DNS, DNS forwarding and hit save and apply

I guess you're trying to run as a LAN device now, also known as a "dumb AP". It appears there is a main router at 192.168.3.1 connected by Ethernet.

The dumb AP simply converts packets from wired to wireless at layer 2. A very important setting is to go into /etc/config/dhcp and turn off the DHCP server that is on LAN by default. You can't have two DHCP servers on the same network giving conflicting information.

Users of the wifi AP will get their DHCP and DNS from the main router. If you need the OpenWrt OS itself to have access to the Internet, both a gateway and DNS options must be specified in the lan stanza of /etc/config/network. Usually setting dns to the main router will work.

Take eth0 out of the wan if you're using it for lan. In a dumb AP there is only one network-- lan-- and you can delete wan entirely.

1 Like

Hi @mk24,

But previously I did not touch any other settings and successfully shared Internet over WLAN ...
Seems like it is again some firewall issues ... ;(

I guess you're trying to run as a LAN device now, also known as a "dumb AP". It appears there is a main router at 192.168.3.1 connected by Ethernet.

Yes I have configured the main router to have the IP Address 192.168.3.1

The dumb AP simply converts packets from wired to wireless at layer 2. A very important setting is to go into /etc/config/dhcp and turn off the DHCP server that is on LAN by default. You can't have two DHCP servers on the same network giving conflicting information.

I've done it, but it did not help ... (

Users of the wifi AP will get their DHCP and DNS from the main router. If you need the OpenWrt OS itself to have access to the Internet, both a gateway and DNS options must be specified in the lan stanza of /etc/config/network. Usually setting dns to the main router will work.

How you suggest to add dns server in /etc/config/network ?

Take eth0 out of the wan if you're using it for lan. In a dumb AP there is only one network-- lan-- and you can delete wan entirely.

Why should I delete this eth0 from wan ? I actually connect my board to my laptop and share Internet connection through Ethernet cable to my board and from my board to my phone to verify network configuration ...

Also @mk24, seems like it is a DNS issue because I have opened terminal utility in my phone connected using my WLAN AP and it pings 8.8.8.8 successfully !!

Seems like right now I have messed up with DNS somehow on my board ... (

I have fixed issue with firewall settings /etc/config/firewall:

...

config zone
	option name 'wan'
	list network 'wan'
	list network 'wan6'
	option masq '1'
	option mtu_fix '1'
	option output 'ACCEPT'
	option input 'ACCEPT'
	option forward 'ACCEPT'

...

And DNS settings in /etc/config/network:

...

config interface 'lan'
	option type 'bridge'
	option ifname 'eth0 eth1'
	option proto 'static'
	option ipaddr '192.168.3.2'
	option netmask '255.255.255.0'
	option gateway '192.168.3.1'
	option dns "192.168.3.1"

...

Now from my board I can ping 8.8.8.8 and ping google.com

Then I have added in /etc/config/dhcp list server '192.168.3.1':

...

config dnsmasq
	option domainneeded '1'
	option boguspriv '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'
	option nonwildcard '0'
	list server '192.168.3.1'

...

Now connection through my router board woks, I can connect to it using my phone and browse internet, but unfortunately speed is to slow :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.