On Wed, May 4, 2016 at 11:49 PM, Julian Elischer <jul...@freebsd.org> wrote:
> On 4/05/2016 11:59 PM, Shawn Debnath wrote: > >> On 05/04, Alan Somers wrote: >> >>> Then maybe it's the bridged aspect that's screwing me up. Is there a >>> guide >>> for using pf on bridged interfaces? All I can find is this guide for >>> ipfw. >>> >> I ran into a similar issue recently and decided to write up an article on >> my site that documents how to set up jails with VNET/VIMAGE using a bridge >> on the host. This might help you: >> >> >> http://shawndebnath.com/articles/2016/03/27/freebsd-jails-with-vlan-howto.html >> >> If you see any errors, do let me know and I will get those fixed up. >> > > devin just committed some sample code to share/examples > > https://svnweb.freebsd.org/base/head/share/examples/jails/ > > there is also some code in > https://svnweb.freebsd.org/base/head/share/examples/netgraph/ > > that may be relevant, but uses netgraph bridging. > > > >> Thanks, >> Shawn >> >> I finally found a configuration that works, but there were two surprises. First, I had to set net.link.bridge.pfil_member=1. Second, I essentially had to double all rules; they must be written once for the physical interface and once for the virtual interface. Here is an example pf.conf file: communication to the jail host uses em0 only. em1 is reserved as the bridge for various jails' vnet interfaces. The www jail uses vnet0. The rules allow inbound traffic only on ports 80 and 443, but any outbound traffic. www_services = "{ http, https }" host_iface = "em0" dmz_iface = "em1" www_jail_iface = "vnet0:1" www_ip = "192.168.0.40" set state-policy if-bound scrub in block in all block out all pass in on $host_iface pass out on $host_iface set skip on lo0 pass in on $dmz_iface pass out on $www_jail_iface proto tcp to $www_ip port $www_services pass in on $www_jail_iface keep state pass out on $dmz_iface Thanks for all the suggestions. -Alan _______________________________________________ freebsd-net@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscr...@freebsd.org"