Contents

System/OS
2003.04.23 10:34

[linux] 간단한 NAT 설정 script

Views 12597 Comment 0
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
?

Shortcut

PrevPrev Article

NextNext Article

Larger Font Smaller Font Up Down Go comment Print
#!/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
No. Category Subject Author Date Views
58 System/OS [linux] 초간단 Postfix, Covecot, SSL/TLS (SMTP) file hooni 2017.12.11 9323
57 System/OS [linux] 간단한 find 명령어 설명(업데이트 해야 함) hooni 2013.04.23 9111
56 System/OS [linux] man 명령어 뽀개기.. hooni 2003.04.23 8723
55 System/OS HTTPS와 SSL 인증서 file hooni 2014.03.11 7546
54 System/OS SVN(Subversion) 설치와 설정 (sasl 인증 적용 포함) file hooni 2014.09.11 5664
53 System/OS [windows] 윈도우즈 콘솔에서 정품인증 하는 방법 hooni 2017.05.24 5306
52 System/OS [mac] 맥(OSX)에서 NTFS, 윈도우에서 HFS+ 사용하기 file hooni 2014.03.12 5117
51 System/OS [linux] awk 명령어 hooni 2014.03.11 4955
50 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 4838
49 System/OS [linux] resolv.con 초기화 되는 문제 hooni 2014.04.05 4616
48 System/OS [linux] CentOS Apache Httpd에 https 적용 hooni 2014.03.05 4478
47 System/OS [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) hooni 2017.12.11 4457
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 Next
/ 17