aredn/files/usr/local/bin/fw-debug

34 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
<<'LICENSE'
Part of BBHN Mesh -- Used for creating Amateur Radio friendly mesh networks
Copyright (C) 2015 Conrad Lara
See Contributors file for additional contributors
Copyright (c) 2013 David Rivenburg et al. BroadBand-HamNet
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
LICENSE
# this script displays the iptables commands that the firewall config file
# generates without running them
LAN_IP=`ifconfig eth0.0 | grep "inet addr" | cut -f2 -d: | cut -f1 -d' '`
LAN_MASK=`ifconfig eth0.0 | grep " Mask:" | cut -f4 -d:`
eval `ipcalc.sh $LAN_IP $LAN_MASK`
awk -f /usr/lib/common.awk \
-f /usr/lib/firewall.awk \
LAN_NET=$NETWORK/$PREFIX \
/etc/config/firewall