System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1225 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
202 | System/OS | Apache CORS 설정 1 | hooni | 2020.09.04 | 2687 |
201 | System/OS | asx미디어 정보 기록.. | hooni | 2003.04.23 | 20533 |
200 | System/OS | CentOS 6.5 USB 설치 6 | hooni | 2013.12.18 | 37668 |
199 | System/OS | CentOS 에서 Cacti 설치하기 | hooni | 2015.01.02 | 1754 |
198 | System/OS | Configure Postfix to Use Gmail SMTP on Ubuntu 18.04 | hooni | 2020.02.07 | 1228 |
197 | System/OS | Enable Safari Hidden Debug Menu in Mac OS X | hooni | 2017.02.07 | 1128 |
196 | System/OS | Enable the Develop Menu in Safari | hooni | 2017.02.07 | 1056 |
195 | System/OS | How to Install and Use wget on Mac | hooni | 2020.09.03 | 1257 |
194 | System/OS | How to Setup an Email Server on CentOS 7 | hooni | 2018.04.05 | 2767 |
193 | System/OS | HTTP 프로토콜 (브라우저와 웹서버 간의 통신) | hooni | 2003.04.23 | 48247 |
192 | System/OS | HTTPS와 SSL 인증서 | hooni | 2014.03.11 | 7541 |
191 | System/OS | iptime 공유기 해킹 기술문서 4 | hooni | 2015.01.01 | 1937 |