1.14. Configuring zone priorities for traffic classification by using firewalld
With zone priorities, you can control the packet classification order by specifying priorities for ingress and egress traffic. The benefit is that you can specify the traffic classification order in a zone.
So zone A may be considered before zone B regardless of the source address or interfaces. A zone of a lower priority value has higher precedence over a zone with a higher priority value. This classification has a pair of ingress priority value and egress priority value.
1.14.1. Setting same priority value for both traffic types in a zone リンクのコピーリンクがクリップボードにコピーされました!
By using the --set-priority option, you can set a common value for both ingress and egress traffic classification without explicit specification.
Prerequisites
Create a new zone:
# firewall-cmd --permanent --new-zone=example-zoneSet a common zone priority value for the
example-zonezone with--set-priority:# firewall-cmd --permanent --zone example-zone --set-priority -10By setting a lower value ensures the higher precedence. This ensures that all configured operations for both traffic types in this zone will take precedence over operations from other zones.
Apply permanent configuration to runtime:
# firewall-cmd --reload
Verification
Display the priority value for both traffic types:
# firewall-cmd --permanent --info-zone example-zone example-zone target: default ingress-priority: -10 egress-priority: -10 ... icmp-block-inversion: no ... services: dhcpv6-client mdns samba-client ssh ... forward: yes masquerade: no ...This setting ensures that the traffic will be considered for classification into the
example-zonebefore other zones.
1.14.2. Setting different priority value for each traffic type in a zone リンクのコピーリンクがクリップボードにコピーされました!
By setting distinct values for ingress and egress traffic, you can set priorities for the traffic classification in a zone.
Procedure
Create a new zone:
# firewall-cmd --permanent --new-zone=example-zoneSet a zone priority value for
ingresstraffic in theexample-zonezone with--set-ingress-priority:# firewall-cmd --permanent --zone example-zone --set-ingress-priority -10Set a zone priority value for
egresstraffic in theexample-zonezone with--set-egress-priority:# firewall-cmd --permanent --zone example-zone --set-egress-priority 100Apply permanent configuration to runtime:
# firewall-cmd --reload
Verification
Display the priority value for both traffic types:
# firewall-cmd --permanent --info-zone example-zone example-zone (active) target: default ingress-priority: -10 egress-priority: 100 icmp-block-inversion: no interfaces: eth0 ... services: dhcpv6-client mdns samba-client ssh ... forward: yes masquerade: no ...These values indicate that the
ingresstraffic has priority over theegresstraffic in theexample-zonezone before other zones.