Add/Remove rule from firewallD

    0

    0

    dinacea93

    The following command will add a new rule in the public zone to allow TCP traffic on port 3306 from 213.186.33.99.

    firewall-cmd --permanent --zone=public --add-rich-rule=' rule family="ipv4" source address="213.186.33.

    // ADD
    
    firewall-cmd --permanent --zone=public --add-rich-rule='
      rule family="ipv4"
      source address="213.186.33.99"
      port protocol="tcp" port="3306" accept'
      
      // REMOVE
      
      firewall-cmd --permanent --zone=public --remove-rich-rule='
      rule family="ipv4"
      source address="213.186.33.99"
      port protocol="tcp" port="3306" accept'
      
      // RELOAD 
      
      firewall-cmd --reload
      
      // LIST ALL
      
      firewall-cmd --list-all
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.