System/OS
2003.04.23 10:34

[linux] 간단한 NAT 설정 script

Views 12595 Votes 0 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
74 System/OS 맥에서 파일공유 (윈도우,맥) file hooni 2013.04.25 37301
73 System/OS [mysql] mysql user 생성시 ERROR 1364 hooni 2013.04.25 28504
72 System/OS Mac OS X - Apache+PHP+MySQL 환경 서버 hooni 2013.04.25 31627
71 System/OS [mysql] MySQL server has gone away 에러 대응 hooni 2013.05.29 19224
70 System/OS [mac] 컨텍스트(Context) 메뉴 "다음으로 열기" 내용 정리 hooni 2013.07.10 18797
69 System/OS [mac] SVN 1.8 업데이트 방법 hooni 2013.09.24 14559
68 System/OS [linux] 우분투 APM + phpmyadmin 설치 hooni 2013.10.07 49319
67 System/OS [mac] Mac에서 Mac으로 원격제어하기 (맥에서 맥으로) file hooni 2013.10.08 36987
66 System/OS [mac] 맥에서 슬립(잠자기) 모드 진입을 막는 방법~ hooni 2013.10.10 30878
65 System/OS [linux] 특정 문자열 포함된 파일 찾는 명령어 hooni 2013.10.16 30609
64 System/OS [mac] Charlesproxy 간단한 설정 내용~ hooni 2013.11.12 12323
63 System/OS CentOS 6.5 USB 설치 6 file hooni 2013.12.18 37674
62 System/OS [linux] CentOS 터미널 언어 설정(한글/영어) hooni 2013.12.22 18511
61 System/OS [linux] root 전환시 패스워드 없이 su 사용하기 hooni 2013.12.22 12683
60 System/OS [linux] iconv를 이용하여 euc-kr 문서를 utf-8로 대량으로 변환하기 file hooni 2014.01.09 12217
59 System/OS [linux] CentOS 6.x Cati 설치 (yum) hooni 2014.01.17 48592
Board Pagination Prev 1 ... 7 8 9 10 11 13 Next
/ 13