See a connection before it happens
The firewall simulator in the JailOps console: choose where a connection starts, where it goes, a protocol and a port, and see how it flows through the firewall, which rule lets it through or stops it, and where to change that. The same question on the command line, and what it cannot know.
What it is for
Ask the firewall instead of trying.
Why can the web jail not reach the database? Does the new rule open what you meant it to, and nothing else? Would a connection from the office reach the git server? The usual way to find out is to try, and a refused connection does not say which policy, which rule or which side said no.
The simulator answers before you try. It follows the same rules JailOps loads into pf, step by step, and shows which one decides. Nothing is sent and nothing changes, so it is as safe on a host in production as on a test machine.
Asking
From, To, protocol, port.
Open Firewall in the console and choose the Test tab, next to Policies and Address sets. You need the operator role in the project.
- From is where the connection starts and To is where it goes. Type a jail (
jail:web; the project's jails are offered as you type), one address, orhost. The arrow button swaps them. - Protocol is tcp, udp, icmp or icmp6. tcp and udp need a port. For a ping, leave the ICMP type empty and the test asks as an echo request.
- When both ends have an IPv4 and an IPv6 address, you can limit the test to one of them. Otherwise each family is tested on its own and shown as its own card.
Press Run the test, or Enter in any field. Nothing runs while you type.


Reading the flow
Every step says pass or block, and why.
The answer is a flow from left to right: where the connection starts, what the source jail sends, what reaches the destination jail, where it goes. A connection between two jails has to pass the source's firewall and the destination's, so you see both.
- Each step shows PASS, BLOCK or CANNOT SAY with an icon and the word, never by colour alone.
- Under it is the anchor of the jail and what decided, in words: policy postgres, rule 1: who may reach PostgreSQL, a project policy, the managed policy of an app, the isolation between projects, or the default of the anchor when no rule matched. The comment you wrote for a rule is the explanation.
- Details opens the rule as it is loaded in pf, and the rules the test passed over: a disabled rule the connection would have met, or the allow rules that a deny rule won over.
- The big verdict above the flow is PASS only if every step passes. When a step blocks, the destination is shown as not reached.


When it blocks
See which rule, then change it.
A blocked connection shows the step that stopped it, and the rest of the path as not reached. If the rule is a policy rule, its number and comment tell you where to go: open the policy on the Policies tab and change that rule. If the default of the anchor decided, nothing allowed the connection: add an allow rule, or put the source in an address set the policy names.
- A deny rule wins over every allow rule, whatever the order of the policies. The details list the allow rules it won over.
- A rule that is switched off lets nothing through. The details name it, so you can see that it would have matched.
- Another project is an external host: type the address of its jail, as you write it in the policy.


What it does not cover
It says so, and does not guess.
- New connections. pf keeps the state of a connection that is already open, so the answer is for a new one.
- Raw PF fragments. A policy that carries one can decide before the test can see it. The answer is cannot say, with the policy named.
- The host's own
pf.confand NAT. The simulator evaluates the JailOps anchors; the box Not covered under the result says what that leaves out for this question.
Policies, address sets and how a project keeps its firewall apart are in A firewall you can read and Projects are boundaries.
More articles
Jail updates without cron
Replace the nightly script that upgrades every jail: automatic jail upgrades per image, with a health check, a rollback and a record of every run, what they leave alone, and how a new FreeBSD release comes in.
Read the article: Jail updates without cronJail search and shell
Ctrl+K, a few letters, Shift+Enter: find a jail by name, label or app and open its shell. Labels that filter the jail list, bash in new jails, and the jailops command next to every step.
Read the article: Jail search and shellGetting started with the JailOps CLI
Root on the host, the command line and nothing else: install JailOps, build an image, create a network and a jail, reach it by name, snapshot it, open a port and install an app.
Read the article: Getting started with the JailOps CLIJailOps on a netcup server, with IPv6 that stays up
A /64, a router pair and a FreeBSD default that drops their probes. How every jail gets its own IPv6 address on netcup, and the one sysctl that ends the random unreachable alerts.
Read the article: JailOps on a netcup server, with IPv6 that stays upOne small cloud server, many services, solid IPv6
Run your database, web tier and workers on one low-cost server, each jail with its own IPv6 address, and fix the alerts a shared /64 causes with one sysctl.
Read the article: One small cloud server, many services, solid IPv6Write your own app: memcached, from package to catalog
Turn a small FreeBSD package into a JailOps app: the definition line by line, the offline check, a local install, the five traps, and the pull request that puts it in the catalog.
Read the article: Write your own app: memcached, from package to catalogFrom catalog to running service in one command
Install nginx from the app catalog with one command, see each of its steps, and find the data, the configuration, the logs and the snapshot afterwards.
Read the article: From catalog to running service in one commandA firewall you can read
Policies, address sets and jails by name (jail:web), each with a comment, so the firewall can be reviewed by someone who did not write it.
Read the article: A firewall you can readPostgreSQL and git, closed except for who needs them
Close a database and a git server, then let in exactly the web jail and the office, with a comment on every entry.
Read the article: PostgreSQL and git, closed except for who needs themProjects are boundaries
A project is a boundary. Another project is an external host, so only addresses cross it, written out on both sides. Why that is simpler to review, and what a project does not isolate.
Read the article: Projects are boundariesThe life of a jail
A jail starts at boot only when you declared it with --autostart. Why JailOps does it this way, how the order is decided, and how to see it with jailops boot.
Read the article: The life of a jailTab completion for jailops
Press Tab and get the names of your jails, networks and firewall policies, even on another host. How to install and turn on completion in bash, zsh and fish.
Read the article: Tab completion for jailopsTest the firewall before you trust it
Ask the firewall whether a connection would pass, and why, before you try it. Read the answer, put it in a script, and know what it cannot tell you.
Read the article: Test the firewall before you trust itLimit what a jail can use
Give a jail a ceiling for memory, processes, CPU, disk, firewall states and bandwidth, one command each, and know what happens when it reaches it.
Read the article: Limit what a jail can useStop every jail cleanly when the host shuts down
A host that reboots should stop its databases before it stops the disks. How JailOps stops the jails in order, and how to start them in order again.
Read the article: Stop every jail cleanly when the host shuts downOne line in pf.conf
The host's firewall stays yours. JailOps asks for one line, and everything for the jails lives below it.
Read the article: One line in pf.confWhat the host tells you by itself
A pool that reports an error, an uplink that goes down, a jail that reaches a limit: they show up in the event stream by themselves.
Read the article: What the host tells you by itselfNetworks the host controls
No bridge, no DHCP. The host hands out the addresses, gives each jail a link of its own and is the router, so jails cannot see or impersonate each other.
Read the article: Networks the host controlsVolumes: data that outlives a jail
Keep the data in a volume and the jail disposable. One volume can be attached to several jails, has its own snapshots and its own backup.
Read the article: Volumes: data that outlives a jailBack up volumes once
One copy of a volume, however many jails use it. Leave volumes out when you want to, bring them back with the jail.
Read the article: Back up volumes onceA private Docker registry
A registry of your own with users in a file: one jail, docker-registry and docker-auth, htpasswd for the passwords, the images on a volume.
Read the article: A private Docker registryNames for jails
A jail is reached by its name inside its project: db.shop.internal, or just db. Create a jail and its name is there; delete it and the name is gone.
Read the article: Names for jails
Try it on one server.
Try the console from the screenshots, install on a clean FreeBSD 15.1 machine, or add JailOps to a host you already run.