No tun0 being created when i add openvpn

I am very new- I'll do my best to describe my problem. any insight would be helpful - Ive spent a few days googling and reinstalling and trying various configurations with no success. Before i go any further i need some advice.

I installed to an edgerouter -x. I connect to isp on pppoe with tagged vlan 35 fine
problem begins when i try and get openvpn client running. Installed luci-openvpn and openssl packages then try to configure as per instructions on site. I get so far as the interface - it looks like its creates it but when i do a save to says device is missing. I've done the routine a few times and reset the f/w as well same result. I now have a new f/w reset with just the pppoe Vlan tag and no vpn package. i'm not sure but it seems odd that i only have an eth0 reference in my ifconfig no eth1. with all the the interfaces on the same mac address.

root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 18:E8:29:2E:65:5E
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd60:8eb2:d25c::1/60 Scope:Global
          inet6 addr: fe80::1ae8:29ff:fe2e:655e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2177 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:325346 (317.7 KiB)  TX bytes:1175605 (1.1 MiB)

eth0      Link encap:Ethernet  HWaddr 18:E8:29:2E:65:5E
          inet6 addr: fe80::1ae8:29ff:fe2e:655e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2219 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3029 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:367462 (358.8 KiB)  TX bytes:1264177 (1.2 MiB)
          Interrupt:20

eth0.1    Link encap:Ethernet  HWaddr 18:E8:29:2E:65:5E
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2177 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2524 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:325346 (317.7 KiB)  TX bytes:1175605 (1.1 MiB)

eth0.35   Link encap:Ethernet  HWaddr 18:E8:29:2E:65:5E
          inet6 addr: fe80::1ae8:29ff:fe2e:655e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:199 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:24126 (23.5 KiB)

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:580 errors:0 dropped:0 overruns:0 frame:0
          TX packets:580 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:43059 (42.0 KiB)  TX bytes:43059 (42.0 KiB)
root@OpenWrt:/# vi /etc/config/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 'fd60:8eb2:d25c::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0.1'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'

config device 'lan_eth0_1_dev'
        option name 'eth0.1'
        option macaddr '18:e8:29:2e:65:5e'

config interface 'wan'
        option ifname 'eth0.35'
        option proto 'pppoe'
        option ipv6 'auto'
        option username 'pppoe_user@user.ca'
        option password 'pppoe_password'

config device 'wan_eth0_2_dev'
        option name 'eth0.2'
        option macaddr '18:e8:29:2e:65:5f'

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

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

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

config switch_vlan
        option device 'switch0'
        option vlan '2'
        option ports '6t 0t'
        option vid '35'

Check the system log it is likely that OpenVPN did not connect properly, in which case it won't start up the tun device.

This hardware has one CPU Ethernet port eth0 which is shared to all the Ethernet jacks through a switch.

1 Like

So in the tutorials it shows the user creating the tun0 interface then - does the tun0 interface have a dependency on the vpn proffile file? can a tun0 interface be created without a vpn profile file?

Yes OpenVPN will create the interface, and the name of the interface is specified in the OpenVPN configuration. OpenVPN requires a configuration to do anything. If you are connecting to a commercial VPN service they should supply a .ovpn file which would work with possible minor edits. OpenWrt can also dynamically create an OpenVPN configuration through its UCI system but that is more typical when you are running a private system.

2 Likes

OK, fantastic - that narrows it down then i have something wrong with the formatting of my .ovpn file. And only because i'm paranoid i just want to make certain there's no issue with my isp vlan tagged connection grabbing the same mac address as everything on the lan/switch.
6 months ago i thought i finally figured out vlans then i installed openwrt? never stop learning.

Don't waste time guessing, check the log:

/etc/init.d/log restart; /etc/init.d/openvpn restart; sleep 10; logread -e openvpn
1 Like

thanks that was very helpful.

1 Like