System/OS
2003.04.23 10:34
[linux] 간단한 NAT 설정 script
조회 수 12597 댓글 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 로 수정
번호 | 분류 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|---|
813 | Develop | [c] 단기과정[01/14] 파일 입출력 | hooni | 2003.04.23 | 6821 |
812 | Develop | [c] 웹 메모장.. ㅋㅋ | hooni | 2013.04.23 | 6823 |
811 | Develop | [c++] 프리렉(freelec) 예제 자료.. ㅋㄷ | hooni | 2013.04.23 | 6835 |
810 | Develop | [js] 수명체크 프로그램 ㅋㅋ | hooni | 2013.04.23 | 6838 |
809 | Develop | [c] 문자열 str_shift 예제.. | hooni | 2013.04.23 | 6839 |
808 | Develop | [js] get방식, url이후 모두 그대로 읽어오기.. | hooni | 2013.04.23 | 6841 |
807 | Develop | [ajax] 샘플 코드와 한글처리에 대한 간단한 설명 | hooni | 2013.04.23 | 6842 |
806 | Develop | [pdf] 윈도우즈 95 시스템 프로그래밍(Windows 95 system programming) | hooni | 2013.04.23 | 6842 |
805 | Develop | [js] 사라지는 브라우저 | hooni | 2003.04.23 | 6857 |
804 | Develop | [c] 라인수 입력받아 마름모꼴 출력하기.. | hooni | 2003.04.23 | 6868 |
803 | Develop | [c] 간단한 순위 루틴.. (정보처리기사) | hooni | 2003.04.23 | 6874 |
802 | Develop | [c] 프로세스간의 통신(파이프) | hooni | 2003.04.23 | 6891 |