New user, drinking from firehose: OpenWrt 18.06.2 r7676-cddd7b4c77 on Netgear WNDR3700, no wlan IP address

Hi, there, new user of OpenWRT, please be gentle...

My configuration is very basic, and 98% of it went well. Well, if I believe the GUI, it all went well, except, that none of my WiFi devices can join the network.

  • My android phone fails at at status "Obtaining IP address".
  • In the system log, I see "DHCP packet received on wlan0 which has no address"
  • ssh-ing to the router, sure enough, wlan0 and wlan1 have no IPv4 address.

Using Google, I saw a number of people having this or similar problems, but no solution that I could grok.

  • This is a single router. I'm not setting up ansible or the like until I can do it first with GUI and/or shell commands.
  • There is no guest VLAN. One disaster at a time. :slight_smile:
  • The firewall rules are default; I have not modified the iptables.

What obvious thing am I missing?

Thanks much in advance,

Eric

First off, it would help to know where you've started and where you've gone from there. A default configuration of current OpenWrt should result in a pretty much "ready to go" setup with:

  • WAN interface accepting DHCP
  • Two, unencrypted APs, disabled, both bridged to the LAN
  • The LAN at 192.168.1.1, providing DHCP in 192.168.1.0/24
  • SSH access available at 192.168.1.1
  • LuCI access available at http://192.168.1.1/
  • NAT for LAN clients to the Internet (or whatever is upstream of your LAN)

Editing /etc/config/wireless to comment out the "disabled" line on the two radios and running wifi, or doing the equivalent through LuCI should have brought your box up in a functional way.

Which version of OpenWrt did you flash?

What changes from default did you make?

The two wlan interfaces are slave interfaces to the br-lan interface. It is that bridge that gets the IP address, not the wlan interfaces. What you're seeing there is expected, assuming that you've got an address on the bridge. A box on my bench reports the following:

root@OpenWrt:~# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
7: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    inet 192.168.1.1/24 brd 192.168.1.255 scope global br-lan
       valid_lft forever preferred_lft forever

Jeff, here's where I am:

  • LAN is 192.168.20.254, DHCP is 192.168.20.0/24
  • OpenWRT version in subject line, OpenWrt 18.06.2 r7676-cddd7b4c77
  • SSH access is available, I did set my public key in.
  • LuCI at 192.168.20.254
  • NAT for LAN clients to ISP
  • Two fixed entries for resolving DNS, 8.8.8.8 and 8.8.4.4
  • ESSID for radio0 is xxxx, for radio1 is xxxx2, same password, WPA2-PSK.
  • radio0 is in legacy mode, channel 11, defaults. It clearly is handshaking past the security. (Radio1 can be ignored since I'm not even attempting to talk to it.)

My box reports as follows:

 root@speedbump:~# ip -4 addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
   inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 192.168.20.254/24 brd 192.168.20.255 scope global br-lan
      valid_lft forever preferred_lft forever
8: br-wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
    inet 208.69.213.177/25 brd 208.69.213.255 scope global br-wan
       valid_lft forever preferred_lft forever
root@speedbump:~#

Other than what I think is a typo with "268", that all looks reasonable (meaning should be functional, as there are some tweaks you might take on relative to wireless performance in the future).

What does cat /etc/config/dhcp show? (The preformatted-text button is helpful, </>)

Is there a symink in /etc/rc.d/ for S19dnsmasq -> ../init.d/dnsmasq or the equivalent?

Does ps w show dnsmasq running?

Does your /etc/config/wireless have option network 'lan' in each of the wifi-iface stanzas?
(As an example, from a first-boot system)

config wifi-iface 'default_radio1'
	option device 'radio1'
	option network 'lan'
	option mode 'ap'
	option ssid 'OpenWrt'
	option encryption 'none'

r

oot@speedbump:~# cat /etc/config/dhcp

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

config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'
	option dhcpv6 'server'
	option ra 'server'
	option ra_management '1'

config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
	option loglevel '4'

root@speedbump:~#

dnsmasq is running; init symlink for dnsmasq is there.

/etc/config/qireless has lan, wan, wan6 in it.

And 268 was a typo. I fixed it but not in time for your reply.

Is it possible that you are using the same SSID and key that you were using on another router and had them stored on your phone?

If so, try a different SSID.

Nope, unplugged the other router with that same SSID. It's sitting on the floor next to me.

To amplify, this router replaces the unplugged one. All wired connections are working fine.

Yes, but I have seen before what you are seeing, particularly with phones. Try a new SSID on the new router.

Is it only the phone, or laptop too?

Same behavior with new SSID, passphrase.

Laptop and phone are both failing to connect -- both are attempting. The android phone was closest to grab for the "user friendly" error message.
Same behavior with radio1

http://lists.thekelleys.org.uk/pipermail/dnsmasq-discuss/2016q3/010810.html provides a little insight

Applied to your case, it seems like dnsmasq receives DHCP requests on
eth0.3 which does not have an IP and netmask, and therefore rightly
complain about that.

So, for some reason it might be that dnsmasq is listening to wlan0 and hasn't been configured to ignore it.

For comparison, here's bringing up an AP, seeing it come up and being enslaved by the br-lan bridge, then an iPhone associating and getting both an IPv6 and IPv4 address.

Also, do any other wireless devices have problems with DHCP? I have vague memories of posts about Android devices having problems with IPv6, but I don't remember any of the details. (I see now that you have other devices with DHCP problems)

Apr 21 02:46:00 OpenWrt hostapd: Using interface wlan1 with hwaddr 30:23:03:dd:ee:ff and ssid "OpenWrt"
Apr 21 02:46:00 OpenWrt kernel: [ 2536.180629] ath10k_ahb a000000.wifi: NOTE:  Firmware DBGLOG output disabled in debug_mask: 0x10000000
Apr 21 02:46:00 OpenWrt kernel: [ 2536.189669] IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready
Apr 21 02:46:00 OpenWrt kernel: [ 2536.189957] br-lan: port 2(wlan1) entered blocking state
Apr 21 02:46:00 OpenWrt kernel: [ 2536.195462] br-lan: port 2(wlan1) entered forwarding state
Apr 21 02:46:00 OpenWrt hostapd: wlan1: interface state UNINITIALIZED->ENABLED
Apr 21 02:46:00 OpenWrt hostapd: wlan1: AP-ENABLED 
Apr 21 02:46:10 OpenWrt hostapd: wlan1: interface state ENABLED->DISABLED
Apr 21 02:46:10 OpenWrt hostapd: wlan1: AP-DISABLED 
Apr 21 02:46:10 OpenWrt hostapd: wlan1: CTRL-EVENT-TERMINATING 
Apr 21 02:46:10 OpenWrt hostapd: nl80211: deinit ifname=wlan1 disabled_11b_rates=0
Apr 21 02:46:11 OpenWrt mac80211: Failed command: iw phy phy1 set distance 0
Apr 21 02:46:11 OpenWrt hostapd: Configuration file: /var/run/hostapd-phy1.conf
Apr 21 02:46:13 OpenWrt hostapd: Using interface wlan1 with hwaddr 30:23:03:67:e9:58 and ssid "OpenWrt"
Apr 21 02:46:13 OpenWrt hostapd: wlan1: interface state UNINITIALIZED->ENABLED
Apr 21 02:46:13 OpenWrt hostapd: wlan1: AP-ENABLED 
Apr 21 02:46:27 OpenWrt hostapd: wlan1: STA 9c:8b:a0:aa:bb:cc IEEE 802.11: authenticated
Apr 21 02:46:27 OpenWrt hostapd: wlan1: STA 9c:8b:a0:aa:bb:cc IEEE 802.11: associated (aid 1)
Apr 21 02:46:27 OpenWrt hostapd: wlan1: AP-STA-CONNECTED 9c:8b:a0:aa:bb:cc
Apr 21 02:46:27 OpenWrt hostapd: wlan1: STA 9c:8b:a0:aa:bb:cc RADIUS: starting accounting session 40B5F205CB5128CA
Apr 21 02:46:28 OpenWrt odhcpd[1067]: DHCPV6 SOLICIT IA_NA from 0001000124186f829c8ba0aabbcc on lan: ok fde9:3dbc:7bf7::24b/128 
Apr 21 02:46:29 OpenWrt odhcpd[1067]: DHCPV6 REQUEST IA_NA from 0001000124186f829c8ba0aabbcc on lan: ok fde9:3dbc:7bf7::24b/128 
Apr 21 02:46:31 OpenWrt dnsmasq-dhcp[1605]: DHCPDISCOVER(br-lan) 9c:8b:a0:aa:bb:cc 
Apr 21 02:46:31 OpenWrt dnsmasq-dhcp[1605]: DHCPOFFER(br-lan) 192.168.1.216 9c:8b:a0:aa:bb:cc 
Apr 21 02:46:31 OpenWrt dnsmasq[1605]: read /etc/hosts - 4 addresses
Apr 21 02:46:31 OpenWrt dnsmasq[1605]: read /tmp/hosts/odhcpd - 0 addresses
Apr 21 02:46:31 OpenWrt dnsmasq[1605]: read /tmp/hosts/dhcp.cfg01411c - 2 addresses
Apr 21 02:46:31 OpenWrt dnsmasq-dhcp[1605]: read /etc/ethers - 0 addresses
Apr 21 02:46:31 OpenWrt dnsmasq-dhcp[1605]: DHCPDISCOVER(br-lan) 9c:8b:a0:aa:bb:cc 
Apr 21 02:46:31 OpenWrt dnsmasq-dhcp[1605]: DHCPOFFER(br-lan) 192.168.1.216 9c:8b:a0:aa:bb:cc 
Apr 21 02:46:33 OpenWrt dnsmasq-dhcp[1605]: DHCPREQUEST(br-lan) 192.168.1.216 9c:8b:a0:aa:bb:cc 
Apr 21 02:46:33 OpenWrt dnsmasq-dhcp[1605]: DHCPACK(br-lan) 192.168.1.216 9c:8b:a0:aa:bb:cc jeffs-iPhone

I disabled IPv6 on the WAN at the ISP's request.
I can do same for the WLANs.... if I figure out how. Remember, I'm new at this.

It was more that the device could get "confused", but DHCPV6 is handed by odhcpd, not dnsmasq, from what I understand.

You may be new at this, but you seem to know your way around `nix systems reasonably well. tcpdump-mini will give you most of the functionality you need to watch the packets. (I haven't figured out what it is missing, having never run into a limitation in my own use.)

I can be installed through LuCI, or with

opkg update
opkg install tcpdump-mini

Ugh, examining raw TCP. I may have to feed it through Wireshark on my desktop machine to make my life easier.

I'm wondering if I'm not better off resetting to factory defaults and retracing my steps.

LOL, "New user" -- OK, I'll give you that for OpenWrt at least. Yes, might be worth starting fresh and going step by step.

If you do decide to continue, or need to in the future, this you'll probably find self-explanatory :wink:

ssh root@openwrt tcpdump -i <inteface> -w - | wireshark -k -i -
2 Likes

Thanks for the vote of confidence :smile: It's appreciated.

I don't suppose that there's a software option for a factory reset, or do I have to poke a pin in a hole and wait?

Yes, the command is perfectly understandable to me, but then, here I am tangled in this morass.

Several ways:

  • From a running system, firstboot will erase the overlay (then reboot)
  • Pressing "the button" (edit: I'm not sure which one is "standard" for this) for 5 or ten seconds (as I recall) on a running system will do a reset/reboot
  • Getting into "failsafe" mode by pressing "the button" (once) during the two seconds when the boot light (typically the same as power/status) starts flashing, will shortly indicate failsafe mode by (typically) that same light flashing even faster. The device is reachable at 192.168.1.1:22, ssh, root, no password (though the host key will change). From there you can run firstboot as well.

Might want to save your config somewhere off the router for reference. sysupgrade can be used for that, or through LuCI.

root@OpenWrt:~# sysupgrade 
Usage: /sbin/sysupgrade [<upgrade-option>...] <image file or URL>
       /sbin/sysupgrade [-q] [-i] [-c] [-u] [-o] [-k] <backup-command> <file>

upgrade-option:
	-f <config>  restore configuration from .tar.gz (file or url)
	-i           interactive mode
	-c           attempt to preserve all changed files in /etc/
	-o           attempt to preserve all changed files in /, except those
	             from packages but including changed confs.
	-u           skip from backup files that are equal to those in /rom
	-n           do not save configuration over reflash
	-p           do not attempt to restore the partition table after flash.
	-k           include in backup a list of current installed packages at
	             /etc/backup/installed_packages.txt
	-T | --test
	             Verify image and config .tar.gz but do not actually flash.
	-F | --force
	             Flash image even if image checks fail, this is dangerous!
	-q           less verbose
	-v           more verbose
	-h | --help  display this help

backup-command:
	-b | --create-backup <file>
	             create .tar.gz of files specified in sysupgrade.conf
	             then exit. Does not flash an image. If file is '-',
	             i.e. stdout, verbosity is set to 0 (i.e. quiet).
	-r | --restore-backup <file>
	             restore a .tar.gz created with sysupgrade -b
	             then exit. Does not flash an image. If file is '-',
	             the archive is read from stdin.
	-l | --list-backup
	             list the files that would be backed up when calling
	             sysupgrade -b. Does not create a backup file.

1 Like

Powering down, holding the reset switch in with a pin, and powering up again, left me with the same settings.

Off to do "firstboot". eyeroll

No, the config is simple, and the goal is to start fresh and see if I can do it again without upsetting the phone, etc.

EDIT, since it won't let me put another post in:

Okay, I surrender.

It's up, running, just fine.

Things I did not do:

  • Didn't change its IPV4 address
  • Didn't turn off IPV6 for the WAN. The ISP can just deal.

seems like applying interface settings in latest luci releases screws this up.