#!/bin/bash br="br0" tap="tap0" tap1="tap1" eth="ens4" br_ip="10.3.5.10" br_netmask="255.255.0.0" br_broadcast="10.3.255.255" # Create the tap adapter openvpn --mktun --dev $tap openvpn --mktun --dev $tap1 # Create the bridge and add interfaces brctl addbr $br brctl addif $br $eth brctl addif $br $tap brctl addif $br $tap1 # Configure the bridge ifconfig $tap 0.0.0.0 promisc up ifconfig $tap1 0.0.0.0 promisc up ifconfig $eth 0.0.0.0 promisc up ifconfig $br $br_ip netmask $br_netmask broadcast $br_broadcast