Page 1 of 1

openvpn wiki page updates

Posted: Thu Mar 09, 2023 11:35 am
by pir
The wiki page: https://dev.deluge-torrent.org/wiki/UserGuide/VPN
has some out of date scripting for FreeBSD multiple routing tables that does not work with modern openvpn in all cases.

I would suggest updating the FreeBSD multiple routing tables section with these changes:
setfib -1 /path/to/deluged -l /var/log/deluged/deluged.log -L info -i `ifconfig tun0 | awk '$1 == "inet" {print $2; exit}'`
1. Create /usr/local/etc/openvpn/link-up.sh with the following content:

#!/bin/sh
/usr/sbin/setfib -1 /sbin/route add default "$route_vpn_gateway"
# you can also restart deluged here to update the VPN IP address

2. Add the following lines to the vpn config file:

script-security 2 # allow scripts to be run
route-noexec # prevent default route being added to main routing table
up-restart # up scripts are run on restart as well
up "/usr/local/etc/openvpn/link-up.sh"

A link-down.sh script can be added in a similar way to stop the deluged service since the VPN IP address is no longer valid.

Re: openvpn wiki page updates

Posted: Mon May 22, 2023 3:52 pm
by bro
Hi

I've updated the FreeBSD section to work with FreeBSD 13. Looks good?