Publishing an internal server to authorised addresses only

John Smith Ltd's network video recorder (NVR) sits in the LAN, at 192.168.10.30, and has its web interface on HTTPS, port 443. The security company that looks after the CCTV system must be able to…

Situation

John Smith Ltd’s network video recorder (NVR) sits in the LAN, at 192.168.10.30, and has its web interface on HTTPS, port 443. The security company that looks after the CCTV system must be able to reach it from its own office, whose public addresses are 198.51.100.0/28. From nowhere else on the internet must the NVR be visible.

The solution is a port publication: an external port of the appliance (here 8443 on the fibre’s address, 203.0.113.10) is forwarded to the internal host and port (192.168.10.30:443), but only for the authorised sources. For everyone else port 8443 stays closed like any other.

The scenario ends with two cases worth knowing: RDP access to a server, to be avoided or at least restricted, and the list of what must not be published.

What you need

  • The First office scenario completed: the line on eth0 in the WAN zone, the gateway applied.
  • The NVR configured with a fixed address, 192.168.10.30, and with gateway 192.168.10.1. The NVR’s replies must come back through the appliance: with another gateway the publication does not work.
  • The public addresses the security company connects from (here 198.51.100.0/28). Ask for them in writing: a wrong address gives no error, it simply does not get in.

Steps

Checking that the appliance reaches the NVR

  1. Go to Events and diagnostics → Diagnostics and choose “TCP port check”. “Host” 192.168.10.30, “Port” 443, then “Run”. The answer must be open, with the time in milliseconds; closed/unreachable means the NVR does not accept connections on that port. In that case sort out the NVR first: a publication towards a host that does not answer cannot work.

The publication

  1. Go to Published services → Port publication and press “Add publication” (the + button at the top right). Fill in:

    Field Value Note
    “Ingress zone” WAN the zone whose interfaces answer
    “WAN interface” eth0 the fibre line only: if one day you add the second line, the NVR stays reachable from here only
    “Protocol” TCP
    “External port” 8443 the port the security company opens on the public address
    “Internal host” 192.168.10.30 the NVR
    “Internal port” 443 0 would mean “same as the external port”
    “Allowed remote sources” 198.51.100.0/28 addresses or networks, comma separated; empty = anyone
    “Source limit /min (0 = off)” 30 see below
    “Source burst” 0 nftables’ default value
    “Comment” NVR for the security company
    “Enabled” on

    Press “Create publication”. The list row shows TCP 8443 → 192.168.10.30:443 and below it “wan · on eth0 · from 198.51.100.0/28 · NVR for the security company”.

    Port publication: the NVR, for the security company's sources onlyPort publication: the NVR, for the security company's sources only
    Port publication: the NVR, for the security company's sources only

    Why 8443 and not 443. You could publish 443 itself, but on the fibre’s address 443 is the natural port of the company’s web services (the websites behind a reverse proxy, or the console if one day you open it on the WAN). A different external port leaves 443 free without changing anything on the NVR. It is not a security measure: the real protection is the allowed sources.

    The per-source limit. “Source limit /min” counts the new connections per minute of each source address; beyond the limit (plus the “Source burst”) the connection is not translated and meets the zone’s inbound policy, that is it is dropped. With the sources already restricted to a single office it is a second line of defence: 30 per minute is enough for whoever watches the cameras and slows down anyone who, from those addresses, tried guessing the passwords. Do not go too low: a web page like an NVR’s opens many connections at once. If the page loads only halfway, raise the “Source burst” (for example to 30) or the limit.

  2. The firewall’s status button in the header reads “Unapplied changes”: publications take effect only with the apply. Press it, choose “Apply” and in the “Keep the new ruleset?” dialog press “Confirm” within 60 seconds.

For the technician The publication is a DNAT line in the nat table, limited to the eth0 interface (iifname, within the WAN zone), to port 8443, to the sources 198.51.100.0/28 and to the appliance’s own addresses (fib daddr type local). The translated connection gets a mark in connection tracking, and the forward chain accepts only the translations carrying that mark: a DNAT done by someone else (a container, for example) does not get through. A source not on the list is not translated: the packet stays addressed to the appliance on 8443 and the WAN’s inbound policy drops it, with its own log line.

The RDP case

  1. The ERP vendor asks to connect by remote desktop (RDP, port 3389) to the server 192.168.10.41. The right way is a VPN: the technician enters the network with their profile and uses RDP from there, with nothing exposed on the internet (see Connecting two Argos sites with WireGuard for a link between sites, or the VPN chapter). Publishing RDP to anyone means receiving endless login attempts from all over the world and depending on the Windows password alone.

  2. If a VPN is not possible and the intervention is occasional, restrict the publication as much as you can. In Published services → Port publication press “Add publication”:

    Field Value
    “Ingress zone” WAN
    “Protocol” TCP
    “External port” 3389
    “Internal host” 192.168.10.41
    “Internal port” 0
    “Allowed remote sources” 198.51.100.81 (the vendor’s address only)
    “Source limit /min (0 = off)” 6
    “Source burst” 3
    “Comment” ERP vendor RDP — only during support sessions
    “Enabled” off

    Press “Create publication”. Switched off, the publication does not change the rules: there is nothing to apply. When the vendor has to step in, open it, switch on “Enabled”, press “Save publication”, then “Apply” in the header and “Confirm” within 60 seconds; once the intervention is over switch it off again, save, apply and confirm. The limit of 6 new connections per minute per source is enough for an RDP session and slows down anyone guessing passwords.

    Port publication: RDP restricted, and off outside support sessionsPort publication: RDP restricted, and off outside support sessions
    Port publication: RDP restricted, and off outside support sessions

Tip To create a publication similar to an existing one, select the existing one and press “Duplicate publication” in the detail’s bar: the form opens as a new publication with the same values, and nothing is saved until you press “Create publication”.

What not to publish

  • The management interfaces of switches, access points, printers, NAS units, PBXs: never to anyone. If a vendor has to manage them from outside, VPN.
  • Windows file sharing (445), databases (1433, 3306, 5432), remote desktop without restrictions. They are the ports most searched for on the internet.
  • The appliance’s management ports. Argos refuses a publication that would take the SSH port where SSH answers (always on the LAN, and on the zones opened in System → Management access): the message is “SSH answers on this port here — on the lan always, and on the zones System → Management access opens: use another port”. On 443 of the zones where the console answers, on the other hand, the publication wins: the console moves to 8000 and the System status → Status page reports it; on 80 and on 8000, Status warns that the redirect (and the Let’s Encrypt validation) or the fallback console are missing. Avoid it: publish on the WAN, where the console normally does not answer, and leave those ports free on the LAN.
  • Publications with “Ingress zone” “Any zone”. A publication with no zone answers on every interface, the LAN included: an office PC opening https://192.168.10.1:8443/ would be translated in turn. Always choose the WAN zone.

Verification

From the security company’s office (an address of 198.51.100.0/28): https://203.0.113.10:8443/ opens the NVR’s page. The browser flags the NVR’s own certificate, which is not the appliance’s: that is normal, Argos does not touch it.

From another address (for example a phone on the mobile network): the same page does not open, it times out.

In the firewall log. In Events and diagnostics → Firewall:

  • with “Show” “Passed” and the filter 192.168.10.30 you find the security company’s connections: rule zone-wan-fwd, source 198.51.100.x, destination 192.168.10.30 port 443 (the log records the packet already translated);
  • with “Show” “Blocked” and the filter 8443 you find the others’ attempts: rule zone-wan-in, destination 203.0.113.10 port 8443, action “drop”.

To see both together, leave “Show” on “All” and filter on zone-wan: in the figure, the last hour.

Firewall log: the NVR's publication, passed and blockedFirewall log: the NVR's publication, passed and blocked
Firewall log: the NVR's publication, passed and blocked

Log lines are limited to 10 per second per rule: during a scan the count is what the limit let through.

The open connections. In Events and diagnostics → Diagnostics, “Connection tracking”, type 192.168.10.30 in “Address” and press “Show”: each of the security company’s connections appears with its translation to the NVR.

On the status. In System status → Status, the “Firewall” card counts the “Active publications”.

If something goes wrong

The security company cannot get in and its address appears in the blocked log. It connects from an address that is not in “Allowed remote sources”: the log with “Blocked” and the filter 8443 shows the real address under “Source”. Often an office goes out to the internet from an address other than the one its technician knows. Add it (comma separated), save and apply.

The security company cannot get in and nothing appears in the log. The connection does not reach the appliance: wrong address or port, or an outbound firewall on their side blocks 8443. If there is a provider’s router in router mode in front of Argos, it must forward 8443 to the appliance.

The connection is in the passed log, but the page does not load. The NVR gets the request and replies elsewhere: its gateway is not 192.168.10.1. Correct it on the NVR. The “TCP port check” from the appliance (step 1) works all the same, because it is on the same network: it is not enough to rule this problem out.

The page loads only halfway. The connections beyond “Source limit /min” (plus the “Source burst”) are dropped: raise the burst or the limit, or set the limit back to 0.

The publication’s row shows “Zone without interfaces — not published” or “Zone deleted — not published”. The chosen zone has no interfaces, or no longer exists: the publication is saved but not loaded. Choose the WAN zone. If it shows “not a gateway’s interface any more — not published”, eth0 no longer has a gateway in Network and uplinks → Gateways (or has left the zone): choose another interface or “Every interface of the zone”.

Saving shows an error.

  • “Invalid ports (use 443, 137-139 or 80,443)”: in “External port”, one port, a range with a hyphen or a list with commas, with no spaces and no leading zeros.
  • “A range or a list keeps its ports: set 0”: with several external ports, “Internal port” must be 0.
  • “Invalid source (IPv4 address or CIDR, comma separated)”: check the list of sources.
  • “SSH answers on this port here …” or “The console answers on this port here …”: the port is a management port on that zone; use another one.
  • “A reverse proxy answers on TCP 80 and 443 in this zone (Published services → Reverse proxy): use another port or zone”.
  • “Choose the interface of a gateway (Network and uplinks → Gateways)” or “This interface is not in the chosen zone”: “WAN interface” takes an interface that has a gateway and is in the “Ingress zone”.
  • “A VPN listens on this UDP port …” or “IPsec takes UDP 500 and 4500 …”: the port serves one of the appliance’s VPNs.

The apply is refused with “The saved configuration cannot be applied” and a reason that names a publication. Another change (a zone, an interface) has moved a publication onto a management port: the reason names it. Switch it off or move it and apply again.

From inside, with the public address, the NVR does not open. A publication answers only on its interface (here eth0), so not to whoever is in the LAN; and with restricted sources not even hairpin NAT reflects it. From the LAN use the internal address, https://192.168.10.30/, or the local DNS name nvr.johnsmith.test. For the other publications see Reaching a published service from inside by its public name.

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