Contents

System/OS
2003.04.23 10:34

[linux] 간단한 NAT 설정 script

조회 수 12606 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
#!/bin/sh
insmod ip_tables
insmod iptable_filter
insmod ip_conntrack
insmod ip_conntrack_ftp
insmod ip_nat_ftp
insmod ipt_state
insmod ipt_limit

iptables -t filter -F user_chain
iptables -t filter -X user_chain
iptables -t filter -N user_chain
iptables -t filter -F FORWARD
#iptables -t filter -A FORWARD -p tcp -d 192.168.3.80 -j user_chain
iptables -t filter -A user_chain -j DROP

iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -s 192.168.1.2 -o eth0 -j SNAT --to 192.168.3.80
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 192.168.3.68

iptables -t nat -F PREROUTING
iptables -A PREROUTING -t nat -d 192.168.3.80 -j DNAT --to 192.168.1.2

##/proc/sys/net/ipv4/ip_forward
##파일을 수정 0 --> 1 로 수정


?

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
154 System/OS [linux] yum 업데이트 시 커널 제외하기 hooni 2014.09.11 1264
153 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 4626
152 System/OS [linux] CentOS 6.5 에서 "Bringing up interface eth0: Determining if ip address 121.78.127.197 is already in use for device eth0..." hooni 2014.04.05 4858
151 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5119
150 System/OS [mac] 맥OSX에서 NTFS 쓰기 기능 활성화 hooni 2014.03.12 4288
149 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7548
148 System/OS [linux] split 명령어 hooni 2014.03.11 4307
147 System/OS [linux] awk 명령어 hooni 2014.03.11 4957
146 System/OS [linux] 쉘스크립트 expr hooni 2014.03.11 15625
145 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4483
144 System/OS [linux] CentOS 6.x Cati 설치 (yum) hooni 2014.01.17 48596
143 System/OS [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기 file hooni 2014.01.09 12221
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 ... 17 Next
/ 17