]> git.ipfire.org Git - ipfire-2.x.git/blame - src/initscripts/init.d/firewall
firewall: Add H.323 to the conntrack helpers
[ipfire-2.x.git] / src / initscripts / init.d / firewall
CommitLineData
3a1019f6
MT
1#!/bin/sh
2
0f5c5ce7
MT
3. /etc/sysconfig/rc
4. ${rc_functions}
5
3a1019f6
MT
6eval $(/usr/local/bin/readhash /var/ipfire/ppp/settings)
7eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
fe0cd647 8eval $(/usr/local/bin/readhash /var/ipfire/optionsfw/settings)
3a1019f6
MT
9IFACE=`/bin/cat /var/ipfire/red/iface 2> /dev/null | /usr/bin/tr -d '\012'`
10
11if [ -f /var/ipfire/red/device ]; then
12 DEVICE=`/bin/cat /var/ipfire/red/device 2> /dev/null | /usr/bin/tr -d '\012'`
13fi
14
c581b670
MT
15function iptables() {
16 /sbin/iptables --wait "$@"
17}
18
3a1019f6
MT
19iptables_init() {
20 # Flush all rules and delete all custom chains
c581b670
MT
21 iptables -F
22 iptables -t nat -F
23 iptables -t mangle -F
b1109b8a 24 iptables -t raw -F
c581b670
MT
25 iptables -X
26 iptables -t nat -X
27 iptables -t mangle -X
b1109b8a 28 iptables -t raw -X
3a1019f6
MT
29
30 # Set up policies
c581b670
MT
31 iptables -P INPUT DROP
32 iptables -P FORWARD DROP
33 iptables -P OUTPUT ACCEPT
3a1019f6
MT
34
35 # Empty LOG_DROP and LOG_REJECT chains
c581b670
MT
36 iptables -N LOG_DROP
37 iptables -A LOG_DROP -m limit --limit 10/minute -j LOG
38 iptables -A LOG_DROP -j DROP
39 iptables -N LOG_REJECT
40 iptables -A LOG_REJECT -m limit --limit 10/minute -j LOG
41 iptables -A LOG_REJECT -j REJECT
3a1019f6
MT
42
43 # This chain will log, then DROPs packets with certain bad combinations
44 # of flags might indicate a port-scan attempt (xmas, null, etc)
c581b670 45 iptables -N PSCAN
5595bc03 46 if [ "$DROPPORTSCAN" == "on" ]; then
c581b670
MT
47 iptables -A PSCAN -p tcp -m limit --limit 10/minute -j LOG --log-prefix "DROP_TCP Scan " -m comment --comment "DROP_TCP PScan"
48 iptables -A PSCAN -p udp -m limit --limit 10/minute -j LOG --log-prefix "DROP_UDP Scan " -m comment --comment "DROP_UDP PScan"
49 iptables -A PSCAN -p icmp -m limit --limit 10/minute -j LOG --log-prefix "DROP_ICMP Scan " -m comment --comment "DROP_ICMP PScan"
50 iptables -A PSCAN -f -m limit --limit 10/minute -j LOG --log-prefix "DROP_FRAG Scan " -m comment --comment "DROP_FRAG PScan"
5595bc03 51 fi
c581b670 52 iptables -A PSCAN -j DROP -m comment --comment "DROP_PScan"
3a1019f6
MT
53
54 # New tcp packets without SYN set - could well be an obscure type of port scan
55 # that's not covered above, may just be a broken windows machine
c581b670 56 iptables -N NEWNOTSYN
5595bc03 57 if [ "$DROPNEWNOTSYN" == "on" ]; then
c581b670 58 iptables -A NEWNOTSYN -m limit --limit 10/minute -j LOG --log-prefix "DROP_NEWNOTSYN "
5595bc03 59 fi
c581b670 60 iptables -A NEWNOTSYN -j DROP -m comment --comment "DROP_NEWNOTSYN"
3a1019f6
MT
61
62 # Chain to contain all the rules relating to bad TCP flags
c581b670 63 iptables -N BADTCP
3a1019f6 64
c581b670
MT
65 # Don't check loopback
66 iptables -A BADTCP -i lo -j RETURN
d8158ca6 67
3a1019f6 68 # Disallow packets frequently used by port-scanners
dccbf1bf
AF
69 # NMAP FIN/URG/PSH (XMAS scan)
70 iptables -A BADTCP -p tcp --tcp-flags ALL FIN,URG,PSH -j PSCAN
71 # SYN/RST/ACK/FIN/URG
72 iptables -A BADTCP -p tcp --tcp-flags ALL SYN,RST,ACK,FIN,URG -j PSCAN
73 # ALL/ALL
74 iptables -A BADTCP -p tcp --tcp-flags ALL ALL -j PSCAN
75 # FIN Stealth
c581b670 76 iptables -A BADTCP -p tcp --tcp-flags ALL FIN -j PSCAN
3a1019f6 77 # SYN/RST (also catches xmas variants that set SYN+RST+...)
c581b670 78 iptables -A BADTCP -p tcp --tcp-flags SYN,RST SYN,RST -j PSCAN
3a1019f6 79 # SYN/FIN (QueSO or nmap OS probe)
c581b670 80 iptables -A BADTCP -p tcp --tcp-flags SYN,FIN SYN,FIN -j PSCAN
dccbf1bf
AF
81 # Null
82 iptables -A BADTCP -p tcp --tcp-flags ALL NONE -j PSCAN
3a1019f6 83 # NEW TCP without SYN
c581b670 84 iptables -A BADTCP -p tcp ! --syn -m conntrack --ctstate NEW -j NEWNOTSYN
b85d2a98 85
c581b670
MT
86 iptables -A INPUT -p tcp -j BADTCP
87 iptables -A FORWARD -p tcp -j BADTCP
c0359d6d 88
b1109b8a 89 # Connection tracking chains
c581b670 90 iptables -N CONNTRACK
b1109b8a 91 iptables -A CONNTRACK -m conntrack --ctstate ESTABLISHED -j ACCEPT
dccbf1bf 92 iptables -A CONNTRACK -m conntrack --ctstate INVALID -j DROP
0f535060 93 iptables -A CONNTRACK -p icmp -m conntrack --ctstate RELATED -j ACCEPT
b1109b8a
MT
94 iptables -t raw -N CONNTRACK
95 iptables -t raw -A PREROUTING -j CONNTRACK
96
97 # Conntrack helpers (https://home.regit.org/netfilter-en/secure-use-of-helpers/)
98
99 # SIP
d57c6162
MT
100 if [ "${CONNTRACK_SIP}" = "on" ]; then
101 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
102 -m helper --helper sip -j ACCEPT
103 for proto in udp tcp; do
104 iptables -t raw -A CONNTRACK -p "${proto}" --dport 5060 -j CT --helper sip
105 done
106 fi
b1109b8a 107
c8f8bf32
MT
108 # H.323
109 if [ "${CONNTRACK_H323}" = "on" ]; then
110 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
111 -m helper --helper h323 -j ACCEPT
112
113 # Gatekeeper RAS
114 iptables -t raw -A CONNTRACK -p udp --dport 1719 -j CT --helper h323
115
116 # Q.931
117 iptables -t raw -A CONNTRACK -p tcp --dport 1720 -j CT --helper h323
118 fi
119
b1109b8a 120 # FTP
d57c6162
MT
121 if [ "${CONNTRACK_FTP}" = "on" ]; then
122 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
123 -m helper --helper ftp -p tcp --dport 1024: -j ACCEPT
124 iptables -t raw -A CONNTRACK -p tcp --dport 21 -j CT --helper ftp
125 fi
b1109b8a
MT
126
127 # PPTP
d57c6162
MT
128 if [ "${CONNTRACK_PPTP}" = "on" ]; then
129 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
130 -m helper --helper pptp -j ACCEPT
131 iptables -t raw -A CONNTRACK -p udp --dport 1723 -j CT --helper pptp
132 fi
b1109b8a
MT
133
134 # TFTP
d57c6162
MT
135 if [ "${CONNTRACK_TFTP}" = "on" ]; then
136 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
137 -m helper --helper tftp -j ACCEPT
138 iptables -t raw -A CONNTRACK -p udp --dport 69 -j CT --helper tftp
139 fi
3a1019f6 140
50354ffe
MT
141 # IRC
142 if [ "${CONNTRACK_IRC}" = "on" ]; then
143 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
144 -m helper --helper irc -j ACCEPT
145 iptables -t raw -A CONNTRACK -p tcp --dport 6667 -j CT --helper irc
146 fi
147
a93bf696
MT
148 # Amanda
149 if [ "${CONNTRACK_AMANDA}" = "on" ]; then
150 iptables -A CONNTRACK -m conntrack --ctstate RELATED \
151 -m helper --helper amanda -j ACCEPT
152 iptables -t raw -A CONNTRACK -j CT --helper amanda
153 fi
154
3a1019f6 155 # Fix for braindead ISP's
c581b670 156 iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu
3a1019f6
MT
157
158 # CUSTOM chains, can be used by the users themselves
c581b670
MT
159 iptables -N CUSTOMINPUT
160 iptables -A INPUT -j CUSTOMINPUT
161 iptables -N CUSTOMFORWARD
162 iptables -A FORWARD -j CUSTOMFORWARD
163 iptables -N CUSTOMOUTPUT
164 iptables -A OUTPUT -j CUSTOMOUTPUT
165 iptables -t nat -N CUSTOMPREROUTING
166 iptables -t nat -A PREROUTING -j CUSTOMPREROUTING
167 iptables -t nat -N CUSTOMPOSTROUTING
168 iptables -t nat -A POSTROUTING -j CUSTOMPOSTROUTING
3a1019f6 169
2a5b19c5
AF
170 # P2PBLOCK
171 iptables -N P2PBLOCK
172 iptables -A INPUT -j P2PBLOCK
173 iptables -A FORWARD -j P2PBLOCK
174 iptables -A OUTPUT -j P2PBLOCK
175
815eaff4 176 # Guardian (IPS) chains
c581b670
MT
177 iptables -N GUARDIAN
178 iptables -A INPUT -j GUARDIAN
179 iptables -A FORWARD -j GUARDIAN
815eaff4 180
1e555330 181 # Block OpenVPN transfer networks
c581b670 182 iptables -N OVPNBLOCK
a0a5c14f 183 iptables -A INPUT -i tun+ -j OVPNBLOCK
a0a5c14f
MT
184 iptables -A FORWARD -i tun+ -j OVPNBLOCK
185 iptables -A FORWARD -o tun+ -j OVPNBLOCK
1e555330 186
51ab1de1 187 # OpenVPN transfer network translation
c581b670
MT
188 iptables -t nat -N OVPNNAT
189 iptables -t nat -A POSTROUTING -j OVPNNAT
51ab1de1 190
daa1ceba 191 # IPTV chains for IGMPPROXY
c581b670
MT
192 iptables -N IPTVINPUT
193 iptables -A INPUT -j IPTVINPUT
194 iptables -N IPTVFORWARD
195 iptables -A FORWARD -j IPTVFORWARD
daa1ceba 196
8e59a602
MT
197 # Allow to ping the firewall.
198 iptables -N ICMPINPUT
199 iptables -A INPUT -j ICMPINPUT
200 iptables -A ICMPINPUT -p icmp --icmp-type 8 -j ACCEPT
3a1019f6 201
afc611d4 202 # Accept everything on loopback
c581b670
MT
203 iptables -N LOOPBACK
204 iptables -A LOOPBACK -i lo -j ACCEPT
205 iptables -A LOOPBACK -o lo -j ACCEPT
afc611d4 206
3b9a23ce 207 # Filter all packets with loopback addresses on non-loopback interfaces.
c581b670
MT
208 iptables -A LOOPBACK -s 127.0.0.0/8 -j DROP
209 iptables -A LOOPBACK -d 127.0.0.0/8 -j DROP
3b9a23ce
MT
210
211 for i in INPUT FORWARD OUTPUT; do
c581b670 212 iptables -A ${i} -j LOOPBACK
3b9a23ce 213 done
afc611d4 214
3a1019f6 215 # Accept everything connected
b85d2a98 216 for i in INPUT FORWARD OUTPUT; do
c581b670 217 iptables -A ${i} -j CONNTRACK
b85d2a98
MT
218 done
219
8490e496
MT
220 # Allow DHCP
221 iptables -N DHCPINPUT
222 iptables -A DHCPINPUT -p udp --sport 68 --dport 67 -j ACCEPT
223 iptables -A DHCPINPUT -p tcp --sport 68 --dport 67 -j ACCEPT
224
225 iptables -N DHCPOUTPUT
226 iptables -A DHCPOUTPUT -p udp --sport 67 --dport 68 -j ACCEPT
227 iptables -A DHCPOUTPUT -p tcp --sport 67 --dport 68 -j ACCEPT
228
229 # Allow DHCP on GREEN
230 iptables -N DHCPGREENINPUT
231 iptables -N DHCPGREENOUTPUT
232 if [ -n "${GREEN_DEV}" ]; then
233 iptables -A INPUT -i "${GREEN_DEV}" -j DHCPGREENINPUT
234 iptables -A OUTPUT -o "${GREEN_DEV}" -j DHCPGREENOUTPUT
235 fi
236
237 # allow DHCP on BLUE to be turned on/off
238 iptables -N DHCPBLUEINPUT
239 iptables -N DHCPBLUEOUTPUT
240 if [ -n "${BLUE_DEV}" ]; then
241 iptables -A INPUT -i "${BLUE_DEV}" -j DHCPBLUEINPUT
242 iptables -A OUTPUT -o "${BLUE_DEV}" -j DHCPBLUEOUTPUT
243 fi
244
cab02e2a
SS
245 # GeoIP block
246 iptables -N GEOIPBLOCK
247 iptables -A INPUT -j GEOIPBLOCK
248 iptables -A FORWARD -j GEOIPBLOCK
249
5fd30232 250 # trafic from ipsecX/TUN/TAP interfaces, before "-i GREEN_DEV" accept everything
c581b670
MT
251 iptables -N IPSECINPUT
252 iptables -N IPSECFORWARD
253 iptables -N IPSECOUTPUT
254 iptables -A INPUT -j IPSECINPUT
255 iptables -A FORWARD -j IPSECFORWARD
256 iptables -A OUTPUT -j IPSECOUTPUT
257 iptables -t nat -N IPSECNAT
258 iptables -t nat -A POSTROUTING -j IPSECNAT
b68e5c14 259
3a1019f6 260 # localhost and ethernet.
c0e0848f
MT
261 # Always allow accessing the web GUI from GREEN.
262 iptables -N GUIINPUT
263 iptables -A INPUT -j GUIINPUT
264 iptables -A GUIINPUT -i "${GREEN_DEV}" -p tcp --dport 444 -j ACCEPT
8490e496 265
81393987 266 # WIRELESS chains
c581b670
MT
267 iptables -N WIRELESSINPUT
268 iptables -A INPUT -m conntrack --ctstate NEW -j WIRELESSINPUT
269 iptables -N WIRELESSFORWARD
270 iptables -A FORWARD -m conntrack --ctstate NEW -j WIRELESSFORWARD
987b75bc 271
ab4876ad 272 # OpenVPN
c581b670
MT
273 iptables -N OVPNINPUT
274 iptables -A INPUT -j OVPNINPUT
ab4876ad 275
987b75bc 276 # TOR
c581b670
MT
277 iptables -N TOR_INPUT
278 iptables -A INPUT -j TOR_INPUT
12dcfbbd 279
d5f1422d 280 # Jump into the actual firewall ruleset.
c581b670
MT
281 iptables -N INPUTFW
282 iptables -A INPUT -j INPUTFW
d5f1422d 283
c581b670
MT
284 iptables -N OUTGOINGFW
285 iptables -A OUTPUT -j OUTGOINGFW
d5f1422d 286
c581b670
MT
287 iptables -N FORWARDFW
288 iptables -A FORWARD -j FORWARDFW
d5f1422d 289
fac38614 290 # SNAT rules
c581b670
MT
291 iptables -t nat -N NAT_SOURCE
292 iptables -t nat -A POSTROUTING -j NAT_SOURCE
fac38614 293
bb12dd7b 294 # Custom prerouting chains (for transparent proxy)
c581b670
MT
295 iptables -t nat -N SQUID
296 iptables -t nat -A PREROUTING -j SQUID
bb12dd7b
MT
297
298 # DNAT rules
c581b670
MT
299 iptables -t nat -N NAT_DESTINATION
300 iptables -t nat -A PREROUTING -j NAT_DESTINATION
99f11a16 301 iptables -t nat -A OUTPUT -j NAT_DESTINATION
bb12dd7b 302
6e87f0aa
MT
303 iptables -t mangle -N NAT_DESTINATION
304 iptables -t mangle -A PREROUTING -j NAT_DESTINATION
305
306 iptables -t nat -N NAT_DESTINATION_FIX
307 iptables -t nat -A POSTROUTING -j NAT_DESTINATION_FIX
308
309 iptables -t nat -A NAT_DESTINATION_FIX \
310 -m mark --mark 1 -j SNAT --to-source "${GREEN_ADDRESS}"
311
312 if [ -n "${BLUE_ADDRESS}" ]; then
313 iptables -t nat -A NAT_DESTINATION_FIX \
314 -m mark --mark 2 -j SNAT --to-source "${BLUE_ADDRESS}"
315 fi
316
317 if [ -n "${ORANGE_ADDRESS}" ]; then
318 iptables -t nat -A NAT_DESTINATION_FIX \
319 -m mark --mark 3 -j SNAT --to-source "${ORANGE_ADDRESS}"
320 fi
321
7e7495b3 322 # upnp chain for our upnp daemon
c581b670
MT
323 iptables -t nat -N UPNPFW
324 iptables -t nat -A PREROUTING -j UPNPFW
325 iptables -N UPNPFW
326 iptables -A FORWARD -m conntrack --ctstate NEW -j UPNPFW
3a1019f6 327
6e87f0aa
MT
328 # RED chain, used for the red interface
329 iptables -N REDINPUT
330 iptables -A INPUT -j REDINPUT
331 iptables -N REDFORWARD
332 iptables -A FORWARD -j REDFORWARD
333 iptables -t nat -N REDNAT
334 iptables -t nat -A POSTROUTING -j REDNAT
335
ab4876ad
MT
336 # Apply OpenVPN firewall rules
337 /usr/local/bin/openvpnctrl --firewall-rules
ff4770c7
AM
338
339 # run wirelessctrl
340 /usr/local/bin/wirelessctrl
341
c581b670
MT
342 # POLICY CHAIN
343 iptables -N POLICYIN
344 iptables -A INPUT -j POLICYIN
345 iptables -N POLICYFWD
346 iptables -A FORWARD -j POLICYFWD
347 iptables -N POLICYOUT
348 iptables -A OUTPUT -j POLICYOUT
b324de14 349
bb383423 350 # Initialize firewall policies.
5d7faa45 351 /usr/sbin/firewall-policy
690b0bd7 352
bb383423 353 # Install firewall rules for the red interface.
4b12aa41
TE
354 iptables_red_up
355
356 # If red has not been brought up yet, we will
357 # add the blocking rules for MASQUERADE
358 if [ ! -e "/var/ipfire/red/active" ]; then
359 iptables_red_down
360 fi
ff4770c7 361}
3a1019f6 362
4b12aa41 363iptables_red_up() {
c581b670
MT
364 iptables -F REDINPUT
365 iptables -F REDFORWARD
366 iptables -t nat -F REDNAT
3a1019f6 367
ff4770c7
AM
368 # PPPoE / PPTP Device
369 if [ "$IFACE" != "" ]; then
370 # PPPoE / PPTP
371 if [ "$DEVICE" != "" ]; then
c581b670 372 iptables -A REDINPUT -i $DEVICE -j ACCEPT
ff4770c7
AM
373 fi
374 if [ "$RED_TYPE" == "PPTP" -o "$RED_TYPE" == "PPPOE" ]; then
375 if [ "$RED_DEV" != "" ]; then
c581b670 376 iptables -A REDINPUT -i $RED_DEV -j ACCEPT
ff4770c7
AM
377 fi
378 fi
3a1019f6 379 fi
ff4770c7
AM
380
381 # PPTP over DHCP
382 if [ "$DEVICE" != "" -a "$TYPE" == "PPTP" -a "$METHOD" == "DHCP" ]; then
c581b670
MT
383 iptables -A REDINPUT -p tcp --source-port 67 --destination-port 68 -i $DEVICE -j ACCEPT
384 iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i $DEVICE -j ACCEPT
3a1019f6
MT
385 fi
386
ff4770c7
AM
387 # Orange pinholes
388 if [ "$ORANGE_DEV" != "" ]; then
389 # This rule enables a host on ORANGE network to connect to the outside
390 # (only if we have a red connection)
391 if [ "$IFACE" != "" ]; then
c581b670 392 iptables -A REDFORWARD -i $ORANGE_DEV -o $IFACE -j ACCEPT
ff4770c7 393 fi
3a1019f6 394 fi
c400fe4c 395
ff4770c7
AM
396 if [ "$IFACE" != "" -a -f /var/ipfire/red/active ]; then
397 # DHCP
398 if [ "$RED_DEV" != "" -a "$RED_TYPE" == "DHCP" ]; then
c581b670
MT
399 iptables -A REDINPUT -p tcp --source-port 67 --destination-port 68 -i $IFACE -j ACCEPT
400 iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i $IFACE -j ACCEPT
ff4770c7
AM
401 fi
402 if [ "$METHOD" == "DHCP" -a "$PROTOCOL" == "RFC1483" ]; then
c581b670
MT
403 iptables -A REDINPUT -p tcp --source-port 67 --destination-port 68 -i $IFACE -j ACCEPT
404 iptables -A REDINPUT -p udp --source-port 67 --destination-port 68 -i $IFACE -j ACCEPT
ff4770c7
AM
405 fi
406
407 # Outgoing masquerading (don't masqerade IPSEC (mark 50))
c581b670 408 iptables -t nat -A REDNAT -m mark --mark 50 -o $IFACE -j RETURN
c926c637 409
83ef9c40
MT
410 if [ "$IFACE" = "$GREEN_DEV" ]; then
411 MASQUERADE_GREEN="off"
c926c637 412 fi
c400fe4c 413
983d471f 414 local NO_MASQ_NETWORKS
83ef9c40
MT
415
416 if [ "${MASQUERADE_GREEN}" = "off" ]; then
983d471f 417 NO_MASQ_NETWORKS="${NO_MASQ_NETWORKS} ${GREEN_NETADDRESS}/${GREEN_NETMASK}"
83ef9c40
MT
418 fi
419
420 if [ "${MASQUERADE_BLUE}" = "off" ]; then
983d471f 421 NO_MASQ_NETWORKS="${NO_MASQ_NETWORKS} ${BLUE_NETADDRESS}/${BLUE_NETMASK}"
83ef9c40
MT
422 fi
423
424 if [ "${MASQUERADE_ORANGE}" = "off" ]; then
983d471f 425 NO_MASQ_NETWORKS="${NO_MASQ_NETWORKS} ${ORANGE_NETADDRESS}/${ORANGE_NETMASK}"
83ef9c40
MT
426 fi
427
983d471f
MT
428 local network
429 for network in ${NO_MASQ_NETWORKS}; do
430 iptables -t nat -A REDNAT -s "${network}" -o "${IFACE}" -j RETURN
83ef9c40
MT
431 done
432
433 # Masquerade everything else
434 iptables -t nat -A REDNAT -o $IFACE -j MASQUERADE
6be0579b 435 fi
66f6b279
MT
436
437 # Reload all rules.
55a5bcae 438 /usr/local/bin/firewallctrl
ff4770c7
AM
439}
440
4b12aa41
TE
441iptables_red_down() {
442 # Prohibit packets to reach the masquerading rule
443 # while the wan interface is down - this is required to
444 # circumvent udp related NAT issues
445 # http://forum.ipfire.org/index.php?topic=11127.0
e7204c2d
MT
446 if [ -n "${IFACE}" ]; then
447 iptables -F REDFORWARD
448 iptables -A REDFORWARD -o "${IFACE}" -j DROP
449 fi
4b12aa41
TE
450
451 # Reload all rules.
452 /usr/local/bin/firewallctrl
453}
454
ff4770c7
AM
455# See how we were called.
456case "$1" in
457 start)
7d7740a4 458 boot_mesg "Setting up firewall"
ff4770c7 459 iptables_init
7d7740a4 460 evaluate_retval
6be0579b 461 ;;
4b12aa41 462 reload|up)
7d7740a4 463 boot_mesg "Reloading firewall"
4b12aa41 464 iptables_red_up
7d7740a4 465 evaluate_retval
3a1019f6 466 ;;
4b12aa41
TE
467 down)
468 boot_mesg "Disabling firewall access to RED"
469 iptables_red_down
470 evaluate_retval
471 ;;
3a1019f6 472 restart)
3a1019f6
MT
473 $0 start
474 ;;
475 *)
ff4770c7 476 echo "Usage: $0 {start|reload|restart}"
3a1019f6
MT
477 exit 1
478 ;;
479esac
480
481exit 0