firehol-router(5)
π firehol-router π
okay bestie, we're doing firehol-router from the FireHOL manual (section 5, the big reference one) β¨ this is the page that teaches you how to make a router definition, and honestly? it's giving main character energy. let's get into it π«Ά
β¨ NAME β¨
firehol-router β create a router definition π
π SYNOPSIS π
{ router | router46 } name rule-params
router4 name rule-params
router6 name rule-params
π DESCRIPTION π
so a router definition is literally just a set of rules for traffic that's passing through the host running the firewall. not traffic going to the box itself β traffic going through it. iykyk π¦
the default policy for router definitions is RETURN, which means packets do not get dropped by any particular router. but heads up: packets that aren't matched by any router get dropped at the end of the firewall. so it's not a free pass, it's just "next please" π
the behaviour of the router you defined is controlled by adding subcommands from the ones listed down in ROUTER SUBCOMMANDS π
Note π writingrouter4is equivalent to writingipv4 router, and it ensures the defined router is created only in the IPv4 firewall, along with any rules within it. writingrouter6is equivalent to writingipv6 router, and it ensures the defined router is created only in the IPv6 firewall, along with any rules within it. writingrouter46is equivalent to writing bothrouter, and it ensures the defined router is created in both the IPv4 and IPv6 firewalls. any rules within it will also be applied to both, unless they specify otherwise. π«
πΈ PARAMETERS πΈ
nameβ this is a name for this router. you should use short names (10 characters maximum, bestie, don't go feral) without spaces or other symbols. a name should be unique for all FireHOL interface and router definitions. no name-stealing in this house π«rule-paramsβ the set of rule parameters that further restrict the traffic that is matched to this router. seefirehol-params(5)for info on the parameters that can be used. some examples:
router mylan inface ppp+ outface eth0 src not ${UNROUTABLE_IPS}
router myrouter
see firehol.conf(5) for an explanation of ${UNROUTABLE_IPS}. π
π¦ WORKING WITH ROUTERS π¦
routers create stateful iptables(8) rules which match traffic in both directions. both ways, no cap π
to match some client or server traffic, the input/output interface or source/destination of the request must be specified. all inface/outface and src/dst firehol-params(5) can be given on the router statement itself β in which case they'll be applied to all subcommands for the router β or just within the subcommands of the router. your call, queen π
for example, to define a router which matches requests from any PPP interface and destined for eth0, and on this allowing HTTP servers (on eth0) to be accessed by clients (from PPP) and SMTP clients (from eth0) to access any servers (on PPP):
router mylan inface ppp+ outface eth0
server http accept
client smtp accept
Note π theclientsubcommand reverses any optional rule parameters passed to the router β in this case theinfaceandoutface. sneaky little flip, love that for it π
equivalently, to define a router which matches all forwarded traffic and within the the router allow HTTP servers on eth0 to be accessible to PPP and any SMTP servers on PPP to be accessible from eth0:
router mylan
server http accept inface ppp+ outface eth0
server smtp accept inface eth0 outface ppp
Note π in this instance twoserversubcommands are used since there are no parameters on the router to reverse. avoid the use of theclientsubcommand in routers unless the inputs and outputs are defined as part of the router. fr fr, just don't do it π
any number of routers can be defined and the traffic they match can overlap. since the default policy is RETURN, any traffic that is not matched by any rules in one will proceed to the next, in order, until none are left. it's a little relay race and the vibes are immaculate πβοΈβ¨
β SEE ALSO β
firehol(1)β FireHOL programfirehol.conf(5)β FireHOL configurationfirehol-params(5)β optional rule parametersfirehol-modifiers(5)β ipv4/ipv6 selectionfirehol-interface(5)β interface definitionfirehol-iptables(5)β iptables helperfirehol-masquerade(5)β masquerade helper- FireHOL Website
- FireHOL Online PDF Manual
- FireHOL Online Documentation
π Router Subcommands π
firehol-policy(5)β policy commandfirehol-protection(5)β protection commandfirehol-server(5)β server, route commandsfirehol-client(5)β client commandfirehol-group(5)β group commandfirehol-tcpmss(5)β tcpmss helper
π AUTHORS π
FireHOL Team. (genuinely iconic of them π«Ά)
okay that's the whole page, you ate that π
this was the FireHOL Reference, version 3.1.8, built 13 Apr 2025, and it's still firehol-router(5) β go forth and route responsibly, bestie πβ¨
π¦ where this page comes from
- debian trixie: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- ubuntu resolute: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- ubuntu stonking: firehol-doc 3.1.8+ds-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms