연구개발/Linux

CentOS 7 방화벽 해제

HEAD1TON 2015. 1. 2. 18:40
## Step 1: 방화벽을 해제합니다.
[root@localhost ~]# systemctl mask firewalld
 
## Step 2: 방화벽을 정지합니다.
[root@localhost ~]# systemctl stop firewalld
 
## Step 3: iptables service 관련packages를 설치합니다.
[root@localhost ~]# yum -y install iptables-services
 
## Step 4: boot시 service를 시작합니다.
[root@localhost ~]# systemctl enable iptables
 
## 만약 ip6tables 서비스를 사용하지 않을 경우, skip 합니다.
[root@localhost ~]# systemctl enable ip6tables
 
## Step 5: iptables services를 시작합니다.
[root@localhost ~]# systemctl start iptables
 
## 만약 ip6tables 서비스를 사용하지 않을 경우, skip 합니다.
[root@localhost ~]# systemctl start ip6tables
 
## 전체 서비스를 disable할 경우 아래와 같이 진행합니다.
[root@localhost ~]# systemctl list-unit-files | grep fire
firewalld.service                           enabled
  
[root@localhost ~]# systemctl list-unit-files | grep iptables
iptables.service                            disabled
  
[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl stop iptables
[root@localhost ~]# systemctl stop ip6tables
[root@localhost ~]# systemctl disable firewalld
rm '/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service'
rm '/etc/systemd/system/basic.target.wants/firewalld.service'
[root@localhost ~]# systemctl disable iptables
[root@localhost ~]# systemctl disable ip6tables
  
[root@localhost ~]# systemctl list-unit-files | grep fire
firewalld.service                           disabled
[root@localhost ~]# systemctl list-unit-files | grep iptables
iptables.service                            disabled