Firewalling

Firewalld uses different components to make firewalling easier

  • Service: the main component, contains 1 or more ports as well as optional kernel modules that should be loaded.

  • Zone: a default configuration to which network cards can be assigned to apply specific settings (internal, external)

  • Ports: optional elements to allow access to specific ports (just use services instead, it's more convenient)

firewall-cmd : ⦁ --reload -> to reload firewalld serivce ⦁ --get-zones -> List all the zones ⦁ --get-default-zone -> display the default zone ⦁ --set-default-zone=ZONE -> set default zone ⦁ --get-services -> display all available services ⦁ --list-services -> list services ⦁ --add-service=SERVICE NAME [--zone=ZONE] -> add new service ⦁ --remove-service= SERVICE NAME -> remove service ⦁ --add-port=PORT/PROTOCOL -> add port ⦁ --remove-port=PORT/PROTOCOL -> remove port ⦁ --add-interface=INTERFACE -> add interface ⦁ --remove-interface=INTERFACE -> remove interface ⦁ --add-source=IP ADD/ MASK -> add an IP source ⦁ --remove-source=ip/mask -> remove source. ⦁ --permanent -> to set-add-remove {service-port-zone} permanently.

You can use the GUI interface too. yum install firewall-config -y

Last updated