modules: meta: Improve firewall rules for our router

This commit is contained in:
James Shubin
2025-06-02 15:18:30 -04:00
parent a72492f042
commit ac3a131a9f

View File

@@ -173,7 +173,6 @@ class router($st) {
action => "MASQUERADE", action => "MASQUERADE",
source => ["${loc_network}",], # ip/cidr of the LOC network, eg: 192.168.100.0/24 source => ["${loc_network}",], # ip/cidr of the LOC network, eg: 192.168.100.0/24
dest => "NET_IF", dest => "NET_IF",
log => true,
}) })
include firewall.stoppedrule("loc-all", struct{ include firewall.stoppedrule("loc-all", struct{
@@ -187,7 +186,15 @@ class router($st) {
dest => "LOC_IF", dest => "LOC_IF",
}) })
include firewall.rule("ssh-from-loc-to-fw", struct{ include firewall.rule("000-invalid-net-all-tcp", struct{
action => "Invalid(DROP)",
source => "net",
dest => "all",
proto => "tcp",
comment => "Don't allow connection pickup from the net",
})
include firewall.rule("111-accept-ssh-loc-fw", struct{
action => "SSH(ACCEPT)", action => "SSH(ACCEPT)",
source => "loc", source => "loc",
dest => "$FW", dest => "$FW",
@@ -196,7 +203,7 @@ class router($st) {
comment => "local administration", comment => "local administration",
}) })
include firewall.rule("ssh-from-net-to-fw", struct{ include firewall.rule("111-accept-ssh-net-fw", struct{
action => "SSH(ACCEPT)", action => "SSH(ACCEPT)",
source => "net", source => "net",
dest => "$FW", dest => "$FW",
@@ -204,6 +211,26 @@ class router($st) {
#port => "", #port => "",
comment => "remote administration", comment => "remote administration",
}) })
include firewall.rule("997-drop-ping-net-fw", struct{
action => "Ping(DROP)",
source => "net",
dest => "$FW",
comment => "Drop Ping from the \"bad\" net zone and prevent your log from being flooded.",
})
include firewall.rule("998-accept-icmp-fw-loc", struct{
action => "ACCEPT",
source => "$FW",
dest => "loc",
proto => "icmp",
})
include firewall.rule("999-accept-icmp-fw-net", struct{
action => "ACCEPT",
source => "$FW",
dest => "net",
proto => "icmp",
})
} }
class router:dhcp_host($st) { class router:dhcp_host($st) {