peacey / split-vpn

A split tunnel VPN script for Unifi OS routers (UDM, UXG, UDR) with policy based routing.
GNU General Public License v3.0
802 stars 56 forks source link

VPN SPLIT-VPN Configuration all gone due to Firmware Upgrade #164

Closed 1cyber closed 1 year ago

1cyber commented 1 year ago

Just writing as we recently had an auto-update on our Unifi UDM Dream Machine Pro to Network 7.2.97 and Unifi OS 2.4.27 and we have lost all of our VPN Configuration.

We are attempt to re-install the debian packages however just confirming if anyone else has ran across this issue. The upgrade was released 20/02/2023 4:00am AEST for us and unsure if we can still run our same code to get our UDM's to run the certificate based only VPN's.

peacey commented 1 year ago

Hi @1cyber,

The release notes of 2.4.27 say that any custom modifications (including /mnt/data) will get wiped, so that's to be expected. You should have backed up the split-vpn configs before updating the OS.

Split-vpn works perfectly fine on 2.4.27, so you'll have just have to reinstall it. OpenVPN or wireguard should work fine.

Are you having any issues reinstalling it and reconfiguring it that you need help with?

1cyber commented 1 year ago

Peachy

Thank you for the amazing quick response. We will re-install as we do have a copy of the backup and re-run our configuration. Thanks for the update. Once installed, we will come back and update status to resolved if it all works. Appreciate your help.

1cyber commented 1 year ago

Hey peachy, I seem to be having issues finding the updown.sh command. I followed instructions on the main page, am I missing this command or should i reimport the packages?

on Feb 20 18:53:29 2023 GDG6: remote_host_ipv6=n/a Mon Feb 20 18:53:29 2023 ROUTE6: default_gateway=UNDEF Mon Feb 20 18:53:29 2023 TUN/TAP device tun0 opened Mon Feb 20 18:53:29 2023 TUN/TAP TX queue length set to 100 Mon Feb 20 18:53:29 2023 /sbin/ip link set dev tun0 up mtu 1500 Mon Feb 20 18:53:29 2023 /sbin/ip addr add dev tun0 10.7.1.34/28 broadcast 10.7.1.47 Mon Feb 20 18:53:29 2023 /sbin/ip -6 addr add fd:0:0:8106::2/64 dev tun0 Mon Feb 20 18:53:29 2023 /mnt/data/split-vpn/vpn/updown.sh tun0 1500 1552 10.7.1.34 255.255.255.240 init /mnt/data/split-vpn/vpn/updown.sh: 4: ./vpn.conf: : not found Mon Feb 20 18:53:29 2023 WARNING: Failed running command (--up/--down): could not execute external program

1cyber commented 1 year ago

Found the issue and resolved above however I Can't seem to automate the VPN Script now. I can't seem to deploy the udm boot service. Getting this error:

Preparing to unpack udm-boot_1.0.7_all.deb ... Unpacking udm-boot (1.0.7) over (1.0.7) ... Setting up udm-boot (1.0.7) ... Failed to restart udm-boot.service: Unit udm-boot.service has a bad unit file setting. See system logs and 'systemctl status udm-boot.service' for details.

any ideas what it can be? following this and doesnt seem to want to start up the services. https://github.com/unifi-utilities/unifios-utilities/tree/main/on-boot-script

1cyber commented 1 year ago

Resolved all. For any users the 2.x startup is here. https://github.com/unifi-utilities/unifios-utilities/tree/main/on-boot-script-2.x

peacey commented 1 year ago

@1cyber,

You do not need to install udm-boot for split-vpn on 2.4 because you can install a systemd service file instead, which is supported natively.

If you look at the "How do I run this at boot?" instructions in the split-vpn readme, it tells you how to install the boot service on 2.4 without needing udm-boot.

slash5k1 commented 1 year ago

Hi - I found my self in a similar position this morning with my UDM (the pill shaped device) and found the instructions for the 2.4 firmware to work flawlessly.

Thank you @peacey for your amazing work!!

peacey commented 1 year ago

Closing this as completed, feel free to re-open if you have any more questions guys.