Turn off the Linux firewall through the following steps: 1. Determine the firewall type (UFW, iptables or nftables); 2. Use the corresponding command to disable the firewall; 3. Confirm that the firewall is turned off; 4. Restart the network service (optional) ).
How to turn off the firewall in Linux
In order to turn off the Linux firewall, you can use the following steps:
1. Determine which firewall to use
If you are using UFW (Uninterrupted Firewall), please use the following command:
<code>sudo ufw disable</code>
If you are using iptables, please use the following command:
<code>sudo systemctl disable iptables sudo systemctl stop iptables</code>
If you are using nftables, please use the following command:
<code>sudo nft disable sudo systemctl disable nftables sudo systemctl stop nftables</code>
2. Confirm that the firewall is turned off
Use the following command to confirm that the firewall is turned off:
UFW:
<code>sudo ufw status</code>
iptables:
<code>sudo systemctl status iptables</code>
nftables:
<code>sudo nft status</code>
You should see something similar to the following Output, indicating the firewall is down:
UFW:
<code>Status: inactive</code>
iptables:
<code>Loaded: not-found (Reason: No such file or directory)</code>
nftables :
<code>nft disabled</code>
3. Restart the network service (optional)
In some cases, you may need to restart the network service to Make the firewall changes take effect. You can use the following command:
<code>sudo service network restart</code>
The above is the detailed content of How to turn off linux firewall. For more information, please follow other related articles on the PHP Chinese website!