Hello, I’m not seeing packets on some firewall rules I would expect to see packets on and I’m wondering if I have a poor understanding of the filter firewall rules. First I’d like to confirm whether I’ve got all this right:
The INPUT filter is for traffic destined for the router itself
The FORWARD filter is for traffic that’s going between networks
The OUPUT filter is for traffic that’s leaving the router
Here’s how my network is set up:
10.24.10.0/28 - Management, I have the vyos router, a mikrotik switch and a tp-link AP with addresses on this lan
10.24.20.0/26 - Trusted, network for trusted devices
10.24.30.0/26 - Servers, network for my servers
10.24.40.0/26 - Untrusted, untrusted devices (smart devices etc)
If I want to access the internet or the servers network from 10.24.20.2 (Trusted) then I’d be hitting the FORWARD filter
If I want to access a server on the Servers network from the Trusted network I’d be hitting the FORWARD firewall
If I want to access the router from the Trusted network I’d be hitting the INPUT firewall
For context here are the groups I’ve defined that I’m using in my rules:
| ------------------------- | ----------------------- | ----------------------- | ------------- | |
|---|---|---|---|---|
| Firewall | Groups | |||
| Name | Type | References | Members | |
| ------------------------- | --------------- | ----------------------- | ------------- | |
| GRP-ADR-TRUENAS | address_group | ipv4-forward-filter-400 | 10.24.30.2 | |
| GRP-ADR-UNTRUST-TO-SERVER | address_group | ipv4-forward-filter-400 | 10.24.40.5 | |
| 10.24.40.7 | ||||
| GRP-IF-LAN | interface_group | ipv4-forward-filter-100 | eth2.10 | |
| ipv4-input-filter-1000 | eth2.20 | |||
| eth2.30 | ||||
| eth2.40 | ||||
| GRP-IF-WAN | interface_group | ipv4-forward-filter-100 | eth1 | |
| ipv4-input-filter-10 | ||||
| nat-source-10 | ||||
| GRP-NET-MGMT | network_group | ipv4-forward-filter-202 | 10.24.10.0/29 | |
| GRP-NET-SERVERS | network_group | ipv4-forward-filter-200 | 10.24.30.0/26 | |
| ipv4-forward-filter-201 | ||||
| GRP-NET-TRUSTED | network_group | ipv4-forward-filter-200 | 10.24.20.0/26 | |
| ipv4-forward-filter-201 | ||||
| ipv4-forward-filter-202 | ||||
| GRP-PT-DNS | port_group | N/D | 53 | |
| GRP-PT-MGMT | port_group | ipv4-forward-filter-202 | 22 | |
| 443 | ||||
| 80 | ||||
| GRP-PT-SERVERS | port_group | N/D | 139 | |
| 445 | ||||
| GRP-PT-SERVERS-UDP | port_group | ipv4-forward-filter-201 | 53 | |
| GRP-PT-SERVICES | port_group | ipv4-forward-filter-200 | N/D | |
| GRP-PT-WEB | port_group | ipv4-forward-filter-400 | 3001 | |
| 443 | ||||
| 80 | ||||
| 81 | ||||
| ------------------------- | ----------------------- | ----------------------- | ------------- |
And my rules for the Forward filter:
| Rule | Action | Protocol | Packets | Bytes | Conditions | ||
|---|---|---|---|---|---|---|---|
| ------- | -------- | ---------- | --------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------- | ||
| 10 | accept | all | 97539 | 878654950 | ct state { established, related } | accept | |
| 11 | accept | icmp | 31 | 1612 | ct state { established, related, new } meta l4proto icmp | accept | |
| 100 | accept | all | 3522 | 586504 | iifname I_GRP-IF-LAN oifname I_GRP-IF-WAN | accept | |
| 200 | accept | tcp | 0 | 0 | ip daddr N_GRP-NET-SERVERS tcp dport P_GRP-PT-SERVICES ip saddr N_GRP-NET-TRUSTED | prefix “[ipv4-FWD-filter-200-A]” | accept |
| 201 | accept | udp | 300 | 22460 | ip daddr @N_GRP-NET-SERVERS udp dport P_GRP-PT-SERVERS-UDP ip saddr N_GRP-NET-TRUSTED | prefix “[ipv4-FWD-filter-201-A]” | accept |
| 202 | accept | tcp | 0 | 0 | ip daddr @N_GRP-NET-MGMT tcp dport P_GRP-PT-MGMT ip saddr N_GRP-NET-TRUSTED | accept | |
| 400 | accept | tcp | 0 | 0 | ip daddr @A_GRP-ADR-TRUENAS tcp dport P_GRP-PT-WEB ip saddr A_GRP-ADR-UNTRUST-TO-SERVER | prefix “[ipv4-FWD-filter-400-A]” | accept |
| default | drop | all | 66 | 3960 |
My question is why don’t I see packets for rules 200,202 and 400? 200 should be matched by traffic generated on 10.24.20.0/26 and targeted to 10.24.30.0/26 on ports defined by the SERVICES group (it includes the other defined groups)
202 should match on traffic to management addresses from the Trusted network
400 should match on requests to my truenas system from a couple specific devices on the untrusted network
Everything is working normally so I’m assuming these packets are being matched somewhere I’m missing.
Here’s my input filter:
| Rule | Action | Protocol | Packets | Bytes | Conditions | ||
|---|---|---|---|---|---|---|---|
| ------- | -------- | ---------- | --------- | ------- | ---------------------------------------------------------------- | ||
| 10 | accept | all | 163 | 32759 | ct state { established, related } iifname @I_GRP-IF-WAN | accept | |
| 1000 | accept | all | 2957 | 410500 | iifname @I_GRP-IF-LAN | prefix “[ipv4-INP-filter-1000-A]” | accept |
| default | drop | all | 487 | 34410 |
And my output filter:
Rule Action Protocol Packets Bytes
default accept all 1646 249211
I’ve also attached the bulk of my configuration minus dhcp / user stuff. Thanks!
r01-config-10-18-25.txt (7.8 KB)