바로가기 메뉴
본문내용 바로가기
메인메뉴 바로가기



Customer Center

Notice · Security Issue · Account Guide · Global Traffic Test

HOME > Customer Center > Tech Note

기술노트

IP forward 방법
2016.02.18
Echo “1” >/proc/sys/net/ipv4/ip_forward:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
기본 0 설정 1로 변경
Rc.local 파일
/etc/run.sh
ifconfig eth0:0 61.97.255.56 netmask 255.255.255.224 broadcast 61.97.255.63 up
ifconfig eth0:1 61.97.255.57 netmask 255.255.255.224 broadcast 61.97.255.63 up
ifconfig eth0:2 61.97.255.58 netmask 255.255.255.224 broadcast 61.97.255.63 up
ifconfig eth0:3 61.97.255.59 netmask 255.255.255.224 broadcast 61.97.255.63 up
/etc/run.sh
1 #!/bin/bash
2
3 iptables -t nat -F
4
5 iptables -t nat -A PREROUTING -d 110.45.143.194 -j DNAT --to 211.115.72.184
6 iptables -t nat -A POSTROUTING -d 211.115.72.184 -j SNAT --to 110.45.143.194
7
8 iptables -t nat -A PREROUTING -d 110.45.143.195 -j DNAT --to 211.115.72.185
9 iptables -t nat -A POSTROUTING -d 211.115.72.185 -j SNAT --to 110.45.143.195
10
11 iptables -t nat -A PREROUTING -d 110.45.143.196 -j DNAT --to 211.115.72.186
12 iptables -t nat -A POSTROUTING -d 211.115.72.186 -j SNAT --to 110.45.143.196
13
14 iptables -t nat -A PREROUTING -d 110.45.143.197 -j DNAT --to 211.115.72.191
15 iptables -t nat -A POSTROUTING -d 211.115.72.191 -j SNAT --to 110.45.143.197
16
17 iptables -t nat -A PREROUTING -d 110.45.143.198 -j DNAT --to 211.115.72.193
18 iptables -t nat -A POSTROUTING -d 211.115.72.193 -j SNAT --to 110.45.143.198
설정 끝
Shell>iptables –t nat –L –v
Chain PREROUTING (policy ACCEPT 476 packets, 77208 bytes)
pkts bytes target prot opt in out source destination
87 5536 DNAT all -- any any anywhere 110.45.143.194 to:211.115.72.184
1790 88828 DNAT all -- any any anywhere 110.45.143.195 to:211.115.72.185
1240 61084 DNAT all -- any any anywhere 110.45.143.196 to:211.115.72.186
128 7052 DNAT all -- any any anywhere 110.45.143.197 to:211.115.72.191
324 16836 DNAT all -- any any anywhere 110.45.143.198 to:211.115.72.193
Chain POSTROUTING (policy ACCEPT 406 packets, 29326 bytes)
pkts bytes target prot opt in out source destination
87 5536 SNAT all -- any any anywhere 211.115.72.184 to:110.45.143.194
1790 88828 SNAT all -- any any anywhere 211.115.72.185 to:110.45.143.195
1240 61084 SNAT all -- any any anywhere 211.115.72.186 to:110.45.143.196
128 7052 SNAT all -- any any anywhere 211.115.72.191 to:110.45.143.197
324 16836 SNAT all -- any any anywhere 211.115.72.193 to:110.45.143.198



이호스트데이터센터(http://www.ehostidc.co.kr)
첨부파일