✔️ CentOS 6에서 테스트하였습니다.
1 개요[ | ]
- How To Disable/Enable The Iptables Firewall in Linux
- How To Turn off/Turn on Linux Firewall
- 리눅스 iptables 끄기, 켜기
- 리눅스 OS 방화벽 비활성화/활성화 하기
- 리눅스 설치하면 방화벽은 기본적으로 켜져 있다.
- 아래 명령어로 iptables를 끄고 켤 수 있다.
Bash
Copy
service iptables stop
/etc/init.d/iptables stop
Bash
Copy
service iptables start
/etc/init.d/iptables start
2 끄기[ | ]
Console
Copy
[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Console
Copy
[root@zetawiki ~]# service iptables stop
iptables: Setting chains to policy ACCEPT: filter [ OK ]
iptables: Flushing firewall rules: [ OK ]
iptables: Unloading modules: [ OK ]
Console
Copy
[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
3 켜기[ | ]
Console
Copy
[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Console
Copy
[root@zetawiki ~]# service iptables start
iptables: Applying firewall rules: [ OK ]
Console
Copy
[root@zetawiki ~]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere
ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain FORWARD (policy ACCEPT)
target prot opt source destination
REJECT all -- anywhere anywhere reject-with icmp-host-prohibited
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
4 같이 보기[ | ]
5 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.