Connecting to WiFi - ping works but no connection

I have installed OpenWRT on my TP-LINK TALON AD7200 router. I want to install bash on OpenWRT by the internet. Therefore, I need an internet connection.
So I think I did all the configurations in /etc/config/wireless and /etc/config/network files correctly. I also can ping the router that my router connects to access the internet. But when I run opkg update it gives me all errors of download fails.
I am using wlan0 in radio0 to be connected to EGR WiFi which does not have any encryption. The wlan0 LED keeps blinking when I boot up the router as well.
The result of iw wlan0 link shows:

root@T118fec:/etc/config# iw wlan0 link
Connected to X:X:X:X:X:X (on wlan0)
	SSID: EGR Wi-Fi
	freq: 5200
	RX: 19961067 bytes (184780 packets)
	TX: 53990 bytes (369 packets)
	signal: -46 dBm
	tx bitrate: 6.0 MBit/s

	bss flags:	short-slot-time
	dtim period:	1
	beacon int:	100

As can be seen the tx bitrate: 6.0 MBit/s is quite low.

Here are the contents of the wireless file:

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '36'
	option hwmode '11a'
	option path 'soc/1b500000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
	option htmode 'VHT80'

config wifi-iface 'default_radio0'
	option device 'radio0'
	option encryption 'none'
	option mode 'sta'
	option network 'wan'
	option ifname 'wlan0'
	option ssid 'EGR Wi-Fi'

config wifi-device 'radio1'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
	option htmode 'HT20'
	option disabled '0'

config wifi-iface 'default_radio1'
	option device 'radio1'
	option ssid 'ACOTalon'
	option encryption 'psk2'
	option key 'TalonACO'
	option mode 'ap'
	option network 'wlan1'
	option ifname 'wlan1'

config wifi-device 'radio2'
	option type 'mac80211'
	option path 'soc/1b900000.pci/pci0002:00/0002:00:00.0/0002:01:00.0'
	option freq '60480'
	option disabled '0'

config wifi-iface 'default_radio2'
	option device 'radio2'
	option encryption 'none'
	option mode 'ap'
	option network 'wlan2'
	option ifname 'wlan2'
	option ssid 'Mobicom1'

Here is the network file:

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 'fd2e:6b69:fced::/48'

config interface 'lan'
	option ifname 'eth1'
	option proto 'static'
	option netmask '255.255.255.0'
	option ip6assign '60'
	option ipaddr '192.168.4.2'

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

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

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '2 3 4 5 6'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '1 0'

config interface 'wlan0'
	option ifname 'wlan0'
	option proto 'dhcp'

config interface 'wlan1'
	option ifname 'wlan1'
	option proto 'dhcp'

config interface 'wlan2'
	option ifname 'wlan2'
	option proto 'static'
	option ipaddr '192.168.100.2'
	option netmask '255.255.255.0'

What can be the problem?

I'm not saying that this is why it's not working, or if there is something else, but you have a duplicate interface for wlan0

Also I don't think you need ifname for config wifi-iface in /etc/config/wireless

Does the OpenWrt router get IP as expected? Are you able to ping form the router an outside IP (e.g. 8.8.8.8 or 1.1.1.1)

I must remind you that this is very risky. In addition to the obviously security concerns of opening your network wide open for intruders, anyone can access internet from your connection and do illegal activities.

traceroute example.org
traceroute6 example.org
  • Which of those commands fail?
  • What does the error message say?
1 Like

Which OpenWrt image exactly did you flash?

here are the results:

root@T118fec:~# traceroute openwrt.org
traceroute to openwrt.org (35.9.37.103), 30 hops max, 38 byte packets
 1  35.12.218.1 (35.12.218.1)  14.811 ms  24.799 ms  22.194 ms
 2  *  *  *
 3  *  *  *
 4  *  *  *
 5  *  *  *

The second command:

root@T118fec:~# traceroute 139.59.209.225
traceroute to 139.59.209.225 (139.59.209.225), 30 hops max, 38 byte packets
 1  35.12.218.1 (35.12.218.1)  22.091 ms  17.464 ms  17.456 ms
 2  *  *  *
 3  *  *  *
 4  *  *  *
 5  *  *  *

The third one:

root@T118fec:~# traceroute6 openwrt.org
traceroute6: bad address 'openwrt.org'

The fourth:

root@T118fec:~# traceroute6 2a03:b0c0:3:d0::1af1:1
traceroute6: can't connect to remote host: Permission denied

These are the errrors I get when I do opkg update:

root@T118fec:~# opkg update
Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/targets/ipq806x/generic/packages/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/targets/ipq806x/generic/packages/Packages.gz

Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/base/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/base/Packages.gz

Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.gz

Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.gz

Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.gz

Downloading http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/telephony/Packages.gz
*** Failed to download the package list from http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/telephony/Packages.gz

Collected errors:
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/targets/ipq806x/generic/packages/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/base/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/luci/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/packages/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/routing/Packages.gz, wget returned 8.
 * opkg_download: Failed to download http://downloads.lede-project.org/releases/17.01-SNAPSHOT/packages/arm_cortex-a15_neon-vfpv4/telephony/Packages.gz, wget returned 8.

It is 17.01-SNAPSHOT

No I can't ping either 1.1.1.1 nor 8.8.8.8

I guess you may need to sepcify default gateway for your LAN interface

IPv4 traceroute doesn't fail immediately, so there's some default gateway.
DNS also works.

It's either some kind of routing collision, or IP/MAC-filtering.

ip a; ip r
1 Like

I missed that!!

1 Like

Is this a public wifi network that requires logging in to a captive portal? In that case you need to connect some device with a web browser to the lan side of your router and log in. That will actually log in the router MAC, so then all devices in your network including the router itself will have access.

TX bit rate will always show 6 Mb on ath10k. The actual bit rate over the air will be correctly set almost always higher. The limitation is that the driver does not report the actual bit rate back to userspace.

2 Likes

It is my school's WiFi that requires registering the MAC addresses. I did that registration already.

Can you browse websites through your router, using a computer connected to the LAN side?

The registered MAC address needs to be the MAC of the wifi client interface in the router (not your PC). You can see your MACs using iw dev. You can use option macaddr to force the WAN to be a particular MAC.

I ran the commands ipa; ip r

root@T118fec:~# ip a; ip r
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
    link/ether X:X:X:X:X:X brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b24e:26ff:fe11:8fed/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP qlen 1000
    link/ether X:X:X:X:X:X brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.2/24 brd 192.168.4.255 scope global eth1
       valid_lft forever preferred_lft forever
    inet6 fd2e:6b69:fced::1/60 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::b24e:26ff:fe11:8fec/64 scope link 
       valid_lft forever preferred_lft forever
6: wlan2: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWN qlen 4000
    link/ether X:X:X:X:X:X brd ff:ff:ff:ff:ff:ff
7: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether X:X:X:X:X:X brd ff:ff:ff:ff:ff:ff
    inet 35.12.218.24/24 brd 35.12.218.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::b24e:26ff:fe11:8fee/64 scope link 
       valid_lft forever preferred_lft forever
8: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether X:X:X:X:X:X brd ff:ff:ff:ff:ff:ff
    inet6 fe80::b24e:26ff:fe11:8fef/64 scope link 
       valid_lft forever preferred_lft forever
default via 35.12.218.1 dev wlan0  src 35.12.218.24 
35.12.218.0/24 dev wlan0  src 35.12.218.24 
35.12.218.1 dev wlan0  src 35.12.218.24 
192.168.4.0/24 dev eth1  src 192.168.4.2

Make sure you have registered exactly this MAC.

1 Like

I have registered that exact MAC address. I got it by iw dev

That is not the IP of openwrt.org. The school's DNS server has sent you to one of their addresses instead. This is a strong indication that their network intends to deny you use of the Internet. I can't see what exists at that IP since it is not open to the public side of the Internet. Likely it is a captive portal of some type. So again I ask what happens when you try to browse the web using a computer on the LAN side of your router?

If you can ping the gateway the stuff on your end is basically working.

2 Likes

Clone MAC-address from your router to your laptop/desktop and make sure it can access the internet.
Verify that it doesn't require captive portal or proxy authentication and doesn't use proxy auto discovery.

1 Like

I think you are right. When I go to 35.9.37.103 it shows me a page to register my device. I will try using my house's internet.