System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1404 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
58 | System/OS | [linux] sendmail 설정/사용 | hooni | 2003.04.23 | 14640 |
57 | System/OS | [linux] root도 삭제하지 못하는 파일 속성 | hooni | 2003.04.23 | 12460 |
56 | System/OS | [linux] root 전환시 패스워드 없이 su 사용하기 | hooni | 2013.12.22 | 12780 |
55 | System/OS | [linux] resolv.con 초기화 되는 문제 | hooni | 2014.04.05 | 4701 |
54 | System/OS | [linux] ProFTPD 타임아웃 설정 | hooni | 2003.04.23 | 12911 |
53 | System/OS | [linux] Proftpd 설치 가이드 | hooni | 2003.04.23 | 13084 |
52 | System/OS | [linux] Oracle8.1.6, Mysql+PHP+Zend Optimizer+APACHE+Tomcat(jsp,servlet)+IMAP+gd | hooni | 2003.04.23 | 32530 |
51 | System/OS | [linux] Masquerade 가상 ip분할기법 | hooni | 2003.04.23 | 48022 |
50 | System/OS | [linux] man 명령어 뽀개기.. | hooni | 2003.04.23 | 8779 |
» | System/OS | [linux] iptables 초간단 세팅 스크립트 | hooni | 2017.09.26 | 1404 |
48 | System/OS | [linux] iptables 명령어 매뉴얼(options) | hooni | 2003.04.23 | 11410 |
47 | System/OS | [linux] ipfwadm를 이용한 패킷필터링(구버전) | hooni | 2003.04.23 | 13102 |