/etc/rc.d/myipfw -- in Jail
/etc/ipfw.rules -- in Jail
/etc/rc.conf -- in Jail
I am using a similar script to the jail's /etc/rc.d/myipfwin the host's /etc/rc.d to start multiple VIMAGE Jails and it works fine.
If I run /etc/ipfw.rules in the Jail then it blocks all traffic. But I cannot get it to run the script at boot.
Code:
#!/bin/sh
# PROVIDE: myipfw
. /etc/rc.subr
name="myipfw"
rcvar=`set_rcvar`
start_cmd="myipfw_start"
stop_cmd=":"
load_rc_config $name
myipfw_start() {
if checkyesno ${rcvar}; then
/etc/ipfw.rules
fi
}
run_rc_command "$1"
/etc/ipfw.rules -- in Jail
Code:
#!/bin/sh
ipfw -q flush
ipfw -q add deny all from any to any
/etc/rc.conf -- in Jail
Code:
myipfw_enable="YES"
Code:
-- on Host
# jls
JID IP Address Hostname Path
1 - testa /usr/jail/mnt/test
2 - testb /usr/jail/mnt/test1
I am using a similar script to the jail's /etc/rc.d/myipfwin the host's /etc/rc.d to start multiple VIMAGE Jails and it works fine.
If I run /etc/ipfw.rules in the Jail then it blocks all traffic. But I cannot get it to run the script at boot.