Contents

System/OS
2003.04.23 10:34

[linux] 간단한 NAT 설정 script

Views 12595 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] apache, php, jsp 환경설정하기.. hooni 2003.04.23 15230
57 System/OS [linux] 랜카드 2개 설정 & iptables 로 사설 ip.. hooni 2003.04.23 14730
» System/OS [linux] 간단한 NAT 설정 script hooni 2003.04.23 12595
55 System/OS [linux] iptables 명령어 매뉴얼(options) hooni 2003.04.23 11333
54 System/OS [linux] 패킷의 소스 주소 바꾸기 hooni 2003.04.23 18784
53 System/OS [linux] 패킷 스니퍼링 hooni 2003.04.23 16315
52 System/OS [windows] 배치(bat)파일 제작 방법 hooni 2003.04.23 17002
51 System/OS [windows] 여러가지 활용 팁 hooni 2003.04.23 19969
50 System/OS [windows] 도스 사용 팁 hooni 2003.04.23 17806
49 System/OS [windows] 98/ME 속도 빠르게 튜닝(부팅,메모리,레지스터) hooni 2003.04.23 50439
48 System/OS [linux] ipfwadm를 이용한 패킷필터링(구버전) hooni 2003.04.23 13015
47 System/OS [linux] ipchains 사용예(패킷 필터링) hooni 2003.04.23 14171
Board Pagination Prev 1 ... 8 9 10 11 12 13 14 15 16 17 Next
/ 17