System/OS
2017.09.26 01:52
[linux] iptables 초간단 세팅 스크립트
조회 수 1412 댓글 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
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
70 | System/OS | [linux] vi 편집기 간단한 명령과 환경설정 | hooni | 2003.04.23 | 11409 |
69 | System/OS | [doc] TCP/IP 강의 자료 (html) | hooni | 2013.04.23 | 11252 |
68 | System/OS | [linux] 시스템 데몬 종류와 설명 | hooni | 2013.04.23 | 11224 |
67 | System/OS | [router] 라우팅 프로토콜 BGP (간단한 세팅) | hooni | 2013.04.23 | 11015 |
66 | System/OS | [mysql] 시간 관련 SQL구문.. | hooni | 2013.04.23 | 10882 |
65 | System/OS | OSI (Open Systems Interconnection) 개방형 시스템간 상호 접속 | hooni | 2013.04.23 | 10857 |
64 | System/OS | [linux] 프로세스의 stat 상태에 대한 설명 | hooni | 2013.04.23 | 10843 |
63 | System/OS | [perl] 영규가 만든 스크립트.. 하하.. | hooni | 2013.04.23 | 10683 |
62 | System/OS | [linux] SSH에 대한 기본 설명과 설치/설정 | hooni | 2013.04.23 | 10668 |
61 | System/OS | [doc] 레드햇 리눅스 메뉴얼 (html버전) | hooni | 2013.04.23 | 10522 |
60 | System/OS | [linux] 데비안(debian.org) 리눅스 명령어 예제 | hooni | 2006.04.23 | 10519 |
59 | System/OS | [unix] AIX쉘 초기 파일 (.cshrc) | hooni | 2013.04.23 | 10362 |