Published services → Port publication

“Port publications expose internal services to the outside: an external port of the appliance on a zone is forwarded (DNAT) to an internal host and port…

“Port publications expose internal services to the outside: an external port of the appliance on a zone is forwarded (DNAT) to an internal host and port. The replies go back through the connection tracking: the internal host must route through the appliance.”

In other words: the client on the internet connects to an address of the appliance (for example 203.0.113.10) on a port; the appliance replaces the destination with the internal host and forwards the connection to it. The internal host must have the appliance as its gateway (or at least a route that goes through it), otherwise the replies take another path and the connection never opens.

A publication answers only on the appliance’s addresses: it can never capture traffic meant for other hosts. Published traffic passes whatever the “Forward policy” of the ingress zone (the wan drops everything else) and is not touched by the zones’ forward rules: what restricts it is the publication’s “Allowed remote sources”. The blocklist, on the other hand, does apply: an address in the blocklist reaches no publication.

The list

The bar shows the title “Port publication”, the count, the search and the “Reload” and “Add publication” buttons (the “+” icon). Each row sums up the publication:

  • first line: protocol, external port, internal host and port, for example TCP 8443 → 192.168.10.30:443; a publication that keeps the port (internal port 0) shows only the host, for example TCP 5001 → 192.168.10.20;
  • second line: the ingress zone (or “Any zone”), the interface when limited (“on eth0”), the sources (“from 198.51.100.0/28”) and the comment;
  • on the right, “Enabled” or “Disabled”.

An enabled publication that is not actually published says so in amber:

  • “Zone deleted — not published”: its zone no longer exists;
  • “Zone without interfaces — not published”: its zone has no interfaces;
  • “not a gateway’s interface any more — not published”: the interface it was limited to no longer carries a gateway, or is no longer in the zone.

The search filters by ports, host, comment, zone, sources and interface. In a publication’s detail the bar has the title “Port publication / TCP 8443 → 192.168.10.30:443” and the “Duplicate publication” and “Delete publication” buttons.

The list of publicationsThe list of publications
The list of publications

The fields

Field What it does Values and default
“Ingress zone” “The zone whose interfaces the publication answers on, for traffic addressed to the appliance itself.” a zone, or “Any zone” (default)
“WAN interface” limits the publication to a gateway’s interface “Every interface of the zone” (or “Every interface”), or an interface with a gateway
“Protocol” “TCP” (default) or “UDP”
“External port” the port the appliance answers on “One port (8080), a range with a dash (8080-8090, both ends included) or a comma-separated list (80,443).”
“Internal host” the server’s address an IPv4 address, for example 192.168.10.30
“Internal port” the server’s port “0 = same as the external port (mandatory for ranges and lists).” Default 0
“Allowed remote sources” who may use the publication “IPv4 address or CIDR, comma separated; empty = any source. Every other source is not translated and meets the zone’s inbound policy.”
“Allowed countries” from which countries the publication may be used a drop-down list with search, one country or more; empty = “Any country” (default), at most 32
“Source limit /min (0 = off)” new connections per minute for each source address 0–1000000; “Max new connections per source IP; excess is not translated and hits the zone policy.”
“Source burst” connections allowed at once before the limit kicks in 0–10000
“Limit open connections per source” how many connections one source may hold open at once off by default; on, “Open connections per source” from 1 to 65535, 50 proposed
“SYN proxy” the appliance completes the TCP handshake itself before handing the connection to the server off by default; TCP only, not together with “Allowed countries”
“Comment” a free note, shown in the list and in the rules at most 128 bytes
“Enabled” switches the publication on or off without deleting it enabled by default

Ingress zone. As a rule, choose WAN. “Any zone” means every interface, the LAN included: an internal client connecting to the appliance’s address on that port also ends up on the published server. A zone without interfaces publishes nothing: the console refuses the save with “This zone has no interfaces: assign one to it first”.

WAN interface. The field appears only once you have configured at least one gateway (Network and uplinks → Gateways). It offers the interfaces of the gateways in the chosen zone (all of them, with “Any zone”); a disabled gateway is marked “(Disabled)”. “Limit the publication to one gateway’s interface: the service answers on this one only, and with two active gateways or more its replies leave through it too.” This is how you publish a service on just one of two lines. If that interface later no longer carries a gateway, the publication is not published (never widened to every interface), and deleting the gateway switches it off.

External port and internal port. With a single port you can change port: external 8443, internal 443. With a range or a list the ports stay the same and the “Internal port” must be 0; otherwise you read “A range or a list keeps its ports: set 0”. Ports are written without leading zeros.

Allowed remote sources. This is the most effective security measure: if the service is only for a branch, a supplier or a maintenance contractor, list their addresses. A source that is not listed is not translated: to the appliance it is an attempt to connect to one of its own ports, and the ingress zone drops it.

Allowed countries. When you do not know the addresses people connect from but you know where they connect from — the staff’s remote desktop, the sales team’s VPN — choose the countries: the publication answers only clients whose addresses the internet registries (RIPE, ARIN, APNIC, LACNIC, AFRINIC) assign to those countries. It is the country where a block of addresses is registered, not the exact place of each address: enough to keep out most scans and attempts from abroad, not a guarantee. With “Allowed remote sources” too, either one lets a client in: “Ireland, plus the maintenance contractor’s address abroad”. The lists are downloaded the first time you save a country and then every night; they never make the firewall “to apply”. A country without data lets no one in: the Status page says so.

Source limit. It protects a service from repeated attempts (passwords tried in bursts, scans). The limit is per single source address, unlike the limit of the zones’ inbound services, which is overall.

Open connections per source. The source limit counts new connections a minute; this one counts those open at the same time. It works against whoever opens connections and leaves them open to exhaust the server (a “slow flood”): past the chosen number, that source’s next connection is not translated and the zone’s policy drops it; as soon as one of its connections closes, it may open another. 50 suits a web site; a service used by a whole office behind one address (a branch’s NAT) wants more.

SYN proxy. In a SYN flood a source sends thousands of connection requests it never completes: without a SYN proxy each takes a place in the appliance’s connection table and reaches the server. With the SYN proxy on, the appliance answers by itself, with a cookie, and hands the server only the connections the client really completed: the flood fills no table. It is for TCP publications exposed to the internet; it does not go together with “Allowed countries”. A publication behind the SYN proxy is not inspected, even when its zone is: the inspection engine does not see the start of the connection the proxy opens towards the server, and would drop it; the Protection → Inspector page lists these publications. The blocklist’s addresses and the sources impossible from the WAN side are still stopped in front of the SYN proxy, and so are the addresses Intelligence blocks or bans. The proxy announces to the client an MSS that fits the publication’s interfaces (a PPPoE link’s or a WireGuard tunnel’s MTU, less 40) and a fixed window scale, 7: Linux servers use it; with a server that uses another (Windows uses 8) the connections still work, a little slower. While a SYN proxy is loaded, TCP tracking is strict on the whole appliance: a connection deleted from Events and diagnostics → Diagnostics (“Delete these connections”) is closed rather than picked up again. Status warns when the kernel has SYN cookies or TCP timestamps switched off, which the SYN proxy needs.

Saving and applying

“Create publication” or “Save publication” writes the configuration. “Publications take effect on the firewall apply, together with the zones.” After saving, apply the firewall from the header (“Apply”) and confirm within 60 seconds.

“Duplicate publication” opens a new publication with the same fields and the note “Copy of TCP 8443 → 192.168.10.30:443: change what differs, then create it — nothing is saved until then.”

“Delete publication” asks for confirmation (“Delete publication TCP 8443 → 192.168.10.30:443?”) and removes the publication from the configuration; it disappears from the firewall with the next “Apply”.

Example: the NVR for the security company

John Smith Ltd wants the security company (network 198.51.100.0/28) to see the cameras on the NVR 192.168.10.30, which answers in HTTPS on 443, only through the fibre line:

  • “Ingress zone”: WAN
  • “WAN interface”: eth0
  • “Protocol”: TCP
  • “External port”: 8443
  • “Internal host”: 192.168.10.30
  • “Internal port”: 443
  • “Allowed remote sources”: 198.51.100.0/28
  • “Source limit /min (0 = off)”: 30
  • “Comment”: NVR for the security company

The security company opens https://203.0.113.10:8443. From any other address, port 8443 looks closed.

The detail of the NVR publicationThe detail of the NVR publication
The detail of the NVR publication

Reserved ports and conflicts with the console

Some of the appliance’s ports already have an owner. An enabled publication that takes them is refused, or accepted with a warning on the Status page.

SSH (port 22). SSH always answers on the lan and on the zones opened in System → Management access. A TCP publication on 22 in one of those zones (or with “Any zone”) is refused: “SSH answers on this port here — on the lan always, and on the zones System → Management access opens: use another port”. Publishing 22 on the wan while SSH is not open on the wan, on the other hand, is possible.

The console (ports 443, 80 and 8000). The console answers on 443 of the zones where it is open (always on the lan); 80 serves the redirect to HTTPS and the Let’s Encrypt validation; 8000 is a transitional redirect for old bookmarks. On these ports the publication takes precedence and the console adapts:

  • a TCP 443 publication on a zone where the console answers moves the console to port 8000, and the Status page reports it: “The console answers on port 8000: a publication takes 443 elsewhere on the console’s zones — remove or move the publication and the console moves back to 443”;
  • a publication of 80 or 8000 is accepted with the warning “A publication takes port 80 away on the console’s zones: without 80 there is no redirect (nor the ACME challenge), without 8000 there is no fallback console”;
  • a TCP 8000 publication on the console’s zones is refused while another publication already takes 443: no web console would be left. The message is “The console answers on this port here — on the lan always, and on the zones System → Management access opens: use another port”.

If you publish 443 on the wan and the console is not open on the wan, there is no conflict at all: it is the normal case of a published web server.

Warning A TCP 443 publication with “Any zone” takes 443 on the LAN too: the console moves to port 8000 (https://192.168.10.1:8000). Always choose an ingress zone.

VPN and reverse proxy. These ports, too, open by themselves and cannot be published:

  • the listen port of an active VPN WireGuard profile: “A VPN listens on this UDP port (VPN → VPN WireGuard): use another port”;
  • UDP 500 and 4500 while an IPsec tunnel is active: “IPsec takes UDP 500 and 4500 while a tunnel is active (VPN → VPN IPsec): use another port”;
  • TCP 80 and 443 on a zone where a reverse proxy answers: “A reverse proxy answers on TCP 80 and 443 in this zone (Published services → Reverse proxy): use another port or zone”.

The same checks are repeated at every “Apply”: if a later change (a zone, an interface) creates a conflict with SSH, the apply is refused with “The saved configuration cannot be applied”, followed by what is wrong, naming the publication: for example “publication Website: takes tcp/22, where SSH answers: switch it off or move it”.

Error messages

Message Meaning
“Zone not found” the chosen zone has been deleted
“This zone has no interfaces: assign one to it first”
“Choose the interface of a gateway (Network and uplinks → Gateways)” the chosen interface no longer carries a gateway
“This interface is not in the chosen zone”
“Invalid ports (use 443, 137-139 or 80,443)”
“Not a valid IPv4 address” “Internal host” is not an IPv4 address
“Port must be 1-65535” “Internal port” out of range
“A range or a list keeps its ports: set 0”
“Invalid source (IPv4 address or CIDR, comma separated)”
“Rate must be 0-1000000 (0 = unlimited)”
“Burst must be 0-10000”
“At most 128 bytes (an accented letter counts as two)” comment too long

For the technician Every enabled publication is a line of the dstnat chain of ip argos_nat: iifname { <interfaces> } fib daddr type local [ip saddr { <sources> }] <proto> dport { <ports> } [meter pub_<n> { ip saddr limit rate <N>/minute burst <B> packets }] counter ct mark set ct mark or 0x08000000 dnat to <host>[:<port>]. fib daddr type local limits the translation to the appliance’s own addresses. In the forward chain of inet argos_filter the rule ct status dnat ct mark and 0x08000000 == 0x08000000 accept lets through only the translations Argos made (not those of podman or of other tables), after the blocklist and before the zones; in the zones the Inspector inspects, published traffic goes through Suricata first. With two active gateways or more, the replies leave through the WAN the connection came in on. A publication whose zone does not exist, has no interfaces, or whose interface no longer belongs to a gateway is not written.

LET’S TALK INFRASTRUCTURE

Control starts with a conversation.

Tell us about your infrastructure. Let’s start with what you actually need.

Talk to an engineer