Configuring tun interface, DEVICE_CLAIM_FAILED

I'm trying to setup ProtonVPN and it would seem their docs skip the process of creating a tun interface. I created this interface, but am getting this error in Network->Interfaces->VPN0

Error: Unknown error (DEVICE_CLAIM_FAILED)

After creating tun0, I would add this to the *.ovpn file by adding 0 after tun.

dev tun0

This error appears when starting an OpenVPN instance, VPN->OpenVPN.

Thoughts?

Let’s see your config

Please 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:

cat /etc/config/network
cat /etc/config/firewall

And of course also include your OpenVPN file.

The OpenVPN process will create tun0. Do not create one beforehand. The error you are seeing is because the name already exists.

Here is my setup.

$ 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 'fdca:57b1:ac19::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan1'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ip6assign '60'
        option broadcast '192.168.120.255'
        list ipaddr '192.168.120.1/24'

config device
        option name 'wan'
        option macaddr '62:38:e0:c0:b5:90'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'

config interface 'VPN0'
        option proto 'none'
        option device 'tun0'
$ cat /etc/config/firewall

config defaults                    
        option forward 'REJECT'       
        option synflood_protect '1'   
        option input 'REJECT'         
        option output 'REJECT'        
                                      
config zone                           
        option name 'lan'             
        option input 'ACCEPT'         
        option output 'ACCEPT'        
        option forward 'ACCEPT'       
        list network 'lan'            
                                       
config zone                            
        option name 'wan'              
        option mtu_fix '1'             
        option input 'REJECT'          
        option forward 'REJECT'        
        option output 'ACCEPT'         
        option masq '1'                
        list network 'wan'             
        list network 'wan6'            
                                       
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 rule                                     
        option name 'Support-UDP-Traceroute'    
        option src 'wan'                        
        option dest_port '33434:33689'          
        option proto 'udp'                      
        option family 'ipv4'                    
        option target 'REJECT'                  
        option enabled 'false'                  
                                                
config include                                  
        option path '/etc/firewall.user'        
                                                
config forwarding                               
        option src 'lan'                        
        option dest 'wan'                  
$ cat /etc/openvpn/my.ovpn

client
dev tun0
proto udp
                                                                                                   
remote x.x.x.x 51820
remote x.x.x.x 5060
remote x.x.x.x 80
remote x.x.x.x 4569
remote x.x.x.x 1194
                                                                                                   
remote-random
resolv-retry infinite
nobind
                                                                                                   
cipher AES-256-CBC
                                                                                                   
auth SHA512
verb 3
                                                                                                   
setenv CLIENT_CERT 0
tun-mtu 1500
tun-mtu-extra 32
mssfix 1450
persist-key
persist-tun
                                                                                                   
reneg-sec 0

remote-cert-tls server
auth-user-pass /etc/openvpn/my.auth
pull
fast-io

\<ca>
...
\</ca>

key-direction 1
\<tls-auth>
...
\</tls-auth>

@mk24 Removing my tun0 interface and setting dev tun0 back to dev tun in my.ovpn file, then restarting, I can still connect, but it's not through the vpn.

You don’t have the vpn associated with a firewall zone. Once you do that and add forwarding from lan > vpn zone, it should work.

I could swear I have that, here's my latest /etc/config/firewall. One question I have is, what should device be in Interfaces->VPN->General Settings.

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

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

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

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 rule
	option name 'Support-UDP-Traceroute'
	option src 'wan'
	option dest_port '33434:33689'
	option proto 'udp'
	option family 'ipv4'
	option target 'REJECT'
	option enabled 'false'

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

config zone
	option name 'vpn'
	option input 'REJECT'
	option output 'ACCEPT'
	option forward 'REJECT'
	option masq '1'
	option mtu_fix '1'
	list network 'vpn0'

config forwarding
	option src 'lan'
	option dest 'vpn'

What specifically are you asking? It should be unmanaged, like you showed above.

In the vpn firewall zone, use list device 'tun0' to attach to the tun0 device. If you use list network you have to create a dummy network to associate a network name to the device name. You will see this in older tutorials. It is unnecessary now that the firewall accepts device names directly.