<table width="100%" cellpadding="5" style="font-family: 굴림;">
   <tbody>
      <tr>
         <td class="lh" height="100" style="color: #222222; line-height: 18px; word-break: break-all;"><span class="content" style="color: #404040;">###################################################&nbsp;<br />#!/bin/sh&nbsp;<br /><br /># ppp0은 ADSL,modem 인터페이스, eth1은 내부이더넷&nbsp;<br /># ppp0을 EXTIF변수로 선언&nbsp;<br /># eth1을 INTIF변수로 선언&nbsp;<br />EXTIF="ppp0"&nbsp;<br />INTIF="eth1"&nbsp;<br />INTIF2="eth2"&nbsp;<br /><br />echo " External Interface: $EXTIF"&nbsp;<br />echo " Internal Interface: $INTiF"&nbsp;<br />echo " Internal Interface: $INTIF2"&nbsp;<br /><br /># iptables와 ftp사용을 위한 모듈올리기&nbsp;<br />/sbin/insmod ip_tables&nbsp;<br />/sbin/insmod ip_conntrack&nbsp;<br />/sbin/insmod ip_conntrack_ftp&nbsp;<br />/sbin/insmod iptable_nat&nbsp;<br />/sbin/insmod ip_nat_ftp&nbsp;<br /><br /># ip_forward위한 커널매개변수변경&nbsp;<br />echo "1" &gt; /proc/sys/net/ipv4/ip_forward&nbsp;<br /><br /># SLIP, PPP, or DHCP의 유동IP를 위한 커널매개변수변경&nbsp;<br />echo "1" &gt; /proc/sys/net/ipv4/ip_dynaddr&nbsp;<br /><br /># IP forwarding과 Masquerading 설정시작&nbsp;<br /># 기존에 존재하는 rule을 지우고, 새로운 룰을 적용하기위한 정책설정&nbsp;<br />iptables -P INPUT ACCEPT&nbsp;<br />iptables -F INPUT&nbsp;<br />iptables -P OUTPUT ACCEPT&nbsp;<br />iptables -F OUTPUT&nbsp;<br />iptables -P FORWARD DROP&nbsp;<br />iptables -F FORWARD&nbsp;<br />iptables -t nat -F&nbsp;<br /><br />#iptables rule정책설정&nbsp;<br />iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT&nbsp;<br />iptables -A FORWARD -i $EXTIF -o $INTIF2 -m state --state ESTABLISHED,RELATED -j ACCEPT&nbsp;<br />iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT&nbsp;<br />iptables -A FORWARD -i $INTIF2 -o $EXTIF -j ACCEPT&nbsp;<br />iptables -A FORWARD -j LOG&nbsp;<br /><br /># ip-masq설정&nbsp;<br />iptables -t nat -A POSTROUTING -o $EXTIF -j&nbsp;<br />###################################################</span></td>
         </tr>
      </tbody>
   </table>