Line 1... |
Line 1... |
1 |
#!/bin/bash
|
1 |
#!/bin/bash
|
2 |
# $Id: alcasar-iptables-bypass.sh 3100 2022-12-29 14:45:06Z rexy $
|
2 |
# $Id: alcasar-iptables-bypass.sh 3190 2024-04-07 22:35:03Z rexy $
|
3 |
|
3 |
|
4 |
# alcasar-iptables-bypass.sh
|
4 |
# alcasar-iptables-bypass.sh
|
5 |
# by Rexy - 3abtux
|
5 |
# by Rexy - 3abtux
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
6 |
# This script is distributed under the Gnu General Public License (GPL)
|
7 |
|
7 |
|
Line 21... |
Line 21... |
21 |
PRIVATE_IP=`echo $private_ip_mask | cut -d"/" -f1` # ALCASAR LAN IP address
|
21 |
PRIVATE_IP=`echo $private_ip_mask | cut -d"/" -f1` # ALCASAR LAN IP address
|
22 |
public_ip_mask=`grep ^PUBLIC_IP= $CONF_FILE|cut -d"=" -f2` # ALCASAR WAN IP address
|
22 |
public_ip_mask=`grep ^PUBLIC_IP= $CONF_FILE|cut -d"=" -f2` # ALCASAR WAN IP address
|
23 |
if [[ "$public_ip_mask" == "dhcp" ]]
|
23 |
if [[ "$public_ip_mask" == "dhcp" ]]
|
24 |
then
|
24 |
then
|
25 |
PTN="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/([012]?[0-9]|3[0-2])\b"
|
25 |
PTN="\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/([012]?[0-9]|3[0-2])\b"
|
26 |
public_ip_mask=`ip addr show $EXTIF | egrep -o $PTN`
|
26 |
public_ip_mask=`ip addr show $EXTIF | grep -o -E $PTN`
|
27 |
fi
|
27 |
fi
|
28 |
PUBLIC_IP=`echo $public_ip_mask | cut -d"/" -f1`
|
28 |
PUBLIC_IP=`echo $public_ip_mask | cut -d"/" -f1`
|
29 |
SSH_LAN=`grep ^SSH_LAN= $CONF_FILE|cut -d"=" -f2` # SSH LAN port
|
29 |
SSH_LAN=`grep ^SSH_LAN= $CONF_FILE|cut -d"=" -f2` # SSH LAN port
|
30 |
SSH_LAN=${SSH_LAN:=0}
|
30 |
SSH_LAN=${SSH_LAN:=0}
|
31 |
SSH_WAN=`grep ^SSH_WAN= $CONF_FILE|cut -d"=" -f2` # SSH WAN port
|
31 |
SSH_WAN=`grep ^SSH_WAN= $CONF_FILE|cut -d"=" -f2` # SSH WAN port
|