Skip to content

Instantly share code, notes, and snippets.

@amanjuman
Last active August 19, 2023 23:56
Show Gist options
  • Save amanjuman/6a40d20be7e04d9986ccca14e4a3d3b4 to your computer and use it in GitHub Desktop.
Save amanjuman/6a40d20be7e04d9986ccca14e4a3d3b4 to your computer and use it in GitHub Desktop.
SoftEther VPN for Ubuntu Server
sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y
sudo apt -y install build-essential wget curl gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev zlib1g-dev
sudo wget https://www.softether-download.com/files/softether/v4.41-9787-rtm-2023.03.14-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.41-9787-rtm-2023.03.14-linux-x64-64bit.tar.gz
tar xzf softether-vpnserver-v4.41-9787-rtm-2023.03.14-linux-x64-64bit.tar.gz && rm softether-vpnserver-v4.41-9787-rtm-2023.03.14-linux-x64-64bit.tar.gz
cd vpnserver && sudo make
cd ..
sudo mv vpnserver /usr/local && cd /usr/local/vpnserver/
sudo chmod 600 *
sudo chmod 700 vpnserver vpncmd
sudo ./vpnserver start
sudo ./vpncmd
ServerPasswordSet
sudo cat >> /lib/systemd/system/vpnserver.service << EOF
[Unit]
Description=SoftEther VPN Server
After=network.target
[Service]
Type=forking
ExecStart=/usr/local/vpnserver/vpnserver start
ExecStop=/usr/local/vpnserver/vpnserver stop
[Install]
WantedBy=multi-user.target
EOF
echo net.ipv4.ip_forward = 1 | ${SUDO} tee -a /etc/sysctl.conf
echo net.ipv6.ip_forward = 1 | ${SUDO} tee -a /etc/sysctl.conf
systemctl enable vpnserver
systemctl start vpnserver
systemctl stop vpnserver
systemctl restart vpnserver
systemctl status vpnserver
sudo ufw allow 500,4500/udp
ufw allow 443
ufw allow 1701
ufw allow 1194
ufw allow 5555
# Static Route Push
# Format:
<VPC Network>/<VPC Netmask>/<VPN Gateway IP>
# Example:
10.125.0.0/255.255.0.0/10.130.30.1
@lazaroagomez
Copy link

lazaroagomez commented Jun 10, 2021

I will try with ubuntu 20, then I leave the feedback here

Edit: Not Working

@john2151
Copy link

@cubankenshi Thats interesting. I just installed it by following this script on a 20.04 server and it worked like a charm.

Thanks @amanjuman for sharing it!

@StevenGPalacio
Copy link

It takes about 4 mb from all of us who connect, making it slower, is there a configuration for this?

@johnshirale
Copy link

How resolve DNS Leak ?
i have issue after install and Run softether vpn and connect to VPS
dnsleak test show me my isp dns and my country IP :(
any help ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment