Deleted Added
full compact
ipfw (195026) ipfw (200028)
1#!/bin/sh
2#
1#!/bin/sh
2#
3# $FreeBSD: head/etc/rc.d/ipfw 195026 2009-06-26 01:04:50Z dougb $
3# $FreeBSD: head/etc/rc.d/ipfw 200028 2009-12-02 15:05:26Z ume $
4#
5
6# PROVIDE: ipfw
7# REQUIRE: ppp
8# KEYWORD: nojail
9
10. /etc/rc.subr
11. /etc/network.subr
12
13name="ipfw"
14rcvar="firewall_enable"
15start_cmd="ipfw_start"
16start_precmd="ipfw_prestart"
17stop_cmd="ipfw_stop"
18required_modules="ipfw"
19
4#
5
6# PROVIDE: ipfw
7# REQUIRE: ppp
8# KEYWORD: nojail
9
10. /etc/rc.subr
11. /etc/network.subr
12
13name="ipfw"
14rcvar="firewall_enable"
15start_cmd="ipfw_start"
16start_precmd="ipfw_prestart"
17stop_cmd="ipfw_stop"
18required_modules="ipfw"
19
20set_rcvar_obsolete ipv6_firewall_enable
21
20ipfw_prestart()
21{
22 if checkyesno dummynet_enable; then
23 required_modules="$required_modules dummynet"
24 fi
25
26 if checkyesno firewall_nat_enable; then
27 if ! checkyesno natd_enable; then

--- 28 unchanged lines hidden (view full) ---

56 if checkyesno firewall_logging; then
57 echo 'Firewall logging enabled.'
58 sysctl net.inet.ip.fw.verbose=1 >/dev/null
59 fi
60
61 # Enable the firewall
62 #
63 if ! ${SYSCTL_W} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then
22ipfw_prestart()
23{
24 if checkyesno dummynet_enable; then
25 required_modules="$required_modules dummynet"
26 fi
27
28 if checkyesno firewall_nat_enable; then
29 if ! checkyesno natd_enable; then

--- 28 unchanged lines hidden (view full) ---

58 if checkyesno firewall_logging; then
59 echo 'Firewall logging enabled.'
60 sysctl net.inet.ip.fw.verbose=1 >/dev/null
61 fi
62
63 # Enable the firewall
64 #
65 if ! ${SYSCTL_W} net.inet.ip.fw.enable=1 1>/dev/null 2>&1; then
64 warn "failed to enable firewall"
66 warn "failed to enable IPv4 firewall"
65 fi
67 fi
68 if afexists inet6; then
69 if ! ${SYSCTL_W} net.inet6.ip6.fw.enable=1 1>/dev/null 2>&1
70 then
71 warn "failed to enable IPv6 firewall"
72 fi
73 fi
66}
67
68ipfw_stop()
69{
70 # Disable the firewall
71 #
72 ${SYSCTL_W} net.inet.ip.fw.enable=0
74}
75
76ipfw_stop()
77{
78 # Disable the firewall
79 #
80 ${SYSCTL_W} net.inet.ip.fw.enable=0
81 if afexists inet6; then
82 ${SYSCTL_W} net.inet6.ip6.fw.enable=0
83 fi
73 if [ -f /etc/rc.d/natd ] ; then
74 /etc/rc.d/natd quietstop
75 fi
76}
77
78load_rc_config $name
79run_rc_command $*
84 if [ -f /etc/rc.d/natd ] ; then
85 /etc/rc.d/natd quietstop
86 fi
87}
88
89load_rc_config $name
90run_rc_command $*