{"record":{"id":"dfa51e621ca356ab","repo":"jdx/mise","slug":"firewall-rule-uses-protocol-which-ufw-doe","errorCode":null,"errorMessage":"firewall rule '{}' uses protocol {}, which UFW does not support; select backend = \"nftables\" or \"firewalld\"","messagePattern":"firewall rule '(.+?)' uses protocol (.+?), which UFW does not support; select backend = \"nftables\" or \"firewalld\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/firewall.rs","lineNumber":1070,"sourceCode":"                bail!(\n                    \"firewall rule '{}' uses per-source connection limiting, which firewalld policies cannot express safely; select backend = \\\"nftables\\\" or \\\"ufw\\\"\",\n                    rule.name\n                );\n            }\n        }\n        if backend == FirewallBackend::Firewalld && rule.interface.is_some() {\n            bail!(\n                \"firewall rule '{}' uses interface matching, which firewalld policies cannot express safely; select backend = \\\"nftables\\\" or \\\"ufw\\\"\",\n                rule.name\n            );\n        }\n        if backend == FirewallBackend::Ufw\n            && matches!(\n                rule.protocol,\n                Some(FirewallProtocol::Sctp | FirewallProtocol::Dccp)\n            )\n        {\n            bail!(\n                \"firewall rule '{}' uses protocol {}, which UFW does not support; select backend = \\\"nftables\\\" or \\\"firewalld\\\"\",\n                rule.name,\n                rule.protocol.expect(\"matched protocol\").as_str()\n            );\n        }\n    }\n    Ok(())\n}\n\nfn validate_effective_backend_request(\n    request: &FirewallRequest,\n    effective: &FirewallRequest,\n    backend: FirewallBackend,\n) -> Result<()> {\n    if effective.state == FirewallState::Enabled {\n        validate_backend_request(effective, backend)?;\n        request.validate_safety_with_rules(\n            &effective.rules,","sourceCodeStart":1052,"sourceCodeEnd":1088,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/firewall.rs#L1052-L1088","documentation":"UFW cannot express rules for the SCTP or DCCP protocols, so validation rejects rules carrying those protocols when the backend is Ufw. The error names the offending protocol and suggests nftables or firewalld, both of which support them.","triggerScenarios":"Creating a FirewallRule with protocol = Some(FirewallProtocol::Sctp) or Some(FirewallProtocol::Dccp) while backend = FirewallBackend::Ufw, then calling validate_backend_request/apply.","commonSituations":"VoIP/telephony or signaling workloads that use SCTP configured behind a ufw-only host; protocol left at a non-TCP/UDP value from a shared rule template; migrating a rule set from nftables to ufw without auditing protocols.","solutions":["Switch the backend to FirewallBackend::Nftables or FirewallBackend::Firewalld for this rule set.","Change the rule's protocol to TCP or UDP if the service can use them.","Remove the rule if the protocol is not actually needed on this host.","Pre-screen the rule set per backend and route unsupported protocols to a capable backend."],"exampleFix":"// before\napply(&FirewallRequest { backend: FirewallBackend::Ufw, rules: vec![FirewallRule { protocol: Some(FirewallProtocol::Sctp), .. }], .. }, false, true)?\n// after\napply(&FirewallRequest { backend: FirewallBackend::Nftables, rules: vec![FirewallRule { protocol: Some(FirewallProtocol::Sctp), .. }], .. }, false, true)?","handlingStrategy":"validation","validationCode":"fn ufw_supported_protocol(rule: &FirewallRule) -> bool {\n    !matches!(rule.protocol, Some(FirewallProtocol::Sctp | FirewallProtocol::Dccp))\n}","typeGuard":null,"tryCatchPattern":"match apply(&request, false, true) {\n    Err(e) if e.to_string().contains(\"UFW does not support\") => {\n        eprintln!(\"route SCTP/DCCP rules to nftables or firewalld\");\n    }\n    other => other?,\n}","preventionTips":["Screen protocols per backend before building requests","Default non-TCP/UDP protocols to nftables/firewalld backends","Audit rule sets when migrating to ufw","Keep protocol enums constrained to what the target backend accepts"],"tags":["firewall","ufw","protocol"],"backgroundTag":"unsupported-config-value","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}