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
26 System/OS [linux] iptables 초간단 세팅 스크립트 hooni 2017.09.26 1235
25 System/OS 무료로 HTTPS 적용하기 (Let's Encrypt) file hooni 2017.10.28 1401
24 System/OS OpenSSL로 ROOT CA 생성 및 SSL 인증서 발급하기 hooni 2017.10.28 1455
23 System/OS [mac] How to uninstall MySQL on Mac OS. hooni 2017.11.08 884
22 System/OS [linux] 초간단 Postfix, Covecot, SSL/TLS (SMTP) file hooni 2017.12.11 9322
21 System/OS [linux] 초간단 SquirrelMail 설치/설정 (다람쥐 메일) hooni 2017.12.11 4456
20 System/OS 콘솔에서 패스워드 걸린 zip 압축하는 명령 hooni 2018.03.02 937
19 System/OS [mac] 맥에서 기본 실행 앱 변경하기 file hooni 2018.03.02 1804
18 System/OS How to Setup an Email Server on CentOS 7 hooni 2018.04.05 2779
17 System/OS 서버 확장을 위한 두 가지 방법 file hooni 2018.08.29 2096
16 System/OS Mac에서 Node.js 설치하기 file hooni 2018.09.28 4185
15 System/OS [virtualbox] VirtualBox에 Ubuntu 설치하기 file hooni 2019.11.22 906
14 System/OS SSH Passwordless Login Using SSH Keygen in 5 Easy Steps file hooni 2019.11.22 1386
13 System/OS RPA란? 어디에 어떻게 쓰이고 누가 만드나? file hooni 2020.01.28 1353
12 System/OS Configure Postfix to Use Gmail SMTP on Ubuntu 18.04 file hooni 2020.02.07 1246
11 System/OS [linux] The Ultimate Wget Download Guide With 15 Awesome Examples hooni 2020.05.26 797
Board Pagination Prev 1 ... 9 10 11 12 13 Next
/ 13