Last active
February 26, 2024 23:38
-
-
Save chrono-meter/0cae63611b6430c95b54ce456b7b406d to your computer and use it in GitHub Desktop.
Install SoftEther VPN Server as systemd service.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo tee /lib/systemd/system/vpnserver.service << END | |
[Unit] | |
Description=SoftEther VPN Server | |
After=network.target | |
[Service] | |
Type=forking | |
Environment="TAP=tap_vpn" | |
Environment="BR=br0" | |
ExecStartPre=ip tuntap add \$TAP mode tap | |
ExecStartPre=ip link set \$TAP up | |
ExecStartPre=ip link set dev \$TAP master \$BR | |
ExecStartPre=iptables -A FORWARD -i \$BR -o \$BR -j ACCEPT | |
ExecStart=/usr/local/vpnserver/vpnserver start | |
ExecStop=/usr/local/vpnserver/vpnserver stop | |
ExecStopPost=ip link delete \$TAP | |
ExecStopPost=iptables -D FORWARD -i \$BR -o \$BR -j ACCEPT | |
[Install] | |
WantedBy=multi-user.target | |
END | |
sudo systemctl daemon-reload | |
sudo systemctl enable vpnserver.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment