Thanks for that extra bit of info! I finally had some time this morning to set this up and check that things are working as they were before.
I went into the add-on settings and deleted all my ovpn configs (I had WAY too many) and then reimported the ones I had changed and copied over to vpn-config. The add-on is now working great!! I checked the IP by using my ssh connection and the command “curl ipv4.icanhazip.com” (Thanks @stim) and it seems to be working. One slightly worrying thing is that initially this morning that command gave me my actual home IP and not the VPN one - I had tested it last night and it was working but must have disconnected by this morning. I chose the same ovpn config as last night and it has been showing that one since. I wish there was some indication if the VPN servers connection drops. Another weird thing I noticed is that although under the OSMC/Settings/System Information it shows internet as ‘connected’, when I was checking my DNS settings under My OSMC/Network it says 'Status: eth0 (no internet). But the internet is definitely working and I can stream some video with no problem.
Anyway @gmccauley I want to thank you for all your help and for giving me that extra little bit of information which so ofter makes all the difference!!
Hi all,
I’m having similar issues with openvpn. I’m trying to use it independently of the Add-on but it should be doing just the same.
Everything was working fine before the December update but ever since I don’t seem to have an internet connection when the VPN is active.
curl ipinfo.io just times out when the vpn is active.
The log of my openvpn is
sudo openvpn --config US\ EastOrig.ovpn
Sat Jan 27 08:25:34 2018 OpenVPN 2.4.0 arm-unknown-linux-gnueabihf [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 18 2017
Sat Jan 27 08:25:34 2018 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.08
Sat Jan 27 08:25:34 2018 TCP/UDP: Preserving recently used remote address: [AF_INET]208.167.254.55:1198
Sat Jan 27 08:25:34 2018 UDP link local: (not bound)
Sat Jan 27 08:25:34 2018 UDP link remote: [AF_INET]208.167.254.55:1198
Sat Jan 27 08:25:34 2018 WARNING: this configuration may cache passwords in memory – use the auth-nocache option to prevent this
Sat Jan 27 08:25:34 2018 [c0b32b019af33f76bb79148cb20adfb3] Peer Connection Initiated with [AF_INET]208.167.254.55:1198
Sat Jan 27 08:25:35 2018 TUN/TAP device tun0 opened
Sat Jan 27 08:25:35 2018 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Sat Jan 27 08:25:35 2018 /sbin/ip link set dev tun0 up mtu 1500
Sat Jan 27 08:25:35 2018 /sbin/ip addr add dev tun0 local 10.71.10.6 peer 10.71.10.5
Sat Jan 27 08:25:35 2018 Initialization Sequence Completed
Here is the output of the tun0 ifconfig while the vpn is running:
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.71.10.6 netmask 255.255.255.255 destination 10.71.10.5
inet6 fe80::5647:3e2f:a606:9af1 prefixlen 64 scopeid 0x20
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 5 bytes 380 (380.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 148 bytes 13567 (13.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Here are the things I already tried
- tcp rather than udp.
- --management localhost 1337
- --management 127.0.0.1 1337
- installing resolvconf
I’m really confused about what is happening and would appreciate any help.
Thanks,
Thanks for the link. I saw it before but could not get it to work. But it indeed contains the solution. It was indeed the DNS server that was causing issues. I had to install resolvconf and I had to add 8.8.8.8 as a nameserver in the file /etc/resolv.conf. Watch out that it is modified at reboot.
Hi, I have Brian Hornsby openvpn script installed but cannot make it autostart. I try:
sudo mkdir /etc/systemd/system/openvpn@.service.d
sudo nano /etc/systemd/system/openvpn@.service.d/restart.conf
and in the file paste these three lines:
[Service]
Restart=always
RestartSec=5
and this:
It’s very easy in OSMC - and we do use systemd.
To enable OpenVPN to run at startup, run:
sudo systemctl enable openvpn
To specify which config file to run, you need to:
1 Place the config file in /etc/openvpn and give it a .conf suffix, not .ovpn.
2 Edit file /etc/default/openvpn and add a line
AUTOSTART=“NL”
so that it will look for file /etc/openvpn/NL.conf.
Then restart and see if it’s working as you expect.
but nothing work with that script. I also ask on script github but meybe You can help me?
Regards.
I think dilthedog is referring to using systemd without the brian Hornsby addon. So you need to make sure the vpn configuration (comes as a opvn file) exists in:
/etc/openvpn/client
As a conf file, then open vpn should work on startup.
Hi, thanks for reply, I have only osmc.conf (I rename my osmc.opvn fille) in /etc/openvpn/. Now I copy my osmc.ovpn file to that folder but don’t work either.
# This service is actually a systemd target,
# but we are using a service since targets cannot be reloaded.
[Unit]
Description=OpenVPN service
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/true
ExecReload=/bin/true
WorkingDirectory=/etc/openvpn
[Install]
WantedBy=multi-user.target
osmc@osmc:~$ sudo systemctl enable openvpn
Synchronizing state of openvpn.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable openvpn
osmc@osmc:~$ sudo systemctl status openvpn
● openvpn.service - OpenVPN service
Loaded: loaded (/lib/systemd/system/openvpn.service; enabled; vendor preset: enabled)
Active: active (exited) since Mon 2020-03-16 17:58:41 CET; 22min ago
Main PID: 344 (code=exited, status=0/SUCCESS)
CGroup: /system.slice/openvpn.service
mar 16 17:58:41 osmc systemd[1]: Starting OpenVPN service...
mar 16 17:58:41 osmc systemd[1]: Started OpenVPN service.
OK, it’s working now and autostart is on. I copy that file and do in terminal: sudo systemctl start openvpn@osmc.service
and sudo systemctl enable openvpn@osmc.service
osmc@osmc:~$ systemctl status openvpn@osmc.service
● openvpn@osmc.service - OpenVPN connection to osmc
Loaded: loaded (/lib/systemd/system/openvpn@.service; enabled; vendor preset: enabled)
Drop-In: /etc/systemd/system/openvpn@.service.d
└─restart.conf
Active: active (running) since Mon 2020-03-16 21:03:50 CET; 6min ago
Docs: man:openvpn(8)
https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage
https://community.openvpn.net/openvpn/wiki/HOWTO
Main PID: 329 (openvpn)
CGroup: /system.slice/system-openvpn.slice/openvpn@osmc.service
└─329 /usr/sbin/openvpn --daemon ovpn-osmc --status /run/openvpn/osmc.status 10 --cd /etc/openvpn --config /etc/openvpn/osmc.conf --writepid /run/openvpn/osmc.pid
mar 16 21:03:57 osmc ovpn-osmc[329]: ROUTE_GATEWAY 192.168.0.1/255.255.255.0 IFACE=eth0 HWADDR=b8:27:eb:c3:4a:53
mar 16 21:04:50 osmc ovpn-osmc[329]: TUN/TAP device tun0 opened
mar 16 21:04:50 osmc ovpn-osmc[329]: TUN/TAP TX queue length set to 100
mar 16 21:04:50 osmc ovpn-osmc[329]: do_ifconfig, tt->did_ifconfig_ipv6_setup=0
mar 16 21:04:50 osmc ovpn-osmc[329]: /sbin/ip link set dev tun0 up mtu 1500
mar 16 21:04:51 osmc ovpn-osmc[329]: /sbin/ip addr add dev tun0 10.8.0.4/24 broadcast 10.8.0.255
mar 16 21:04:51 osmc ovpn-osmc[329]: /sbin/ip route add 217.61.63.183/32 via 192.168.0.1
mar 16 21:04:51 osmc ovpn-osmc[329]: /sbin/ip route add 0.0.0.0/1 via 10.8.0.1
mar 16 21:04:51 osmc ovpn-osmc[329]: /sbin/ip route add 128.0.0.0/1 via 10.8.0.1
mar 16 21:04:51 osmc ovpn-osmc[329]: Initialization Sequence Completed