Skip to main content

Juniper Protect-RE Filter Generator

← Back to Tools

Generate a Junos Routing Engine protection filter — the lo0 input firewall filter that every RE-bound packet passes through regardless of which interface or destination address it actually arrived on. Applied via unit <*> so it automatically covers every configured loopback unit — the default instance and any routing-instances/virtual-routers — not just lo0.0. Check the protocols you run, list trusted sources per protocol where it matters, and get a complete, correctly-ordered set command block ending in a logged catch-all discard. Runs entirely in your browser — nothing is sent anywhere.

Updated November 13, 2026

  • New: every protocol that reads its hosts with apply-path (BGP, MSDP, NTP, SNMP, DNS, RADIUS, TACACS+) can now take a list of addresses you type instead, or as well. They are written to a static prefix-list. The “Don’t use apply-path” button switches every protocol over at once.
  • Fixed: SNMP polling addresses are now checked, and IPv6 ones go into the IPv6 filter instead of producing an invalid IPv4 term.

Updated November 10, 2026

  • RADIUS: CoA / Disconnect-Request (UDP/3799) and 802.1X / NAC servers. Thanks to J. Coke for the CoA catch.
  • New: NETCONF with custom ports, IKE / IPsec for SRX, LDP, RSVP, PIM, IGMP / MLD, MSDP and RIP.
  • Fixed: the BGP neighbor list now includes global peers as well as routing-instance peers.
Filter Name
Protocols
Switches the “pull from config” box off for BGP, MSDP, NTP, SNMP, DNS, RADIUS and TACACS+. Then enter the addresses under each protocol you tick.
Discards obviously-bogus source addresses (RFC 1918-adjacent specials, loopback, link-local, documentation, multicast-as-source) before they consume any other term.
Non-initial fragments destined to the RE are almost never legitimate control-plane traffic — discarded early.
TCP/179, restricted via an apply-path prefix-list that dynamically pulls every configured protocols bgp group <*> neighbor <*> address — including inside routing-instances/virtual-routers — so the neighbor list can never drift out of sync with your actual BGP config. No manual address entry needed, or list the neighbors yourself below.
Protocol 89. OSPF adjacencies are link-local, so this is a straight protocol match with no source-address list.
⚠ IS-IS runs directly over CLNS/OSI framing, not IP — no family inet firewall filter can see it, so checking this only adds an explanatory comment to the output, not a real filter term. Protect IS-IS via interface-level authentication instead (set protocols isis interface <if> level 2 authentication ...).
Protocol 112, link-local by nature — no source-address list needed.
UDP/3784 (single-hop) and UDP/4784 (multihop) — only relevant if you're running BFD for fast failure detection with BGP/OSPF/static routes.
MPLS label distribution. UDP/646 for neighbor discovery (hellos go to 224.0.0.2 or straight to a targeted neighbor) and TCP/646 for the session itself, in either direction. Not source-restricted: link hellos are multicast and targeted neighbors are loopbacks, so there is no clean address list to pull. Use authentication-key on the sessions.
Protocol 46, for RSVP-TE label-switched paths. A straight protocol match, like OSPF; protect the sessions with RSVP authentication.
Protocol 103 (IPv4, and IPv6 if enabled below), for multicast routing. Link-local hellos plus unicast Register messages to the rendezvous point, so it is a straight protocol match.
Protocol 2 (IGMP) for IPv4 hosts joining multicast groups. With the IPv6 filter on, this also accepts MLD membership query, report and termination messages (ICMPv6).
TCP/639 between rendezvous points, restricted via an apply-path prefix-list pulled from protocols msdp peer <*>. IPv4 only, as MSDP has no IPv6 form.
UDP/520 (RIP) and, with the IPv6 filter on, UDP/521 (RIPng). Neighbors are link-local, so this is a port match with no source list. Use RIP authentication.
For a device that terminates IPsec tunnels. Accepts IKE on UDP/500 and NAT-traversal on UDP/4500, from your VPN peers. IKEv2 uses the same ports.
⚠ With no peer source at all (for example dynamic or remote-access VPNs whose peers are not in security ike gateway ... address), the terms accept from any source. IKE then has to defend itself: use strong authentication and IKE rate limits. The tool warns you when this happens.
⚠ On an SRX, ESP and AH for tunnels the SRX terminates are normally handled in the flow plane, so they usually never reach this filter — IKE does. Tick ESP/AH only if your platform needs them, or if you see ESP counted in DISCARD-ALL-COUNT. The zone's host-inbound-traffic system-services ike setting is separate and still has to allow IKE; this filter does not replace it.
UDP/123, restricted via an apply-path prefix-list pulled from system ntp server <*> (IPv4 and IPv6 servers) — no manual address entry needed, or list the servers yourself below.
UDP/161, restricted via an apply-path prefix-list pulled from snmp client-list <*> — your SNMP-layer poller restriction usually is the source list. Add any polling-only hosts below that aren't in a client-list.
The router is a DNS client, so this matches return traffic — UDP/TCP source-port 53, restricted via an apply-path prefix-list pulled from system name-server <*>. Not a destination-port match, and no manual address entry needed (or list the servers yourself below).
⚠ This is required for Mist — the device resolves Mist cloud hostnames via DNS to establish its management connection, so blocking this term will break Mist connectivity.
The router is a RADIUS client, so this matches return traffic — UDP source-port 1812/1813, restricted via an apply-path prefix-list pulled from system radius-server <*> (the servers used for admin login). Not a destination-port match, and no manual address entry needed (or list the servers yourself below).
Switches doing 802.1X, MAC-RADIUS or NAC (ClearPass, ISE, Mist NAC) and MX subscriber management configure their RADIUS servers under access radius-server, not system radius-server. Without this the replies from those servers are not matched by the source list.
Dynamic authorization (RFC 5176) is the one RADIUS exchange the server starts: the server sends a Change-of-Authorization or Disconnect-Request to the router, so it arrives as a destination-port match, not as a reply. Only needed with NAC or captive-portal setups. On Junos the listening port is dynamic-request-port under access radius-server (default 3799).
The router is a TACACS+ client, so this matches return traffic — TCP source-port 49 with tcp-established, restricted via an apply-path prefix-list pulled from system tacplus-server <*>. TACACS+ is TCP-only (the UDP variant seen in some templates never carries it), so no UDP term is generated.
For a router that gets its management address by DHCP, or one that serves/relays DHCP. IPv4 uses UDP 67/68; DHCPv6 (UDP 546/547) is added to the IPv6 filter if that is enabled.
⚠ DHCP clients send their first request from 0.0.0.0, which the anti-spoof term would discard. The server/relay term is therefore placed ahead of anti-spoof and accepts UDP/67 from any source — only tick it if this router really serves or relays DHCP.
For switches managed by Juniper Mist. The device opens the connections outward, so the filter only has to accept the return traffic — TCP with tcp-established and the cloud-side source port. Like Mist's own generated filter, these terms are not limited to particular source addresses — Mist's cloud IPs change and Juniper publishes hostnames, not an address list, so restricting by destination host belongs on your perimeter firewall.
⚠ A Mist-managed switch may already carry its own lo0 filter (yours showed protect_re in groups top). Run show configuration | display set | match lo0 first — two competing lo0 input filters is something to test in a lab, not on a live switch. Mist also needs DNS return traffic, so keep the DNS term checked.
SSH, NETCONF and optionally HTTPS/J-Web, restricted to your management networks.
Many sites move NETCONF off 830 (set system services netconf ssh port <n>). Untick the default if you have, and list the port(s) you really use. If NETCONF is carried over a port you already allow for SSH, you do not need this term at all.
Rate-limits connection-churn TCP packets (SYN-without-ACK, FIN, RST) across every TCP-based service at once — a blanket policer layered ahead of the per-service accept terms, not tied to any one protocol. Packets within the limit continue on to the later terms (then next term), so this term never accepts anything by itself; packets over the limit are discarded.
Restricted to specific legitimate types (echo, time-exceeded, unreachable, parameter-problem, source-quench, router-advertisement) rather than any ICMP type, rate-limited on top, with ICMP timestamp requests and fragmented ICMP explicitly discarded and counted — keeps ping/PMTUD working with a smaller attack surface than a blanket ICMP allow.
Covers both traceroute styles — UDP high-ports (Linux/macOS) and ICMP echo (Windows tracert.exe) — each requiring ttl 1 so only packets that are actually topologically arriving as a hop-probe match, plus a policer on both.
Source = destination = 127.0.0.1 — needed on some platforms for internal daemon-to-daemon communication on the RE itself.
Custom Rules
Extra one-off terms for things the checkboxes above don't cover — a CDN host, a monitoring probe, a vendor's update server. Every rule needs at least one match condition. Accept rules are placed after management access; discard rules go right after the fragment check, ahead of every accept. A rule with an IPv6 source goes into the IPv6 filter; a rule with no source goes into both (if IPv6 is enabled). Ports can be numbers, ranges (33434-33534), names, or a comma-separated list.
IPv6
A dual-stack box needs a separate, independent family inet6 filter — IPv4 and IPv6 don't share terms. This adds a second filter (<name>-V6) applied to the same lo0 interface, scoped to essentials only for now: anti-spoofing, Neighbor Discovery, and a catch-all discard. BGP, OSPF, NTP, DNS, RADIUS (including CoA), TACACS+, DHCPv6, Mist, LDP, RSVP, PIM, MLD, RIPng, IKE/IPsec, NETCONF, custom rules, and SNMP are all mirrored into it automatically if checked above, reusing the exact same apply-path prefix-lists as the IPv4 terms — one neighbor/server list covers both address families, nothing to duplicate or keep in sync (NTP gets a separate IPv6 list, because its <*.*> pattern only expands IPv4 addresses). MSDP has no IPv6 form and is not mirrored. The SNMP section's manual extra-host field is IPv4-only and is not mirrored here.
⚠ Neighbor Discovery (ICMPv6 router/neighbor solicitation & advertisement, redirect) is included unconditionally, not as a toggle — it's the IPv6 equivalent of ARP, and the box loses basic IPv6 reachability without it. The anti-spoof term also intentionally exempts link-local (fe80::/10) as a source, unlike the IPv4 term's treatment of 169.254.0.0/16 — OSPFv3 and VRRP6 legitimately source from link-local addresses.
1. Anti-spoof / fragmentsReject obviously-bogus traffic before it wastes evaluation time on later terms.
2. NTP / DNS / RADIUS / SNMPNarrow UDP services with known, small source lists.
3. BGP / OSPF / VRRP / LDP / RSVP / PIM / MSDP / RIPRouting and signalling protocols — BGP and MSDP are source-restricted since peers are known; OSPF, VRRP, RSVP, PIM and RIP rely on link-local adjacency; LDP hellos are multicast. IKE/IPsec sits here too, limited to your VPN peers.
4. Management (SSH / NETCONF / HTTPS)Restricted to your management networks — never leave this open to any source.
5. ICMP (policed) / tracerouteKept working but rate-limited, so a flood can't consume RE CPU.
Custom rulesDiscard rules sit right after the fragment check, ahead of every accept; accept rules sit after management access.
6. Catch-allEverything else is counted, logged, and discarded — visibility into what's hitting the RE without letting any of it through.
lo0, not per-interfaceThe loopback input filter catches all RE-bound traffic regardless of ingress interface or destination IP — that's the whole mechanism. Applied via unit <*>, so it covers every configured loopback unit, not just lo0.0.
IS-IS is invisible hereNo IP header means no IP firewall filter can match it — use interface-level authentication instead.
RADIUS is reply trafficMatch source-port 1812/1813 from your servers, not a destination-port rule — the router initiates the request. The one exception is CoA / Disconnect-Request (RFC 5176): the server starts that, so it arrives as a destination-port match, UDP/3799 by default. Tick the CoA option if you run NAC.
apply-path prefix-listsBGP/NTP/DNS/RADIUS/SNMP/MSDP/IKE pull their allow-lists live from the actual config (protocols bgp, system ntp/name-server/radius-server, access radius-server, snmp client-list, protocols msdp peer, security ike gateway) at commit time — add or remove a peer there and this filter updates itself on the next commit, nothing to maintain twice. If you would rather not use apply-path, every one of these except IKE can take a typed list of addresses instead (see below).
Listing hosts instead of apply-pathEach of BGP, MSDP, NTP, SNMP, DNS, RADIUS and TACACS+ has a “pull from the config” box and an address box. Typed addresses are written to a static prefix-list (BGP-NEIGHBORS-STATIC, plus -STATIC-V6 for IPv6) and the term lists it next to, or instead of, the apply-path list. Use it for servers configured by hostname (apply-path cannot expand an FQDN), for hosts that are not in this router’s config, or for one filter shared by many routers. With apply-path off and nothing typed, no term is generated and that traffic hits the final discard, so the tool warns. A static list does not follow later config changes: add a neighbor and you must add it here too.
groups need apply-groupsThe whole filter is wrapped in a configuration group for reuse/clarity, bound to any lo0 unit via unit <*> — a group does nothing on its own until the trailing apply-groups line activates it.
Test before you commitAlways use commit confirmed when applying a new RE filter remotely — a mistake here can lock you out of the box entirely.
Policer-only terms acceptA Junos term whose actions are all nonterminating (count, policer, log) is implicitly accepted. The TCP flood term therefore ends in next term, so it only rate-limits and leaves the accept/discard decision to the terms after it.
tcp-establishedMatches TCP packets with ACK or RST set, so it lets the replies to connections the router started through but not a fresh SYN. Used on the TACACS+ and Mist return-traffic terms. It never matches UDP, so don't put UDP and tcp-established in one term — that term can only ever match TCP.
Source-port matches are spoofableReturn-traffic terms (source-port 443, 2200, 2083...) can be forged by anyone who can reach the router unless the term is also pinned to known source addresses. Give those terms a source list whenever you have one.
DHCP and anti-spoofA DHCP client's first packet comes from 0.0.0.0, which anti-spoof discards. Only a router acting as a DHCP server or relay needs the early UDP/67 term.
One apply-path per prefix-listapply-path holds a single pattern: a second apply-path line on the same prefix-list silently replaces the first (checked on Junos 26.2). A second pattern therefore needs its own prefix-list, and the term lists both — that is why BGP has BGP-NEIGHBORS and BGP-NEIGHBORS-VRF. Also, <*.*> expands IPv4 addresses only and <*:*> IPv6 only, while <*> expands both.
802.1X servers live under accessSwitches doing 802.1X / NAC, and MX subscriber management, keep their RADIUS servers in access radius-server, not system radius-server. Tick the 802.1X option or their replies will not match the source list.
NETCONF portDefaults to TCP/830 but is often moved (set system services netconf ssh port). List the real port; untick 830 if you no longer use it.
IPsec on an SRXIKE (UDP/500) and NAT-T (UDP/4500) are RE-bound and need terms here. ESP/AH for tunnels the SRX terminates are normally forwarded in the flow plane and may never reach this filter. The security zone must also allow host-inbound-traffic system-services ike; this filter does not replace that.
IPv4 and IPv6 are separate filtersThe main filter is family inet. A dual-stack box also needs a family inet6 filter — tick “Also Generate IPv6” and the matching terms are mirrored into it.

Provided as-is, with no warranty of any kind. This generates a starting point, not a certified or vendor-validated configuration — exact syntax and defaults can vary by Junos version and platform. Always read through the generated config line by line, verify it against current Juniper documentation and your own environment, and test in a lab before applying to production. A mistake in a Routing Engine protection filter can lock you out of the device entirely — always use commit confirmed when applying changes remotely. See the full disclaimer.