Openvpn lan to lan
Server Seite
Script
<syntaxhighlight lang="bash">
- !/bin/bash
BR=vmbr0 INT=ens30 TAP=tap1 IP="10.86.0.1 netmask 255.255.0.0" case $1 in start) openvpn --mktun --dev $TAP brctl addbr $BR brctl addif $BR $INT brctl addif $BR $TAP ifconfig $INT 0.0.0.0 promisc up ifconfig $TAP 0.0.0.0 promisc up ifconfig $BR $IP up
stop) ifconfig $BR $IP down ifconfig $TAP 0.0.0.0 promisc down ifconfig $INT 0.0.0.0 promisc down brctl delif $BR $TAP brctl delif $BR $INT brctl delbr $BR openvpn --rmtun --dev $TAP
esac <syntaxhighlight>