I've got FreeBSD-9.0 amd64 running on a VM what I'm trying to do is set it up jails so that the host acts as a gateway and all the jails run within a private network.
/etc/rc.conf
/etc/pf.conf
With the way that /etc/pf.conf is currently setup, I'm able to ping and resolve addresses from within the jail, however, if I remove the two hashes and the "pass all" line. I am unable to do anything within the jail. Syntastically it looks like it should work, and was pulled almost word for word from "The Book of PF".
Does anyone have any ideas what I may be doing wrong?
Eventually I want to scale this to a purchased vm once I can get a working setup.
/etc/rc.conf
Code:
hostname="bsdbox"
ifconfig_em0=" inet 192.168.1.51 netmask 255.255.255.0"
defaultrouter="192.168.1.1"
gateway_enable="YES"
# IP for jail apache
cloned_interfaces="lo1"
ifconfig_lo1=" inet 192.168.2.1 netmask 255.255.255.255"
ifconfig_lo1_alias0=" inet 192.168.2.254 netmask 255.255.255.0"
pf_enable="YES"
pflog_enable="YES"
sshd_enable="YES"
syslogd_flags="-ss"
# Jails
jail_set_hostname_allow="YES"
jail_enable="YES"
jail_devfs_enable="YES"
jail_procfs_enable="YES"
#jail_sysvipc_allow="YES"
jail_socket_unixiproute_only="YES"
ezjail_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
Code:
bsdbox# jls
JID IP Address Hostname Path
1 192.168.2.1 apache.home.local /usr/jails/apache
/etc/pf.conf
Code:
ext_if="em0"
int_if="lo1"
localnet=$int_if:network
set skip on lo0
nat on $ext_if from $localnet to any -> ($ext_if)
block all
#pass in proto tcp to port ssh
#pass from $localnet to any keep state
[color="Red"]pass all[/color]
With the way that /etc/pf.conf is currently setup, I'm able to ping and resolve addresses from within the jail, however, if I remove the two hashes and the "pass all" line. I am unable to do anything within the jail. Syntastically it looks like it should work, and was pulled almost word for word from "The Book of PF".
Does anyone have any ideas what I may be doing wrong?
Eventually I want to scale this to a purchased vm once I can get a working setup.