System/OS
2003.04.23 10:34
[linux] 간단한 NAT 설정 script
Views 12662 Comment 0
#!/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 로 수정
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
117 | System/OS | [linux] Proftpd 설치 가이드 | hooni | 2003.04.23 | 13084 |
116 | System/OS | [linux] 기존 환경설정 저장하면서 커널 컴파일.. | hooni | 2003.04.23 | 13535 |
115 | System/OS | [linux] 스케쥴링 순서(nice) 변경하기 | hooni | 2003.04.23 | 12607 |
114 | System/OS | [linux] 셀 스크립트 if, for, case in.. | hooni | 2003.04.23 | 13759 |
113 | System/OS | [linux] 종료와 종료코드 확인(환경변수에서) | hooni | 2003.04.23 | 15623 |
112 | System/OS | [linux] 프로세스 상태확인(ps) | hooni | 2003.04.23 | 12774 |
111 | System/OS | [linux] 메타(기호)문자의 의미와 사용 | hooni | 2003.04.23 | 16475 |
110 | System/OS | [linux] 특수문자 환경 설정(stty) | hooni | 2003.04.23 | 15350 |
109 | System/OS | [linux] Oracle8.1.6, Mysql+PHP+Zend Optimizer+APACHE+Tomcat(jsp,servlet)+IMAP+gd | hooni | 2003.04.23 | 32530 |
108 | System/OS | [linux] apache, php, jsp 환경설정하기.. | hooni | 2003.04.23 | 15316 |
107 | System/OS | [linux] 랜카드 2개 설정 & iptables 로 사설 ip.. | hooni | 2003.04.23 | 14783 |
» | System/OS | [linux] 간단한 NAT 설정 script | hooni | 2003.04.23 | 12662 |