Home >Computer Tutorials >Computer Knowledge >How to enable or disable firewall on Alpine Linux?
On Alpine Linux, you can use the iptables tool to configure and manage firewall rules. Here are the basic steps to enable or disable the firewall on Alpine Linux:
Check firewall status:
sudo iptables -L
Enable firewall:
sudo iptables -P INPUT ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -P FORWARD ACCEPT
The above command will set the default policy to accept (ACCEPT), which means all traffic will be accepted.
Disable firewall:
sudo iptables -P INPUT ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -P FORWARD ACCEPT
The above command will set the default policy to accept (ACCEPT), which means all traffic will be accepted.
If you wish to completely disable the iptables service and stop the firewall, please run the following command:
sudo rc-service iptables stop sudo rc-update del iptables
Please note that the above command will immediately change the firewall status in the current session. If you want the firewall to be automatically enabled or disabled on system startup, adjust the configuration accordingly. The specific configuration method may vary depending on the version and environment used. You can refer to the official documentation of Alpine Linux or related resources for more information.
The above is the detailed content of How to enable or disable firewall on Alpine Linux?. For more information, please follow other related articles on the PHP Chinese website!