OpenWrt Forum Archive

Topic: Router crashes when OpenVPN connects

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to get my Dragino router to connect as a client to my OpenVPN server.

I've followed the guides and can get the router to connect but it crashes as soon as it tries to configure the tun adaptor right after this command:

/sbin/ifconfig tun0 10.8.0.2 netmask 255.255.248.0 mtu 1500 broadcast 10.8.7.255

I can see from the server that the VPN connection is made but it forces the router to reboot.

This is all made a little harder since the router is using a modified firmware from Dragino.

I followed the instructions for the client config from the wiki: wiki.openwrt.org/doc/howto/vpn.openvpn

Can anyone help me get this working?

Thanks.

Ok, a bit more info.

Running the ifconfig command from the shell returns:

ifconfig: SIOCSIFADDR: No such device

and running ifconfig -a produces this:

br-lan    Link encap:Ethernet  HWaddr A8:40:41:17:BD:75  
          inet addr:10.130.1.1  Bcast:10.130.1.255  Mask:255.255.255.0
          inet6 addr: fe80::aa40:41ff:fe17:bd75/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:676 errors:0 dropped:0 overruns:0 frame:0
          TX packets:397 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:66211 (64.6 KiB)  TX bytes:53733 (52.4 KiB)

eth0      Link encap:Ethernet  HWaddr A8:40:41:17:BD:75  
          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)
          Interrupt:5 

eth1      Link encap:Ethernet  HWaddr A8:40:41:17:BD:74  
          inet addr:192.168.1.111  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::aa40:41ff:fe17:bd74/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:7834 errors:0 dropped:4 overruns:0 frame:0
          TX packets:1438 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2130835 (2.0 MiB)  TX bytes:133393 (130.2 KiB)
          Interrupt:4 

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:213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:19661 (19.2 KiB)  TX bytes:19661 (19.2 KiB)

teql0     Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          NOARP  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:100 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr A8:40:41:17:BD:72  
          inet6 addr: fe80::aa40:41ff:fe17:bd72/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:695 errors:0 dropped:0 overruns:0 frame:0
          TX packets:455 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:77545 (75.7 KiB)  TX bytes:79920 (78.0 KiB)

So it looks like tun0 does not exist. It is set in the network file:

uci show network
network.loopback=interface
network.loopback.ifname='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.lan=interface
network.lan.type='bridge'
network.lan.proto='static'
network.lan.dns='8.8.8.8'
network.lan.ifname='eth0'
network.lan.netmask='255.255.255.0'
network.lan.ipaddr='10.130.1.1'
network.lan.gateway='255.255.255.255'
network.@interface[0]=interface
network.@interface[0].ifname='bat0'
network.mesh_0=interface
network.mesh_0.proto='static'
network.mesh_0.mtu='1528'
network.mesh_0.ipaddr='10.10.1.20'
network.mesh_0.netmask='255.255.255.0'
network.wan=interface
network.wan.ifname='eth1'
network.wan.proto='dhcp'
network.wan.hostname='dragino-100001'
network.vpn0=interface
network.vpn0.ifname='tun0'
network.vpn0.proto='none'
network.vpn0.auto='1'

I've verified that /dev/net/tun does exist and check the module is loaded.

modprobe tun
tun is already loaded

So why can't I get it to work!

(Last edited by mattltm on 6 Sep 2017, 11:48)

The discussion might have continued from here.