Subversion Repositories ALCASAR

Rev

Rev 766 | Rev 958 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 766 Rev 767
Line 1... Line 1...
1
#!/bin/bash
1
#!/bin/bash
2
# $Id: alcasar-iptables-bypass.sh 766 2011-11-10 22:29:41Z richard $
2
# $Id: alcasar-iptables-bypass.sh 767 2011-11-11 08:00:07Z richard $
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
 
8
# applique les regles du parefeu en mode ByPass
8
# applique les regles du parefeu en mode ByPass
9
# put the firewall rules in 'ByPass' mode
9
# put the firewall rules in 'ByPass' mode
10
 
10
 
-
 
11
conf_file="/usr/local/etc/alcasar.conf"
11
private_ip_mask=`grep PRIVATE_IP /usr/local/etc/alcasar.conf|cut -d"=" -f2`
12
private_ip_mask=`grep PRIVATE_IP= $conf_file|cut -d"=" -f2`
-
 
13
private_ip_mask=${private_ip_mask:=192.168.182.1/24}
12
private_network=`/bin/ipcalc -n $private_ip_mask|cut -d"=" -f2`		# LAN IP address (ie.: 192.168.182.0)
14
private_network=`/bin/ipcalc -n $private_ip_mask|cut -d"=" -f2`		# LAN IP address (ie.: 192.168.182.0)
13
private_prefix=`/bin/ipcalc -p $private_ip_mask|cut -d"=" -f2`		# LAN prefix (ie. 24)
15
private_prefix=`/bin/ipcalc -p $private_ip_mask|cut -d"=" -f2`		# LAN prefix (ie. 24)
14
 
-
 
15
IPTABLES="/sbin/iptables"
16
IPTABLES="/sbin/iptables"
16
EXTIF="eth0"
17
EXTIF="eth0"
17
INTIF="eth1"
18
INTIF="eth1"
18
PRIVATE_NETWORK_MASK=$private_network/$private_prefix			# Lan IP address + prefix (192.168.182.0/24)
19
PRIVATE_NETWORK_MASK=$private_network/$private_prefix			# Lan IP address + prefix (192.168.182.0/24)
19
PRIVATE_IP=`echo $private_ip_mask | cut -d"/" -f1`			# ALCASAR LAN IP address
20
PRIVATE_IP=`echo $private_ip_mask | cut -d"/" -f1`			# ALCASAR LAN IP address