allow.raw_sockets
The jail root is allowed to create raw sockets. Setting
this parameter allows utilities like ping(8) and
traceroute(8) to operate inside the jail. If this is
set, the source IP addresses are enforced to comply with
the IP address bound to the jail, regardless of whether
or not the IP_HDRINCL flag has been set on the socket.
Since raw sockets can be used to configure and interact
with various network subsystems, extra caution should be
used where privileged access to jails is given out to
untrusted parties.
To allow access for the jails to the internet, you need to configure and run pf(4) to connect (NAT) the bridge0 (10.0.0.1) to the internet facing interface (vtnet0: 168.235.83.112).I don't have pf running on it at the moment.
allow.raw_sockets is not required. wan = vtnet0
lan = bridge0
nat on $wan from 10.0.0.1/24 to any -> ($wan)
pass in on $lan
pass out keep state
# Public IP address
IP_PUB="168.235.83.112"
# Packet normalization
scrub in all
# Allow outbound connections from within the jails
nat on vtnet0 from lo1:network to any -> (vtnet0)
# webserver jail at 10.0.0.10
rdr on vtnet0 proto tcp from any to $IP_PUB port 443 -> 10.0.0.10
# just an example in case you want to redirect to another port within your jail
rdr on vtnet0 proto tcp from any to $IP_PUB port 80 -> 10.0.0.10 port 8080
#wan = "vtnet0"
#lan = "bridge0"
#nat on $wan from 10.0.0.0/24 to any -> ($wan)
#pass in on $lan
#pass out keep state
Have your tried this pf.conf (un-commented)? Also, it'sA previous suggestion was this:-
Code:#wan = "vtnet0" #lan = "bridge0" #nat on $wan from 10.0.0.0/24 to any -> ($wan) #pass in on $lan #pass out keep state
10.0.0.1 (bridge0's IP), not 10.0.0.0You used the bridge(4) set up, right? Then it should be:Code:# Allow outbound connections from within the jails nat on vtnet0 from lo1:network to any -> (vtnet0)
nat on vtnet0 from bridge0:network to any -> (vtnet0)
He's using a network range; 10.0.0.0/24 which is valid. The .0 is the network address. The rule applies to all source addresses in the 10.0.0.0/24 range.Also, it's10.0.0.1(bridge0's IP), not10.0.0.0
Thanks, pf(4) is not my forte. The documentation is not exactly easy reading.He's using a network range; 10.0.0.0/24 which is valid. The .0 is the network address. The rule applies to all source addresses in the 10.0.0.0/24 range.
I'm not sure, apparently it works with both IPs (in my test VM).As a result of SirDice 's post do I need to change this line
/32 rather than /24 ?That's because 10.0.0.1/24 and 10.0.0.0/24 are the exact same range (the host bits of the address are irrelevant). That's why you typically use the network address when specifying ranges, to avoid any confusion. If you need a, single, specific IP address, you'd use 10.0.0.1 or 10.0.0.1/32.
If you intent to filter a specific IP address, yes. Compare these two rules:/32 rather than /24 ?
pass in on $int_if from 10.0.0.1/32 to any
pass in on $int_if from 10.0.0.1/24 to any