rych-openvpn/scripts/bridge-start.sh

23 lines
517 B
Bash
Executable File

#!/bin/bash
br="br0"
tap="tap0"
tap1="tap1"
eth="enp0s10f0"
br_ip="10.3.5.1"
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