Physical Server

Commonly Used GPU Images - Closing and Disabling the Firewall Action Document

2024-12-12 06:50:47

Commonly used GPU images of physical servers include CentOS-{7.6, 7.9}, Ubuntu-{18.04, 20.04, 22.04}, kylin-v10-sp3, and CTyunOS-21.06.4

Common firewall software:

1.         iptables and ip6tables: used by physical server images CentOS-7.6, kylin-v10-sp3, CTyunOS-21.06.4, Ubuntu-{18.04, 20.04, 22.04}.

2.         firewalld: used by physical server image CentOS-7.9.

3.         UFW (Uncomplicated Firewall): used by an Ubuntu system by default (iptables is used for Ubuntu-based GPU images of physical servers by default).

There are two situations to close the firewall:

1.         Temporarily disable the firewall: Disable the firewall only, in general, by running the systemctl stop xxx.service command. Later, you can enable the firewall by running the systemctl start xxx.service command.

2.         Permanently disable the firewall: Close the firewall and disable Start Automatically Upon Startup using the following commands.

Close and disable iptables:

1. CentOS-7.6, kylin-v10-sp3, CTyunOS-21.06.4: Close or disable iptables and ip6tables for these red-hat systems.

Close and disable iptables (IPV4):

#View the status of iptables service (active/inactive) systemctl status iptables                           
#Close the firewall (In red-hat systems, stop iptables will automatically clear IPv4 firewall rules) systemctl stop iptables               
#Disable Start Automatically Upon Startup of iptables service systemctl disable iptables

Close and disable ip6tables (IPv6):

#View the status of iptables service (active/inactive) systemctl status ip6tables    
#Close the firewall (In red-hat systems, stop ip6tables will automatically clear IPv6 firewall rules) systemctl stop ip6tables               
#Disable Start Automatically Upon Startup of ip6tables service systemctl disable ip6tables

2. Ubuntu-{18.04, 20.04, 22.04}: Close or disable iptables and ip6tables for these Debian systems. Firewall rules will not be automatically cleared when iptables and ip6tables services are closed for these Debian systems. Instead, you must manually clear firewall rules and close netfilter-persistent (firewall rule persistence tool)

Close and disable iptables (IPV4):

#View the status of iptables service (active/inactive) systemctl status iptables    
#Manually clear firewall rules
iptables -F
#Close the firewall systemctl stop iptables               
#Close netfilter-persistent, close the firewall rule persistence tool systemctl stop netfilter-persistent
#Disable Start Automatically Upon Startup of iptables service (When you disable iptables, netfilter-persistent also changes to disabled) systemctl disable iptables

Close and disable ip6tables (IPv6):

#View the status of iptables service (active/inactive) systemctl status ip6tables   
#Manually clear firewall rules
ip6tables -F
#Close the firewall systemctl stop ip6tables  
#Close netfilter-persistent, close the firewall rule persistence tool systemctl stop netfilter-persistent
#Disable Start Automatically Upon Startup of ip6tables service (When you disable iptables, netfilter-persistent also changes to disabled) systemctl disable ip6tables  

Close and disable firewalld:

CentOS-7.9: Close or disable the firewall

#View the status of firewalld (active/inactive) systemctl status firewalld     
#Display the configuration parameter, resource, port, and service of the NIC in the current region
firewall-cmd --list-all
#Close the firewall (this will automatically clear the firewall rules) systemctl stop firewalld              
#Disable Start Automatically Upon Startup of firewalld service systemctl disable firewalld    

Close and disable UFW:

#View the status of ufw (active/inactive) and firewall rules
ufw status          
#Clear all firewall rules
ufw reset
#Close the ufw firewall
ufw disable
#Close the ufw firewall service
systemctl stop ufw
#Disable Start Automatically Upon Startup of ufw service
systemctl disable ufw



FEw7XMOxGCMB