OpenWrt WiFi/OVPN Not Working

Hi everyone,

I have currently just installed OpenWRT Version 19.07.7 on my TP-Link WR1043ND, currently I have LAN connectivity and USB working, but for some reason my WiFi won't let my devices connect, and also my OVPN config with both a VPNGate config and Ovpn Config doesn't wanna work. Right now my rotuer can't reach the internet but devices pass through LAN works, what do I need to provide for diagnostics purposes? Thanks for the help in advance.

P/S: This device is mainly gonna be a gateway I'll be using to pass the devices connected to the router to pass through my own OpenVPN/other OpenVPN network. And network non accessible only means that my opkg can't update.

Networking noob here btw.

Use ssh to connect to the device.

Please run the following commands (copy-paste the whole block) and paste the output here, using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have

ubus call system board; \
uci export network; uci export wireless; \
uci export dhcp; uci export firewall; \
head -n -0 /etc/firewall.user; \
ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ip -6 addr ; ip -6 ro li tab all ; ip -6 ru; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
1 Like
{
        "kernel": "4.14.221",
        "hostname": "Korea-GW",
        "system": "Qualcomm Atheros QCA9558 ver 1 rev 0",
        "model": "TP-Link TL-WR1043ND v3",
        "board_name": "tplink,tl-wr1043nd-v3",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.7",
                "revision": "r11306-c4a6851c72",
                "target": "ath79/generic",
                "description": "OpenWrt 19.07.7 r11306-c4a6851c72"
        }
}
package 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 'fd9d:5eb8:fe0e::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ip6assign '60'
        option ipaddr '192.168.0.3'
        option broadcast '192.168.0.3'
        option netmask '255.255.0.0'
        option ifname 'eth0 eth0.2 eth1 eth1.1 tun0'

config interface 'wan'
        option proto 'dhcp'
        option type 'bridge'
        option ifname 'br-lan eth0 eth0.2 tun0'
        list dns '1.1.1.1'
        option peerdns '0'

config interface 'wan6'
        option ifname 'eth0.2'
        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 '1 2 3 4 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 6t'

package wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/ahb/18100000.wmac'
        option country 'MY'
        option txpower '0'
        option htmode 'HT40'
        option channel '8'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option mode 'ap'
        option key ''
        option ssid ''
        option encryption 'psk2'
        option network 'wan'

package 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 leasetime '12h'
        option limit '250'

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'

package firewall

config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option synflood_protect '1'

config zone
        option name 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'
        option network 'lan wan'

config include
        option path '/etc/firewall.user'

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    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.0.3/16 brd 192.168.0.3 scope global br-lan
       valid_lft forever preferred_lft forever
192.168.0.0/16 dev br-lan scope link  src 192.168.0.3
broadcast 127.0.0.0 dev lo table local scope link  src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1
broadcast 192.168.0.0 dev br-lan table local scope link  src 192.168.0.3
local 192.168.0.3 dev br-lan table local scope host  src 192.168.0.3
broadcast 192.168.0.3 dev br-lan table local scope link  src 192.168.0.3
broadcast 192.168.255.255 dev br-lan table local scope link  src 192.168.0.3
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 state UNKNOWN qlen 1000
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
6: br-lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fd9d:5eb8:fe0e::1/60 scope global
       valid_lft forever preferred_lft forever
    inet6 fe80::a62b:b0ff:fefe:76c1/64 scope link
       valid_lft forever preferred_lft forever
12: br-wan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::a62b:b0ff:fefe:76c0/64 scope link
       valid_lft forever preferred_lft forever
13: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
    inet6 fe80::a62b:b0ff:fefe:76c0/64 scope link
       valid_lft forever preferred_lft forever
fd9d:5eb8:fe0e::/64 dev br-lan  metric 1024
unreachable fd9d:5eb8:fe0e::/48 dev lo  metric 2147483647  error -148
fe80::/64 dev br-lan  metric 256
fe80::/64 dev wlan0  metric 256
fe80::/64 dev br-wan  metric 256
local ::1 dev lo table local  metric 0
anycast fd9d:5eb8:fe0e:: dev br-lan table local  metric 0
local fd9d:5eb8:fe0e::1 dev br-lan table local  metric 0
anycast fe80:: dev br-lan table local  metric 0
anycast fe80:: dev br-wan table local  metric 0
anycast fe80:: dev wlan0 table local  metric 0
local fe80::a62b:b0ff:fefe:76c0 dev br-wan table local  metric 0
local fe80::a62b:b0ff:fefe:76c0 dev wlan0 table local  metric 0
local fe80::a62b:b0ff:fefe:76c1 dev br-lan table local  metric 0
ff00::/8 dev br-lan table local  metric 256
ff00::/8 dev wlan0 table local  metric 256
ff00::/8 dev br-wan table local  metric 256
0:      from all lookup local
32766:  from all lookup main
4200000001:     from all iif lo lookup unspec 12
4200000006:     from all iif br-lan lookup unspec 12
ls: /tmp/resolv.*/*: No such file or directory
lrwxrwxrwx    1 root     root            16 Feb 15 23:22 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            32 May 17 18:39 /tmp/resolv.conf
-rw-r--r--    1 root     root             0 May 17 18:39 /tmp/resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf.auto <==
head: /tmp/resolv.*/*: No such file or directory

I have deleted all the tun0/firewall related rules that is for OpenVPN, and this is what I have left. I still have access to the internet no problems, except WiFi and OVPN usability.

Do a reset to default settings, there are way to many mistakes here.
One thing is not to bridge all interfaces.
Another thing is that the upstream connection to the internet will be on wan port.

2 Likes

There are errors in your basic configuration. Reset the router as suggested by @trendy, and start from beginning.

Have you studied the 'Alternative guide for OpenVPN client using LuCI' mentioned at the bottom of the wiki page?
https://openwrt.org/docs/guide-user/services/vpn/openvpn/client-luci

Reset and where should I go from there?

I've tried studying the alternative guide but beacuse of the forums' design it was super hard for me to follow along as I didn't know where to look or follow

First set up a dumb AP configuration, then add the VPN client. Departing from the dumb AP guide slightly, you will need to keep dnsmasq and firewall enabled for the VPN.

If it is a v1 WR1043ND (square white case) those only have 32 MB of RAM which is insufficient to run OpenVPN.

It's a V3 and I have expanded the /overlay partition with a USB drive, currently it's at 16GBs of storage with it

And I have tried this but for some reason after applying, my interface can't be accessed anymore and my AP can't be connected as well

Better start from a clean configuration and work your problems one by one. For example after a clean start, you should enable the wireless radio and the OpenWrt SSID should be visible.

I have gotten both Internet through LAN/WiFi working, but I'm having an issue where I can't run opkg update and it returns me with Failed to send request: Operation not permitted. I have added DNS servers to the br-lan interface, still no avail

Also set the gateway in br-lan to be your main router.

Okay, let's have another look:

ubus call system board; \
uci export network; uci export wireless; \
uci export dhcp; uci export firewall; \
head -n -0 /etc/firewall.user; \
ip -4 addr ; ip -4 ro li tab all ; ip -4 ru; \
ls -l  /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/* ; head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

This actually helped, but I will post the full list of my info for trendy to check for any misconfiguration

{
        "kernel": "4.14.221",
        "hostname": "TP-Link-KR",
        "system": "Qualcomm Atheros QCA9558 ver 1 rev 0",
        "model": "TP-Link TL-WR1043ND v3",
        "board_name": "tplink,tl-wr1043nd-v3",
        "release": {
                "distribution": "OpenWrt",
                "version": "19.07.7",
                "revision": "r11306-c4a6851c72",
                "target": "ath79/generic",
                "description": "OpenWrt 19.07.7 r11306-c4a6851c72"
        }
}
package 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 'fdb7:a186:7d37::/48'

config interface 'lan'
        option type 'bridge'
        option proto 'static'
        option ip6assign '60'
        list ipaddr '192.168.0.3/24'
        option ifname 'eth0 eth1.1'
        list dns '1.1.1.1'
        list dns '1.0.0.1'
        option gateway '192.168.0.1'

config interface 'wan'
        option ifname 'eth0.2'
        option proto 'dhcp'
        option type 'bridge'

config interface 'wan6'
        option ifname 'eth0.2'
        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 '1 2 3 4 0t'

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '5 6t'

package wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11g'
        option path 'platform/ahb/18100000.wmac'
        option htmode 'HT20'
        option country 'MY'
        option channel '8'

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

package 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 ignore '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'

package firewall

config defaults
        option input 'ACCEPT'
        option output 'ACCEPT'
        option synflood_protect '1'
        option forward 'ACCEPT'

config zone
        option name 'lan'
        list network 'lan'
        option input 'ACCEPT'
        option output 'ACCEPT'
        option forward 'ACCEPT'

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

config forwarding
        option src 'lan'
        option dest 'wan'

config rule
        option name 'Allow-DHCP-Renew'
        option src 'wan'
        option proto 'udp'
        option dest_port '68'
        option target 'ACCEPT'
        option family 'ipv4'

config rule
        option name 'Allow-Ping'
        option src 'wan'
        option proto 'icmp'
        option icmp_type 'echo-request'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-IGMP'
        option src 'wan'
        option proto 'igmp'
        option family 'ipv4'
        option target 'ACCEPT'

config rule
        option name 'Allow-DHCPv6'
        option src 'wan'
        option proto 'udp'
        option src_ip 'fc00::/6'
        option dest_ip 'fc00::/6'
        option dest_port '546'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-MLD'
        option src 'wan'
        option proto 'icmp'
        option src_ip 'fe80::/10'
        list icmp_type '130/0'
        list icmp_type '131/0'
        list icmp_type '132/0'
        list icmp_type '143/0'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Input'
        option src 'wan'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        list icmp_type 'router-solicitation'
        list icmp_type 'neighbour-solicitation'
        list icmp_type 'router-advertisement'
        list icmp_type 'neighbour-advertisement'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-ICMPv6-Forward'
        option src 'wan'
        option dest '*'
        option proto 'icmp'
        list icmp_type 'echo-request'
        list icmp_type 'echo-reply'
        list icmp_type 'destination-unreachable'
        list icmp_type 'packet-too-big'
        list icmp_type 'time-exceeded'
        list icmp_type 'bad-header'
        list icmp_type 'unknown-header-type'
        option limit '1000/sec'
        option family 'ipv6'
        option target 'ACCEPT'

config rule
        option name 'Allow-IPSec-ESP'
        option src 'wan'
        option dest 'lan'
        option proto 'esp'
        option target 'ACCEPT'

config rule
        option name 'Allow-ISAKMP'
        option src 'wan'
        option dest 'lan'
        option dest_port '500'
        option proto 'udp'
        option target 'ACCEPT'

config include
        option path '/etc/firewall.user'

# This file is interpreted as shell script.
# Put your custom iptables rules here, they will
# be executed with each firewall (re-)start.

# Internal uci firewall chains are flushed and recreated on reload, so
# put custom rules into the root chains e.g. INPUT or FORWARD or into the
# special user chains, e.g. input_wan_rule or postrouting_lan_rule.
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    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.0.3/24 brd 192.168.0.255 scope global br-lan
       valid_lft forever preferred_lft forever
default via 192.168.0.1 dev br-lan
192.168.0.0/24 dev br-lan scope link  src 192.168.0.3
broadcast 127.0.0.0 dev lo table local scope link  src 127.0.0.1
local 127.0.0.0/8 dev lo table local scope host  src 127.0.0.1
local 127.0.0.1 dev lo table local scope host  src 127.0.0.1
broadcast 127.255.255.255 dev lo table local scope link  src 127.0.0.1
broadcast 192.168.0.0 dev br-lan table local scope link  src 192.168.0.3
local 192.168.0.3 dev br-lan table local scope host  src 192.168.0.3
broadcast 192.168.0.255 dev br-lan table local scope link  src 192.168.0.3
0:      from all lookup local
32766:  from all lookup main
32767:  from all lookup default
ls: /tmp/resolv.*/*: No such file or directory
lrwxrwxrwx    1 root     root            16 Feb 15 23:22 /etc/resolv.conf -> /tmp/resolv.conf
-rw-r--r--    1 root     root            32 May 19 00:13 /tmp/resolv.conf
-rw-r--r--    1 root     root            54 May 19 00:13 /tmp/resolv.conf.auto
==> /etc/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf <==
search lan
nameserver 127.0.0.1

==> /tmp/resolv.conf.auto <==
# Interface lan
nameserver 1.1.1.1
nameserver 1.0.0.1
head: /tmp/resolv.*/*: No such file or directory

I understand you want to bridge everything under lan interface. Then do this:

uci delete network.wan.ifname
uci delete network.wan6.ifname
uci delete network.lan.ifname
uci set network.lan.ifname='eth0.2 eth1.1'
uci commit network
ifup lan

What will this do exactly? Deleting wan and wan6 interface and also br-lan(?), and what about eth0.2 and eth1.1?

It will assign the vlan attached to the physical port wan to the lan interface.

eth0 is port 6 of the switch and eth1 is port 0. Note that the switch configuration has them both tagged, so the existing lan network is eth1.1 and the existing wan network (which isn't used in a dumb AP) is eth0.2.

Since the traffic to the CPU is all tagged, don't use plain eth0 or eth1 without a tag anywhere in your configuration. To re-use VLAN 2 you'd want to delete wan and wan6 so that eth0.2 only appears in one network.

When getting started you can just ignore the wan network and the WAN port on the switch and eth0.2 and use the yellow LAN ports for everything.

A refinement to the configuration is to repurpose the blue WAN port to be something useful. If you want a pure 5 LAN ports, move port 5 into switch VLAN 1. But you'll probably want separate VLANs for wired VPN users.