System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
Views 2693 Comment 0
# 내 서버 설정 (firewall.sh)
#!/bin/bash
# iptables automation script
iptables -F
# open 22port first for ssh
iptables -A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
# configure for basic policy
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
# accept to localhost
iptables -A INPUT -i lo -j ACCEPT
# accept to established and related
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# open 80 port for apache
iptables -A INPUT -p tcp --dport 80 -j ACCEPT
# save the configuration
/sbin/service iptables save
# print out
iptables -L -v
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
156 | System/OS | [linux] ipfwadm를 이용한 패킷필터링(구버전) | hooni | 2003.04.23 | 13950 |
155 | System/OS | [linux] iptables 명령어 매뉴얼(options) | hooni | 2003.04.23 | 12620 |
» | System/OS | [linux] iptables 초간단 세팅 스크립트 | hooni | 2017.09.26 | 2693 |
153 | System/OS | [linux] man 명령어 뽀개기.. | hooni | 2003.04.23 | 9954 |
152 | System/OS | [linux] Masquerade 가상 ip분할기법 | hooni | 2003.04.23 | 48960 |
151 | System/OS | [linux] Oracle8.1.6, Mysql+PHP+Zend Optimizer+APACHE+Tomcat(jsp,servlet)+IMAP+gd | hooni | 2003.04.23 | 33287 |
150 | System/OS | [linux] Proftpd 설치 가이드 | hooni | 2003.04.23 | 13844 |
149 | System/OS | [linux] ProFTPD 타임아웃 설정 | hooni | 2003.04.23 | 13948 |
148 | System/OS | [linux] resolv.con 초기화 되는 문제 | hooni | 2014.04.05 | 5454 |
147 | System/OS | [linux] root 전환시 패스워드 없이 su 사용하기 | hooni | 2013.12.22 | 13632 |
146 | System/OS | [linux] root도 삭제하지 못하는 파일 속성 | hooni | 2003.04.23 | 13167 |
145 | System/OS | [linux] sendmail 설정/사용 | hooni | 2003.04.23 | 15424 |