How do i configure my own firewalld service?



  • The default services are located under /usr/lib/firewalld/services/

    To add your own service copy an existing service and modify it.

    # cd /etc/firewalld/services/
    # cp /usr/lib/firewalld/services/ipp.xml /etc/firewalld/services/
    # mv ipp.xml saltstack.xml
    

    Make edits the saltstack.xml file for Heading, Description, Protocol, and Port number(s)

    $ cat saltstack.xml
    <?xml version="1.0" encoding="utf-8"?>
    <service>
      <short>Saltstack</short>
      <description>The Salt master communicates with the minions using an AES-encrypted ZeroMQ connection. These communications are done over TCP ports 4505 and 4506, which need to be accessible on the master only. </description>
      <port protocol="tcp" port="4505"/>
      <port protocol="tcp" port="4506"/>
    </service>
    

    Reload the firewalld

    $ sudo firewall-cmd --reload
    success
    

    Verify - see your service under the name you called it

    $ sudo firewall-cmd --get-services
    

Log in to reply
 

© Lightnetics 2024