Created
March 1, 2022 05:50
-
-
Save i40sys/af900b8f5263f75ff3d1be4819792ac4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
PATH="/bin:/sbin:/usr/bin:/usr/sbin" | |
export PATH | |
LOCAL_IF="eth0" | |
VPN_IF="ztc25el5hr" | |
BR_IP="10.46.1.27/24" | |
BR_NET="10.46.1.0/24" | |
date | |
# esperem fins que la interficie existeixi | |
while [ ! -e "/sys/class/net/$VPN_IF" ]; | |
do | |
sleep 2; | |
done | |
# bridge | |
#brctl addbr br0 | |
#brctl addif br0 $LOCAL_IF | |
brctl addif br0 $VPN_IF | |
brctl setfd br0 0 | |
#brctl setmaxage br0 0 | |
# ip | |
#ifconfig $LOCAL_IF 0.0.0.0 | |
#ifconfig $VPN_IF 0.0.0.0 | |
#ifconfig br0 $BR_IP | |
#ifconfig $LOCAL_IF up | |
#ifconfig $VPN_IF up | |
#ifconfig br0 up | |
# route | |
#ip route add $BR_NET dev br0 | |
# iptables | |
iptables -I FORWARD -i $VPN_IF -j ACCEPT | |
iptables -I FORWARD -o $VPN_IF -j ACCEPT | |
iptables -I FORWARD -i br0 -j ACCEPT | |
iptables -I FORWARD -o br0 -j ACCEPT | |
iptables -I FORWARD -i $LOCAL_IF -j ACCEPT | |
iptables -I FORWARD -o $LOCAL_IF -j ACCEPT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment