User Tools

Site Tools


linux:firewalld_documentation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:firewalld_documentation [2022/03/01 13:56] dodgerlinux:firewalld_documentation [2023/08/28 10:34] (current) dodger
Line 53: Line 53:
  
 <WRAP center round alert 60%> <WRAP center round alert 60%>
-TO make the changes permanent, you must add ''${PERMANENT}'' to firewall-cmd executions!!!+TO make the changes permanent, you must add ''--permanent'' to firewall-cmd executions!!!
 </WRAP> </WRAP>
  
Line 60: Line 60:
 ''--permanent'' does not apply rules on LIVE system!!! ''--permanent'' does not apply rules on LIVE system!!!
 </WRAP> </WRAP>
 +\\
 +To switch between permanent or live:
 +<code bash>
 +export PERMANENT="--permanent"
 +</code>
 +===== Reload rules =====
 +For example after using ''--permanent'' without applying live rules:
 +<code bash>
 +firewall-cmd --reload
 +</code>
  
 ===== View information ===== ===== View information =====
Line 66: Line 76:
 <code bash> <code bash>
 firewall-cmd --list-all firewall-cmd --list-all
 +</code>
 +
 +
 +==== list zones ====
 +<code bash>
 +firewall-cmd --get-zones
 </code> </code>
  
Line 127: Line 143:
  
  
 +====== Rich Rules ======
  
 +===== Open port for source range =====
  
 <code bash> <code bash>
 +firewall-cmd ${PERMANENT} --zone=public --add-rich-rule='rule family=ipv4 source address=10.40.0.0/16 port port=8181 protocol=tcp accept'
 </code> </code>
  
  
 +
 +====== Openvpn/Wireguard setup ======
 +As a client:
 +
 +<code bash>
 +firewall-cmd ${PERMANENT} --zone=internal --add-interface=tun+
 +firewall-cmd ${PERMANENT} --zone=internal --add-interface=wg+
 +firewall-cmd ${PERMANENT} --zone=internal --add-interface=ppp+
 +
 +firewall-cmd ${PERMANENT} --list-all --zone=internal
 +
 +</code>
linux/firewalld_documentation.1646142968.txt.gz · Last modified: 2022/03/01 13:56 by dodger