3 # $NetBSD: ipnat,v 1.12 2004/10/11 15:00:51 christos Exp $
7 # REQUIRE: ipfilter mountcritremote
10 $_rc_subr_loaded .
/etc
/rc.subr
14 config
="/etc/ipnat.conf"
15 start_cmd
="ipnat_start"
16 stop_cmd
="/usr/sbin/ipnat -F -C"
17 reload_cmd
="/usr/sbin/ipnat -C -f ${config}"
18 restart_cmd
="/usr/sbin/ipnat -F -C -f ${config}"
19 extra_commands
="reload"
23 if [ ! -f ${config} ]; then
26 if [ "$(/sbin/sysctl -n net.inet.ip.forwarding)" = "0" ]; then
27 logger
-s -p daemon.warning
-t ipnat \
28 "WARNING: net.inet.ip.forwarding is 0"
30 if ! checkyesno ipfilter ||
[ ! -f /etc
/ipf.conf
]; then
31 echo "Enabling ipfilter for NAT."
34 echo -n "Installing NAT rules ... "
35 /usr
/sbin
/ipnat
-F -f ${config}
39 load_rc_config_var ipfilter ipfilter