public
Description: A rigorous set of firewall scripts for BSD ipfw, and Linux iptables
Homepage:
Clone URL: git://github.com/jwiegley/jw.firewall.git
jw.firewall / Firewall.majdhub
100755 37 lines (28 sloc) 0.551 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
 
##
# Firewall
##
 
. /etc/rc.common
 
StartService ()
{
  if [ "${FIREWALL:=-NO-}" = "-YES-" ]
  then
ConsoleMessage "Starting Firewall"
 
    sh /etc/rc.firewall --router en1,tun0@10.8.0.0/24 \
--tcp 22 --udp 1194 --trusted-tcp 80,3000,5900 \
en1@@192.168.0.0/24 en1\{1000Kbits/s,500Kbits/s\} \
en0@@192.168.2.0/24
 
    ConsoleMessage "Firewall started for Majdhub"
  fi
}
 
StopService ()
{
    ConsoleMessage "Stopping Firewall"
    /sbin/ipfw -f -q flush
}
 
RestartService ()
{
    StopService
    StartService
}
 
RunService "$1"