Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Raspberry Pi Jessie Softether configuration
nc -z -w30 53 # > /dev/null 2>&1
if [ $online -ne 0 ]; then
echo "$(date) - No internet connection, restarting"
systemctl stop vpn.service
sleep 20
systemctl start vpn.service
echo "$(date) - Vpn service restarted!"
# add following line to cron with crontab -e
# */5 * * * * /home/pi/ >> /var/log/internet-checker.log 2>&1
interface eth0
static ip_address=
static routers=
static domain_name_servers=
interface br0
static ip_address=
static routers=
static domain_name_servers=
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel
# Inform the DHCP server of our hostname for DDNS.
# Use the hardware address of the interface for the Client ID.
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Persist interface configuration when dhcpcd exits.
# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by default.
#option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
nohook lookup-hostname
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet manual
#auto br0
iface br0 inet manual
bridge_ports eth0
bridge_stp off
bridge_waitport 0
bridge_maxwait 0
bridge_fd 0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
allow-hotplug wlan1
iface wlan1 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
echo "Switching from eth0 to br0"
# set up bridge
ip link add br0 type bridge
ip link set eth0 master br0
# flush eth0 configuration
ip addr flush dev eth0
ip link set dev br0 up
./vpnserver/vpnserver start
while [ -z "`ifconfig | grep tap_soft`" ]
echo "Wait for vpn adapter"
sleep 2
echo "Found VPN adapter, attaching to bridge."
ip link set dev tap_soft master br0
#Location /etc/systemd/system/
Description=SoftEther VPN Server daemon
ExecStop=/home/pi/vpnserver/vpnserver stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.