How it works
The generator validates ports from 1 through 65535 and emits the selected tcp-portrange or udp-portrange field. Space-separated ports and inclusive start-end ranges are supported. Source-port constraints are not added.
Worked example
branch-web with TCP ports 443 and 8443-8445 defines those destination ports. It does not create a firewall policy or allow traffic by itself.
Inputs, edge cases & common mistakes
Use a new object name. Editing an existing service can preserve unmentioned protocol fields, so this snippet is not a complete replacement of arbitrary existing objects. Review the generated commands against the target FortiOS version, back up, and test in the correct VDOM. No application identification is implied by a port number.
Technical references
Reviewed 9 September 2026. Found an issue? Send a correction with a reproducible example.