diff --git a/libexec/rc/rc.conf b/libexec/rc/rc.conf index a4745c1faf52..7c118dfb48f0 100644 --- a/libexec/rc/rc.conf +++ b/libexec/rc/rc.conf @@ -196,6 +196,10 @@ ipfilter_program="/sbin/ipf" # where the ipfilter program lives ipfilter_rules="/etc/ipf.rules" # rules definition file for ipfilter, see # /usr/src/contrib/ipfilter/rules for examples ipfilter_flags="" # additional flags for ipfilter +ippool_enable="NO" # Set to YES to enable ip filter pools +ippool_program="/sbin/ippool" # where the ippool program lives +ippool_rules="/etc/ippool.tables" # rules definition file for ippool +ippool_flags="" # additional flags for ippool ipnat_enable="NO" # Set to YES to enable ipnat functionality ipnat_program="/sbin/ipnat" # where the ipnat program lives ipnat_rules="/etc/ipnat.rules" # rules definition file for ipnat diff --git a/libexec/rc/rc.d/ippool b/libexec/rc/rc.d/ippool new file mode 100755 index 000000000000..7cf7859d3545 --- /dev/null +++ b/libexec/rc/rc.d/ippool @@ -0,0 +1,40 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: ippool +# REQUIRE: FILESYSTEMS +# BEFORE: ipfilter +# KEYWORD: nojail + +. /etc/rc.subr + +name="ippool" +desc="user interface to the IPFilter pools" +rcvar="ippool_enable" +load_rc_config $name +start_cmd="ippool_start" +stop_cmd="${ippool_program} -F" +reload_cmd="ippool_reload" +extra_commands="reload" +required_files="${ippool_rules}" +required_modules="ipl:ipfilter" + +ippool_start() +{ + if [ -r "${ippool_rules}" ]; then + echo "Loading IP Pools." + ${ippool_program} -f ${ippool_rules} ${ippool_flags} + fi +} + +ippool_reload() +{ + echo "Reloading IP Pools." + ${ippool_program} -F + ippool_start +} + + +run_rc_command "$1"