Tun interface and openvpn

The tun0 interface in the latest version does not appear after adding openvpn from the web interface. It is also impossible to create an interface manually according to the instructions. Tell me what I am doing wrong. I have tried this on different routers and it does not work anywhere.

Need help!

The tun device is created by the openvpn process itself.
As most openvpn configs have dev tun the openvpn process will choose the first available number so if this is the first tunnel the openvpn process will make the tun0 device.

So if there is no tun device the openvpn process is not running

To see if a device is present you do from the routers commandline ( ssh ) : ifconfig

A device is something else than an interface in OpenWrt parlor.
See https://openwrt.org/docs/guide-user/base-system/clarifying_interface_usage

For Openvpn you manually create an interface with proto none and device tun0 (see above for the right number)

Thanks.
Vpn started (see screenshort) but did not create device:

root@pwms:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 34:CE:00:67:44:26  
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::36ce:ff:fe67:4426/64 Scope:Link
          inet6 addr: fd34:605d:73e7::1/60 Scope:Global
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:298031 errors:0 dropped:0 overruns:0 frame:0
          TX packets:426776 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:73021969 (69.6 MiB)  TX bytes:564031378 (537.9 MiB)

eth0      Link encap:Ethernet  HWaddr 34:CE:00:67:44:26  
          inet6 addr: fe80::36ce:ff:fe67:4426/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1504  Metric:1
          RX packets:637213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:438615 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:600699146 (572.8 MiB)  TX bytes:212588537 (202.7 MiB)
          Interrupt:21 

lan1      Link encap:Ethernet  HWaddr 34:CE:00:67:44:26  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lan2      Link encap:Ethernet  HWaddr 34:CE:00:67:44:26  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:82067 errors:0 dropped:0 overruns:0 frame:0
          TX packets:122561 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:21776191 (20.7 MiB)  TX bytes:131568845 (125.4 MiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2822 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2822 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:229806 (224.4 KiB)  TX bytes:229806 (224.4 KiB)

phy0-ap0  Link encap:Ethernet  HWaddr 34:CE:00:67:44:27  
          inet6 addr: fe80::36ce:ff:fe67:4427/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:219427 errors:0 dropped:0 overruns:0 frame:0
          TX packets:379577 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:54464998 (51.9 MiB)  TX bytes:445471550 (424.8 MiB)

phy1-ap0  Link encap:Ethernet  HWaddr 34:CE:00:67:44:28  
          inet6 addr: fe80::36ce:ff:fe67:4428/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2207 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:632884 (618.0 KiB)

wan       Link encap:Ethernet  HWaddr 34:CE:00:67:44:25  
          inet addr:192.168.1.199  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::36ce:ff:fe67:4425/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:555146 errors:0 dropped:0 overruns:0 frame:0
          TX packets:291990 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:567453121 (541.1 MiB)  TX bytes:75801067 (72.2 MiB)

Does anyone know how to fix this?

It's a good system, but it doesn't work and there's no one to help.

The interface is defined in your OpenVPN configuration
for me, it's
dev tap0
when running, the interface appears, and you then add it to the br-lan
you can add as an unmanaged interface
in interfaces if you want to see it's activity tx & rx etc

1 Like

The command to add an interface is indeed in the .ovpn file,

#use virtual interface 'tun'
dev tun

but when starting vpn tun0 is not in the list of interfaces. When adding an interface manually, the interface does not work, because it does not find a connection with vpn.

should be
interfaces > devices > br-lan > configure > Bridge ports > tun

not sure why but i have tun0 maybe add the 0


Tried adding 0. Nothing changed.

The problems appeared on the latest firmware versions. Previously, the interface appeared in the list as tun0.

Maybe try
interfaces > add new interface > OpenVPN > Unmanaged >device > add manuly > tun0
then firewall > lan

just a note this is for your own openvpn server for others or your laptop to log into

Tried adding tun0 and tun+ manually. They don't work after adding.

are you making a server or logging into a server ?

logging into a server

ok well this setup if for a server to log into
you want a setup for a client not server

I am from Russia. Internet censorship. I tried different settings: https://openwrt.org/docs/guide-user/services/vpn/openvpn/client-luci
For the third day I can't set up YouTube.

I wouldn't like to roll back to the old version. I'd like to figure out why this one doesn't work.