1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-23 19:02:09 +02:00
tldr/pages/linux/firewall-cmd.md
Lucas Gabriel Schneider a5fe31bc47
multiple pages: format technical tokens (#5119)
Co-authored-by: bl-ue <54780737+bl-ue@users.noreply.github.com>
Co-authored-by: Starbeamrainbowlabs <sbrl@starbeamrainbowlabs.com>
2021-01-31 12:05:18 -05:00

31 lines
970 B
Markdown

# firewall-cmd
> The firewalld command line client.
- View the available firewall zones:
`firewall-cmd --get-active-zones`
- View the rules which are currently applied:
`firewall-cmd --list-all`
- Permanently move the interface into the block zone, effectively blocking all communication:
`firewall-cmd --permanent --zone={{block}} --change-interface={{enp1s0}}`
- Permanently open the port for a service in the specified zone (like port 443 when in the `public` zone):
`firewall-cmd --permanent --zone={{public}} --add-service={{https}}`
- Permanently close the port for a service in the specified zone (like port 80 when in the `public` zone):
`firewall-cmd --permanent --zone={{public}} --remove-service={{http}}`
- Permanently open two arbitrary ports in the specified zone:
`firewall-cmd --permanent --zone={{public}} --add-port={{25565/tcp}} --add-port={{19132/udp}}`
- Reload firewalld to force rule changes to take effect:
`firewall-cmd --reload`