Raspberry Pi 4 w OpenWrt router WiFi as VPN issue

Hello everybody,
I have a raspberry Pi 4 with 8Gb and i try to use it as WiFi Access Point VPN.
The target is to use autoamtically VPN for each device that is connected to the Wifi.

I have:

  • reinstalled OpenWrt (version 21.02.7 for raspberry Pi4)
  • assigned a static IP
  • create 2 interface (LAN and LAN_OUT)
  • activate the WiFi
  • installed OpenVPN and configuration file.
  • remove from config network IPv6

The overall network structure is: Internet --> Router Real --> (lan cable) --> Raspberry --> (WiFi) --> Device

The problem is that also if connected to the wifi, with VPN configuration enable, the VPN doesn't work. My IP is always the same nation of real ISP.

From the log I see a lot of

user.info : luci: accepted login on / for root from 192.168.1.39
daemon.err odhcpd[802]: Failed to send to ff02::1%lan@br-lan (Permission denied)
daemon.err odhcpd[802]: Failed to send to ff02::1%lan@br-lan (Permission denied)

daemon.err odhcpd[802]: Failed to send to ff02::1%lan@br-lan (Permission denied)
authpriv.info dropbear[1993]: Child connection from 192.168.1.39:64492

daemon.err odhcpd[802]: Failed to send to ff02::1%lan@br-lan (Permission denied)
daemon.err odhcpd[802]: Failed to send to ff02::1%lan@br-lan (Permission denied)

From other topics the problem seems caused by the IPv6, but I yet removed it from configuration.

Do you have any suggestion or solution?

Thank you so much, please help me :pray: :cry:

You should be using 23.05. The version you are using now (21.02) is EOL and unsupported.

Also, the Raspberry Pi wifi (all generations) is very low performance. While it is technically functional, it is not a good option for use as an AP (in terms of bandwidth, range, and supporting multiple devices).

That being said, the first thing to do is to start over with 23.05.2. Then, I'm not quite sure how you had the LAN and LAN_OUT interfaces defined, but they must be non-overlapping subnets for it to work.

Once you're up-to-date with OpenWrt, you can post your configuration here:

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it 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
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Update the bootloader by flashing Raspberry OS, loading it and letting is run long enough to find updates and apply them. Reboot to look for any other updates and power off. The updates will include the latest bootloader.

Upgrade using the firmware selector.
Select 'Customize installed packages and/or first boot script'
Request build.
Wait for the server to compile.

Choose system you prefer based on this.

First of all thank you for your time and for your help @psherman @LilRedDog

As recommended I have upgrade to 23.05.2 version.

I am aware of poor performance of Raspberry Pi wifi, but in my case I think it is good enough to handle 1 or 2 devices with that generate low network traffic. I mean, I hope this :slightly_smiling_face:

After the installation I set up the RB Pi and except VPN, everything seems working.

I know that is strange, but the only way I have found to allow the RP Pi to ping openwrt package resources was the creation of a new network interface (as you can see further).
I apologise but my networking knowledge is very rusty, and I'm not sure that is the proper (or the best) way.

Here my actual configuration.

Configuration

ubus call system board
# ubus call system board
{
        "kernel": "5.15.137",
        "hostname": "OpenWrt",
        "system": "ARMv8 Processor rev 3",
        "model": "Raspberry Pi 4 Model B Rev 1.5",
        "board_name": "raspberrypi,4-model-b",
        "rootfs_type": "ext4",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.2",
                "revision": "r23630-842932a63d",
                "target": "bcm27xx/bcm2711",
                "description": "OpenWrt 23.05.2 r23630-842932a63d"
        }
}
cat /etc/config/network
# cat /etc/config/network
config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd0b:b679:28bf::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'eth0'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.42'
        option netmask '255.255.255.0'
        option ip6assign '60'

config interface 'lan_out'
        option proto 'dhcp'
        option device 'br-lan'
cat /etc/config/wireless
# cat /etc/config/wireless
config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option channel '36'
        option band '5g'
        option htmode 'VHT80'
        option cell_density '0'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option ssid 'XXXXXX'
        option encryption 'XXXXXX'
        option key 'XXXXXX'
cat /etc/config/dhcp
# 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 cachesize '1000'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
        option nonwildcard '1'
        option localservice '1'
        option ednspacket_max '1232'
        option filter_aaaa '0'
        option filter_a '0'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        option dhcpv4 'server'
        option dhcpv6 'server'
        option ra 'server'
        option ra_slaac '1'
        list ra_flags 'managed-config'
        list ra_flags 'other-config'

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'
cat /etc/config/firewall
# cat /etc/config/firewall
config defaults
        option syn_flood        1
        option input            REJECT
        option output           ACCEPT
        option forward          REJECT
# Uncomment this line to disable ipv6 rules
#       option disable_ipv6     1

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 forward          REJECT
        option masq             1
        option mtu_fix          1

config forwarding
        option src              lan
        option dest             wan

# We need to accept udp packets on port 68,
# see https://dev.openwrt.org/ticket/4108
config rule
        option name             Allow-DHCP-Renew
        option src              wan
        option proto            udp
        option dest_port        68
        option target           ACCEPT
        option family           ipv4

# Allow IPv4 ping
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

# Allow DHCPv6 replies
# see https://github.com/openwrt/openwrt/issues/5066
config rule
        option name             Allow-DHCPv6
        option src              wan
        option proto            udp
        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

# Allow essential incoming IPv6 ICMP traffic
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

# Allow essential forwarded IPv6 ICMP traffic
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


### EXAMPLE CONFIG SECTIONS
# do not allow a specific ip to access wan
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option dest             wan
#       option proto    tcp
#       option target   REJECT

# block a specific mac on wan
#config rule
#       option dest             wan
#       option src_mac  00:11:22:33:44:66
#       option target   REJECT

# block incoming ICMP traffic on a zone
#config rule
#       option src              lan
#       option proto    ICMP
#       option target   DROP

# port redirect port coming in on wan to lan
#config redirect
#       option src                      wan
#       option src_dport        80
#       option dest                     lan
#       option dest_ip          192.168.16.235
#       option dest_port        80
#       option proto            tcp

# port redirect of remapped ssh port (22001) on wan
#config redirect
#       option src              wan
#       option src_dport        22001
#       option dest             lan
#       option dest_port        22
#       option proto            tcp

### FULL CONFIG SECTIONS
#config rule
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:11:22:33:44:55
#       option src_port 80
#       option dest             wan
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp
#       option target   REJECT

#config redirect
#       option src              lan
#       option src_ip   192.168.45.2
#       option src_mac  00:11:22:33:44:55
#       option src_port         1024
#       option src_dport        80
#       option dest_ip  194.25.2.129
#       option dest_port        120
#       option proto    tcp

This time the only difference is that I have not yet disable IPv6 removing from /etc/config/network the option ula_prefix.

Maybe it could be useful if someone can suggest me the proper configuration for interface and openWRT to setup my idea of network.

The idea is to connect via LAN a Raspberry Pi 4 to my ISP router. Use the RB Pi with installed OpenWrt to provide a wifi network that allow each connected devices to use an openVPN configuration.

Maybe could be only some configuration that I'm using :sweat:

Thank you in advance.

I wish I could help but running VPN in OpenWrt is not something I do. I use HotSpot shield and it is a device specific VPN and not a whole network.