I am running 7.2-release and would like to run apache in a jail. I've made a jail with ezjail and despite trying to follow many of the tutorials on the web I cannot access the internet from inside the jail (ping returns nothing), and so can't even think about installing apache in it. I would appreciate any help in resolving the basic problem of connecting to the internet from inside the jail. (For what it's worth, I can ssh into the jail from the host, even back into the host from the jail.)
The host connects directly to the internet with IP address XXX.YYY.ZZZ.WWW and adaptor bge0. I want to assign the jail the address 10.0.0.3. I have copied /etc/resolv.conf into the jail. Here is one of the variations I have tried.
The host connects directly to the internet with IP address XXX.YYY.ZZZ.WWW and adaptor bge0. I want to assign the jail the address 10.0.0.3. I have copied /etc/resolv.conf into the jail. Here is one of the variations I have tried.
Code:
--- HOST rc.conf ---
defaultrouter="XXX.YYY.ZZZ.1"
ifconfig_bge0="inet XXX.YYY.ZZZ.WWW netmask 255.255.255.0"
ifconfig_bge0_alias1="inet 10.0.0.3 netmask 255.255.255.255"
inetd_enable="NO"
pf_enable="YES"
gateway_enable="YES"
--- HOST pf.conf ---
ext_if="bge0"
all_if="{bge0, lo0}"
myjail="10.0.0.3"
rdr on $all_if proto tcp from any to bge0 port 80 -> $myjail port 80
nat on $ext_if from $myjail to any -> bge0
--- HOST sysctl.conf ---
security.jail.allow_raw_sockets=1
--- JAIL rc.conf ---
rpc_bind_enable="NO"
sshd_enable="YES"
sendmail_enable="NO"
network_interfaces=""
defaultrouter="XXX.YYY.ZZZ.1"
early_late_divider="NETWORKING"
--- JAIL /etc/hosts ---
127.0.0.1 myjail myjail.com
10.0.0.3 myjail myjail.com