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 [linux] 이기종간의 파일 공유(Samba) hooni 2003.04.23 14900
73 System/OS [perl] 펄 환경 설정해야 할거 ㅋㅋ hooni 2003.04.23 14992
72 System/OS [linux] 아파치설치/설정 - 사용인증 hooni 2003.04.23 15084
71 System/OS [linux] 센드메일 동적릴레이 설치 hooni 2003.04.23 15228
70 System/OS [linux] apache, php, jsp 환경설정하기.. hooni 2003.04.23 15230
69 System/OS [linux] 특수문자 환경 설정(stty) hooni 2003.04.23 15273
68 System/OS [linux] 종료와 종료코드 확인(환경변수에서) hooni 2003.04.23 15538
67 System/OS [linux] 쉘스크립트 expr hooni 2014.03.11 15616
66 System/OS [router] 설정과 기본 명령어들 모음 hooni 2013.04.23 15670
65 System/OS 라우팅 경로 결정 영향 요소 ㅋㅋ file hooni 2013.04.23 15850
64 System/OS [owasp] 10대 웹어플리케이션 보안 취약 file hooni 2013.04.23 15906
63 System/OS [windows] 원격 데스크탑(터미널 서비스) 포트 변경 hooni 2013.04.23 16304
62 System/OS [linux] 패킷 스니퍼링 hooni 2003.04.23 16315
61 System/OS [linux] 콘솔/Xwindow 에서 PC스피커 소리 없애기 hooni 2003.04.23 16352
60 System/OS [linux] 메타(기호)문자의 의미와 사용 hooni 2003.04.23 16381
59 System/OS [linux] 네트워크 커널 설정.. hooni 2003.04.23 16470
Board Pagination Prev 1 ... 7 8 9 10 11 13 Next
/ 13