Is there a way to assign two ports to the same service in firewalld?  For example, I would like for the SMTP service to listen on both port 25 and port 465.  My first instinct is to change /usr/lib/firewalld/services/smtp.xml to read as follows :<?xml version=1.0 encoding=utf-8?><service>  <short>Mail (SMTP)</short>  <description>This option allows incoming SMTP mail delivery. If you need to allow remote hosts to connect directly to your machine to deliver mail, enable this option. You $  <port protocol=tcp port=465/>  <!-- is adding a second port here legal and the best approach? -->  <port protocol=tcp port=25/> </service>
assigning two ports to one service in firewalld
centos;email;port forwarding;smtp;firewalld
You could either create another service:<?xml version=1.0 encoding=utf-8?><service>  <short>Mail (SMTP on port 465)</short>  <description>This option allows incoming SMTP mail delivery on the alternative port 465. If you need to allow remote hosts to connect directly to your machine to deliver mail, enable this option. You do not need to enable this if you collect your mail from your ISP's server by POP3 or IMAP, or if you use a tool such as fetchmail. Note that an improperly configured SMTP server can allow remote machines to use your server to send spam.</description>  <port protocol=tcp port=465/></service>and save it as (for example) /usr/lib/firewalld/services/alt-smtp.xml, after which you can add it to the same zone as the original smtp service.Or, you could do as you suggested in your question.  From man firewalld.service:port   Is an optional empty-element tag and can be used several times to have   more than one port entry.The former will give you more control - you can enable one or the other or both.  The latter is less typing.