System/OS
2003.04.23 10:34
[linux] 간단한 NAT 설정 script
조회 수 12662 댓글 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 로 수정
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
202 | System/OS | [apache2] Redirect HTTP to HTTPS | hooni | 2022.02.03 | 843 |
201 | System/OS | [macos] How to Fix ‘You Shut Down Your Computer Because of a Problem’ | hooni | 2022.06.01 | 957 |
200 | System/OS | 개인적으로 쓰고 있는 bash_profile | hooni | 2015.01.16 | 991 |
199 | System/OS | [linux] The Ultimate Wget Download Guide With 15 Awesome Examples | hooni | 2020.05.26 | 992 |
198 | System/OS | 개인적으로 쓰고 있는 zshrc 파일 | hooni | 2022.02.25 | 1007 |
197 | System/OS | [mac] How to uninstall MySQL on Mac OS. | hooni | 2017.11.08 | 1047 |
196 | System/OS | [virtualbox] VirtualBox에 Ubuntu 설치하기 | hooni | 2019.11.22 | 1072 |
195 | System/OS | [펌] 마이크로서비스, 모노리포, SRE, ... 덮어놓고 구글 따라하면 안 되는 기술들 | hooni | 2020.10.15 | 1106 |
194 | System/OS | [mac] 패키지 매니저, MacPort | hooni | 2015.01.03 | 1129 |
193 | System/OS | 콘솔에서 패스워드 걸린 zip 압축하는 명령 | hooni | 2018.03.02 | 1133 |
192 | System/OS | [svn] Can't convert string from native encoding to 'UTF-8' 메시지가 나오는 경우 | hooni | 2014.12.18 | 1163 |
191 | System/OS | [mac] OS X 엘 캐피탄에서 Soudflower 사용하기 2 | hooni | 2016.10.03 | 1177 |