<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>My Trace</title>
    <link>https://damduc.tistory.com/</link>
    <description>나의 흔적들...</description>
    <language>ko</language>
    <pubDate>Sat, 25 Jul 2026 20:40:40 +0900</pubDate>
    <generator>TISTORY</generator>
    <ttl>100</ttl>
    <managingEditor>C.담덕</managingEditor>
    <image>
      <title>My Trace</title>
      <url>https://t1.daumcdn.net/cfile/tistory/126C294E4D748E8217</url>
      <link>https://damduc.tistory.com</link>
    </image>
    <item>
      <title>NFS mount 시, Operation Not Permitted</title>
      <link>https://damduc.tistory.com/439</link>
      <description>&lt;pre id=&quot;code_1568013454479&quot; class=&quot;html xml&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;# mount -t nfs -o nolock 192.168.0.100:/home/test/nfs nfs&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;OSX 에서 위의 명령어로 nfs mount 시, Operation Not Permitted 메시지가 발생하면 mount 가 되지 않았다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;이때 아래의 옵션을 추가하여 진행해서 해결하였다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre id=&quot;code_1568013530688&quot; class=&quot;html xml&quot; data-ke-type=&quot;codeblock&quot;&gt;&lt;code&gt;# mount -t nfs -o nolock,resvport,rw,nfc 192.168.0.100:/home/test/nfs nfs&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;각각의 옵션은 다음과 같다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;nolock : 2개 이상의 클라이언트에서 동일한 파일을 엑세스할 때, 잠금 설정을 해제&lt;/p&gt;
&lt;p&gt;resvport : 인증되지 않는 엑세스 허용&lt;/p&gt;
&lt;p&gt;rw : 읽기/쓰기 권한을 모두 주기&lt;/p&gt;
&lt;p&gt;nfc : 한국어(utf-8)로 된 디렉토리/파일은 이것을 설정해줘야 제대로 인식 된다.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
      <category>Smart Device/MAC</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/439</guid>
      <comments>https://damduc.tistory.com/439#entry439comment</comments>
      <pubDate>Mon, 9 Sep 2019 16:23:31 +0900</pubDate>
    </item>
    <item>
      <title>[Hi sierra] ftp/telnet 유틸 설치</title>
      <link>https://damduc.tistory.com/426</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;MAC 하이 시에라로 업데이트 하면서 telnet / ftp 클라이언트 유틸들이 사라져 버렸다. 개발 시 많이 쓰는 유틸들이라 불편해서 Homebrew를 이용하여 설치하였다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;table class=&quot;txc-table&quot; width=&quot;645&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; style=&quot;border:none;border-collapse:collapse;;font-family:&quot; 맑은=&quot;&quot; 고딕&quot;,=&quot;&quot; sans-serif;font-size:13px&quot;=&quot;&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td style=&quot;width:645;height:24;border-bottom:1px solid #ccc;border-right:1px solid #ccc;border-top:1px solid #ccc;border-left:1px solid #ccc;;&quot;&gt;&lt;p&gt;&amp;nbsp;$ brew install inetutils&amp;nbsp;&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Smart Device/MAC</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/426</guid>
      <comments>https://damduc.tistory.com/426#entry426comment</comments>
      <pubDate>Fri, 20 Oct 2017 10:38:50 +0900</pubDate>
    </item>
    <item>
      <title>svn resolve / resolved</title>
      <link>https://damduc.tistory.com/423</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;update 시에 충돌이 났을 경우 즉시 해결도 가능하지만,&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;(p)ostpone 을 선택했을 경우 충돌(C) 상태는 resolve 와 resolved 명령으로 충돌 해결이 가능합니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;충돌 해결이란 보통 머지(G) 나 수정(M) 상태로 만드는 것을 말합니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;resolve / resolved 명령은 비슷해 보이지만 다릅니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;resolve 명령은 여러 옵션을 사용할 수 있지만 resolved 명령은 간단합니다.&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;resolve&lt;/strong&gt;&lt;/span&gt;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(65, 116, 217);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; font-size: 11pt;&quot;&gt;usage : svn resolve --accept ARG [PATH...]&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;작업 사본 파일이나 디렉토리들의 충돌을 해결합니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;파일의 상태가 충돌(C)일 경우 .mine .r1 .r2 등의 파일들이 생성되었을 때,&amp;nbsp;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;생성된 파일들을 삭제하고 충돌을 해결하기 위해 사용됩니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;충돌난 내용을 모두 숙지 후에 행해야할 명령어 입니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;ARG 는 다음 중 하나의 옵션이 포함되어야 합니다.&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;base&lt;/strong&gt;&amp;nbsp;&lt;/span&gt;: 작업 사본을 갱신하기 전의 리비전(BASE)의 파일을 선택&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;working&lt;/span&gt;&lt;/strong&gt;&amp;nbsp;: 현재 작업 사본의 충돌 파일을 수동으로 해결하기 위해 충돌난 부분이 명시된 파일 선택 (수동 수정 필요)&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span id=&quot;callbacknestwwwoops4ucom16873617&quot; style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; width: 1px; height: 1px; float: right;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;mine-conflict&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;: 충돌난 부분만 본인이 작업한 파일로 선택&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;theirs-conflict&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;: 충돌난 부분만 타인이 작업한 파일로 선택&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;mine-full&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;: 전체 내용을 본인이 작업한 파일로 선택&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(0, 85, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;theirs-full&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;: 전체 내용을 타인이 작업한 파일로 선택&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;margin: 0px; padding: 10px; border: 1px dashed rgb(203, 203, 203); line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px;&quot;&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;$ svn st&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test.html.r67&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test.html.r68&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;?&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test.html.mine&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test.html&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;$&amp;nbsp;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(255, 94, 0);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;svn resolve --accept working&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;test.html&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;Resolved conflicted state of 'test.html'&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;$ svn st&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;M&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; test.html&lt;/p&gt;&lt;/div&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; background-color: rgb(255, 0, 0); color: rgb(255, 255, 255);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;resolved&lt;/strong&gt;&lt;/span&gt;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; font-size: 11pt;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(65, 116, 217);&quot;&gt;usage : svn resolved PATH...&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;작업 사본 파일이나 디렉토리들의 충돌(C) 상태를 제거합니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;이 명령은 실제로 충돌을 해결하지 않고, 충돌 표시만 없앱니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;충돌에 관련되어 생성된 파일들을 제거하며, PATH는 다시 커밋할 수 있는 상태가 됩니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&quot;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(255, 94, 0);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;svn resolve --accept working&lt;/strong&gt;&lt;/span&gt;&quot; 실행과 동일하게 처리됩니다.&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;margin: 0px; padding: 10px; border: 1px dashed rgb(203, 203, 203); line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px;&quot;&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;$ svn update&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;Updating '.':&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;C&amp;nbsp;&amp;nbsp;&amp;nbsp; foo.c&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;Updated to revision 31.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;Summary of conflicts:&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&amp;nbsp; Text conflicts: 1&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;$&amp;nbsp;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; color: rgb(255, 94, 0);&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;svn resolved&lt;/strong&gt;&lt;/span&gt;&amp;nbsp;foo.c&lt;/p&gt;&lt;/div&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;충돌 발생시 해당 파일을 수정 후에 이 명령을 이용하면 .mine .r(base) .r(prev) 가 자동 삭제되어 유용합니다.&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;위 예제들에서 보다시피 두 명령의 차이라면,&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; background-color: rgb(124, 67, 177); color: rgb(255, 255, 255);&quot;&gt;$ svn resolve --accept working test.html&lt;/span&gt;&amp;nbsp;명령을 사용하려 한다면&lt;br style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border: none; line-height: 1.5; background-color: rgb(70, 115, 255); color: rgb(255, 255, 255);&quot;&gt;$ svn resolved test.html&lt;/span&gt;&amp;nbsp;명령을 사용하는 것이 더 편리하다... 는 점입니다.&lt;/p&gt;&lt;p style=&quot;margin-right: 0px; margin-left: 0px; padding: 0px; border: none; line-height: 1.5; font-family: &amp;quot;Nanum Gothic&amp;quot;, dotum, sans-serif; color: rgb(113, 113, 113); font-size: 12px; background-color: rgb(236, 236, 236);&quot;&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;출처 : http://www.oops4u.com/1687&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Linux&amp;amp;Unix/일반</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/423</guid>
      <comments>https://damduc.tistory.com/423#entry423comment</comments>
      <pubDate>Mon, 28 Nov 2016 11:23:19 +0900</pubDate>
    </item>
    <item>
      <title>svn repository 주소 변경</title>
      <link>https://damduc.tistory.com/415</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;SVN 에서 checkout 받은 repository의 주소가 변경 되었을 때, 다음과 같이 주소를 변경한다.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;txc-textbox&quot; style=&quot;border: 1px solid rgb(219, 232, 251); padding: 10px; background-color: rgb(219, 232, 251);&quot;&gt;&lt;p&gt;svn switch --relocate CUR_URL NEW_URL&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Linux&amp;amp;Unix/tools</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/415</guid>
      <comments>https://damduc.tistory.com/415#entry415comment</comments>
      <pubDate>Mon, 22 Aug 2016 09:22:55 +0900</pubDate>
    </item>
    <item>
      <title>갤럭시 시리즈 터치잘 안될 때</title>
      <link>https://damduc.tistory.com/414</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;전화 창에서&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;*#2663#&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;입력 후 &quot;TSP FW update&quot; 하면 터치 감도가 좋아진다.&lt;/p&gt;</description>
      <category>Smart Device</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/414</guid>
      <comments>https://damduc.tistory.com/414#entry414comment</comments>
      <pubDate>Sun, 3 Apr 2016 17:59:30 +0900</pubDate>
    </item>
    <item>
      <title>os x enable routing</title>
      <link>https://damduc.tistory.com/413</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;sudo sysctl -w net.inet.ip.forwarding=1&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Smart Device/MAC</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/413</guid>
      <comments>https://damduc.tistory.com/413#entry413comment</comments>
      <pubDate>Thu, 3 Mar 2016 17:17:07 +0900</pubDate>
    </item>
    <item>
      <title>iptables</title>
      <link>https://damduc.tistory.com/412</link>
      <description>&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;톰캣 서버가 자동으로 8080포트를 열어 쓰는데, 80포트로 들어오는 일반적인 접속도 8080으로 리다이렉트 시켜주고&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;싶었다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;찾아본 결과 방법은 다음과 같았다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;b&gt;# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이후&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;b&gt;# iptables -t nat -L&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;을 사용해서 테스트한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;만약에 서버를 종료했을 때에도 이 설정이 유지되길 바란다면&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;/etc/sysconfig/iptables-config&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;를&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;IPTABLES_SAVE_ON_STOP=&quot;yes&quot;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;처럼 수정해주면 될 듯 하다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이하는 iptables에 대한 설명 글.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;iptables은 강력한 패킷필터링 툴입니다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;기존의 iptables에 관한 자세한 문서들이 많이 나와있지만&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이 문서는 리눅스 환경을 전제로 하며 iptables의 초심자들을 위해 설명을 하고자 합니다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;오타나 틀린 내용이 있으면 홈페이지에 관련부분을 기제해주기바랍니다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;작성일 2002.10.13&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;작성자 : 김창현 [CTCquatre] http://www.eyetolife.com&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 패킷필터링 지식 ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷필터링이란?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷필터링은 지나가는 패킷의 해더를 보고 그 전체 패킷의 운명을 결정하는 것을 말한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;(iptables의 경우 많은 개발중인 기능에서 헤더에 그치지 않고 data의 내용을 검토하기도 한다. 가장 대표적인것이 string match기능이다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;*:(일반적으로 패킷은 헤더와 데이타를 가진다. 헤더에 필터링할 정보인 출발지IP:PORT,도착지 IP:PORT, checksum,프로토콜 옵셋등을 가지며 데이터는 각각의 전송데이터가 들어간다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;리눅스 박스의 패킷필터링의 역사&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;리눅스는 커널 1.1버젼 부터 패킷필터링을 포함하기 시작했다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;제 1세대는 BSD의 ipfw을 기본으로 하였고&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;2.0버젼에서 ipfwadm이 사용되었으며&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;1998년에 2.2기반 패킷필터링툴인 ipchains를 내놓았다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그리고 이글에서 논의하고자 하는 제 4세대 필터링툴인 iptables이 2.4커널을 위해&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;만들어졌다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;netfilter?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;일반 iptables사용자들이 가장간과하기 쉬운부분중 한 부분이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;iptables이 패킷을 필터링 하는것이 아니다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷필터링은 커널에 탑제된 netfilter기능으로 하며&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;iptables은 단지 netfilter의 룰을 세워줄 뿐이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉 다시 말하자면 iptables은 룰셋구축 툴이라는 말이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 패킷필터링 ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;iptables에 대해&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;iptable에 기본 Chain은 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;INPUT chain&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;FORWARD chain&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;OUTPUT chain&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 3가지가 기본 체인이다. 체인들의 모식도는 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;------&amp;gt;INPUT------&amp;gt; Linux Box ------&amp;gt;OUTPUT---------&amp;gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;---------↕----------------------------↕&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;---------└--------- FORWARD ----------┘&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;여러분의 Linux box를 도착지로 삼는 모든패킷은 INPUT Chain을 통과하게 되며&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;여러분의 Linux box에서 생성되 외부로 보내지는 모든패킷은 OUTPUT Chain을&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;통과하게 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;Forward chain은 *엄밀히 말하자면 도착지가 여러분의 Linux box가 아닌 패킷이 통과하게 되는 체인이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;*:(다음문서에 다루게 될 Masqurading시에 패킷의 destnationIP정보는 여러분의 Linux box이지만 패킷의 최종도착지는 내부네트워크의 어떠한 컴퓨터일것이다)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;지금 커맨드라인에 아래와 같이 쳐보기 바란다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;엔터키를 누르는 즉시 여러분의 Linux box로 오는 패킷은 모두 거부당할것이다. 즉 모든 통신이 끊어진다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 룰을 굳이 말로 옮기자면&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-A:룰을 추가한다&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;INPUT: 패킷이 들어오는 체인에&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-j:패킷의 운명을 결정한다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;DROP: 패킷을 버려라.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉, INPUT체인으로 들어오는 패킷을 모두 버리는 룰을 추가하는 명령이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;적용시킨 룰을 보고 싶다면&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -L&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이라는 명령을 치면된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-A와 같은 위치에 있는 옵션은 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인에 새로운 규칙을 추가하기 (-A)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인의 어떤 지점에 규칙을 삽입하기 (-I)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인의 어떤 지점의 규칙을 교환하기 (-R)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인의 어떤 지점의 규칙을 제거하기 (-D)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인에서 일치하는 첫번째 규칙을 제거하기 (-D)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이제 위에서 내린 룰을 지워 통신이 되게 하자.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;아래와 같이 명령을 내리면 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -D INPUT 1&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;또는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -D INPUT -j DROP 하면 될것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;첫번째 방법은 index(룰의 순서)를 지정해서 지우는 방법이고, 두번째는 룰의 내용으로 지우는것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-I,-R은 첫번째 방법과 유사하게 쓸수있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;룰을 다시 세우고 목록을 보자.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -L&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;살펴보면&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;Chanin INPUT (policy ACCEPT)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위와 같은 줄을 볼수있을것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;저 줄 밑에는 여러분들이 세운 룰의 정보를 볼수있을것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;(policy ACCEPT)를 설명하자면 여러분들이 세운룰에 해당되지 않을때&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;마지막으로 기본정책을 따라 패킷의 운명을 결정하게 된다. 여기서는 ACCEPT이므로&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷은 받아드려질것이다. 아지만 이것을 DROP으로하면 패킷은 버려질것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그리고 패킷필터링을 알아가면서 여러룰들을 세울것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;기본적으로 룰은 세워진 순서대로 패킷을 검사한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이제 기본정책을 바꾸어 보자.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -P INPUT DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 명령을 내리고 다시 iptables -L을 하면&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;Chanin INPUT (policy DROP)으로 된걸 볼수있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-P와 동등 위치의 옵션은 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;새로운 체인 만들기 (-N).&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;비어있는 체인을 제거하기 (-X).&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ 이 두옵션은 직접체인을 만들었을경우와 제어할경우에 해당된다. 기본체인(INPUT,OUTPUT,FORWARD) 에는 해당되지 않는다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;미리 만들어진 체인의 정책을 바꾸기 (-P)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;어떤 체인의 규칙들을 나열하기 (-L)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인으로부터 규칙들을 지우기 (-F)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;체인내의 모든 규칙들의 패킷과 바이트의 카운드를 0 으로 만들기 (-Z)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 패킷의 목적지또는 출처 제어 ]&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷출처 제어옵션 -s&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -s 192.168.10.10 -j DROP&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위에 같은 명령을 내렸다면 192.168.10.10으로 부터 온 패킷은 모두 버려지게 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-s(--source,--src와 같은 옵션이다.) : 패킷의 출처 IP 지정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;목적지 제어옵션 -d&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUt -d 192.168.10.12 -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위와 같은 명령을 내렸다면 192.168.10.12의 IP를 도착지로 가지고있는 패킷은 모두 버려지게된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-d(--destination,--dst와 같은 옵션이다.): 패킷의 도착지 IP지정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ IP지정 이외에 몇 가지 방법이 더 존재한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-s www.xxxx.com : 도메인으로 제어&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-s 192.168.10.0/24 : 네트워크 또는 집단으로 제어&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-s 192.168.10.0/255.255.255.0 :위와 동일&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ 보통 프로그래밍 약속기호처럼 !는 역('not')이라는 것을 표시한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ex) -s ! 192.168.10.10 이라고 하면 &quot;출발지가 192.168.10.10이 아닌&quot; 이라는 뜻이된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 프로토콜 제어 ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;프로토콜제어 옵션은 -p이다&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-p옵션의 인자는 TCP,UDP,ICMP가 될수있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p TCP -j ACCEPT&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;라는 명령을 내렸다면 tcp프로토콜을 쓰는 모든 패킷은 ACCEPT에 의해 허락될것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ -p의 인자로 TCP,UDP,ICMP의 프로토콜번호를 알고있다면 번호를 써도 상관없다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;포트 제어&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;포트제어 옵션은 --sport와 --dport이다&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--sport는 패킷의 출발지 포트이다.( --source-port와 같은 옵션이다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--dport는 패킷의 도착지 포트이다.( --destination-port와 같은 옵션이다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p tcp --dport 80 -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위와 같은 명령은 tcp프로토콜의 80(www:웹서버포트)번 포트를 목적지로 하는 패킷을&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;버리는 것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ --dport나 --sport의 인자로 서비스이름을 적어도 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ex) --dport www&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ 여러 포트를 지정해야 된다면 --dport 1024:65535 와 같이 지정할수있다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;뜻은 1024 부터 65535번까지라는 뜻이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 인터페이스 지정 ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;인터페이스는 -i (input interface), -o (output interface)로 지정할수있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -i eth0 -p tcp --dport 80 -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 명령은 -i eth0옵션을 빼고는 port지정 예와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-i eth0는 eth0로 들오는 모든 패킷을 뜻한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;보통 리눅스 박스처럼 인터넷과 연결된 디바이스가 1개라면 필요없는 옵션이 되겠지만&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;만약 eth0, eth1등 2개이상의 인터페이스가 인터넷과 연결되어있다면 위의 옵션은 유용하게 쓰일것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ INPUT 체인은 -i 옵션만 쓸수 있고, OUTPUT 체인에는 -o옵션만 쓸쑤있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;반면에 FORWARD 체인은 -i,-o 옵션 두가지 다 쓸쑤있다. 이유는 다음문서에서 다루겠다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;총괄적인 예:&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -i eth0 -d 192.168.10.10 -p tcp --dport 80 -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;해설: INPUT 체인에 - 입력인터페이스가 eth0이고 도착지가 192.168.10.10이고&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;프로토콜은 tcp이며 도착 포트는 80(www)인 패킷은 DROP시켜라.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이제까지는 별 다른 지식이 없이도 이해할수있는 부분이었다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;하지만 지금부터 나오게될 내용은 tcp/ip의 기반적인 지식을 가지고있어야&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이해하기 쉬울것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;tcp/ip지식이 필요한 옵션에 대해서는 그에따른 자세한 설명을 하겠지만&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이해가 되지 않는 부분은 다른 문서나 책을 찾아보길 바란다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 패킷의 행동 유형에 따른 필터링(--tcp-flags,m state --state) ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;! 주의 : 밑에 나오는 모든옵션은 TCP프로토콜옵션(-p TCP)가 먼저&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;선행되어 있어야 적용되는 옵션이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;1)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--tcp-flags 옵션은 상태에 따라 유용하게 설정할수있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이 옵션을 설정하는 가장 큰 예는 한방향으로만 통신이 되게끔설정하기 위해&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;많이 사용한다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;tcp/ip는 3핸드쉐이크의 접속방식이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉. 접속요청패킷,접속허가 패킷,확인패킷&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;접속 단계를 좀더 자세하게 보면&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;C: Client S:Server&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;1) C --------- syn -------▷ S&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;2) C ◁------- syn ack ----- S&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;3) C --------- ack -------▷ S&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이런식으로 접속절차가 이루어진다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;syn패킷은 접속요청 플래그(syn)가 설정된 패킷이므로 syn패킷만 막으면 상대편에서 접속을 할수 없다는 것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ Dos공격의 일종인 Syn Flooding이 서버에 위에서 말한 syn형패킷을 무수히 많이&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;보내는 것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이제 본격적으로 --tcp-flags옵션으로 syn 접속형 패킷을 막는것을 하겠다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p TCP --tcp-flags SYN,RST,ACK SYN -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--tcp-flags에 첫번째 인자는 검사할 리스트 마스크이다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;두번째 인자는 설정되어있어야할 플래그다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉 syn,rst,ack플래그중 syn이 set이 1로 되어있으면 위의 --tcp-flags설정에&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;해당이 되므로 패킷은 DROP된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 옵션과 같은 뜻을 가진것이 있는데 그것은 --syn이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--syn은 '--tcp-flags SYN,RST,ACK SYN'의 뜻을 가지고 있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;2)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--tcp-flags보다 더 간단하게 설정하는 방법이 있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;바로 tcp의 상태천이 다이아그램을 축소시켜 놓은듯한 느낌을 받는 상태에 따른 패킷분류를 iptables은 지원한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이것은 확장기능이므로 -m 플래그로 설정은 한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;사용옵선은 -m state --state 이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;인자값으로 들어가야할 상태에따른 리스트는 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;NEW : 새로운 접속을 만드는 패킷&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ESTABLISHED :존재하는 접속에 속하는 패킷 (즉, 응답 패킷을 가졌던 것)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉 접속이 허가되고 통신하면서 발생되는 패킷이다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;RELATED :기존의 접속의 부분은 아니지만 연관성을 가진 패킷으로 .&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ICMP 에러 나 (FTP 모듈이 삽입 되어있으면) ftp 데이터&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;접속을 형성하는 패킷.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;INVALID :어떤 이유로 확인할 수 없는 패킷. 알려진 접속과 부합하지 않는 ICMP 에러와&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;'out of memory' 등을 포함한다. 보통 이런 패킷은 DROP 된다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이제 이 state 옵션을 사용해보자&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 --tcp-flags옵션에서 예제와 같은 작용을 하는 룰을 만들어보겠다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p TCP -m state --state NEW -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;왜 룰이 이렇게 되는지 차근차근 읽어보았다면 쉽게 이해가 될것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;일반적으로 서버는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p TCP --dport 특정포트 -m state --state NEW,ESTABLISHED -j ACCEPT&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이렇게 룰을 많이 세운다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;뜻은 tcp 특정 포트에 new:접속패킷과,established:통신패킷(정확히 쉽게 설명할&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;단어가 생각나지 않아 부적절하지만 통신패킷이라 부른다)을 허용하라.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그리고 클라이언트 측에서는 위의 state상태에서 NEW를 빼고 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p TCP --sport 특정포트 -m state --state ESTABLISHED -j ACCEPT&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;왜 NEW를 뺄까? 그 이유는&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그 이유는 클라이언트입장에서 보면 접속을 허가해달라는 패킷이 필요없다는것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;더 쉽게 말하자면 클라이언트는 접속허가를 요청하는 위치이지 요청받는&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위치가 아니라는 말이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그러므로 ESTABLISHED만 있으면 일반적으로 통신하는데 아무런 문제가 없다&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;그리고 주의깊게 본 사람이라면 위에 --sport가 쓰여진것을 볼수있을것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;왜 서버에서는 --dport로 제어를 하면서 클라이언트는 --sport로 제어를 할까?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;지금 리눅스 박스라면 wget을 쓰던지 x-windows에서 브라우져를 쓰던지 아무런 웹사이트에 접속을 하고 바로 콘솔에서 'netstat -nat'라는 명령을 내려보자.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;무슨말인지 알겠는가?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;서비스를 한번이라도 해본적있는 사람이면 알겠지만 서버는 특정PORT를 열어놓고 접속을 기다린다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;클라이언트는 특정 서버에 접속을 하기 위해 별도로 포트를 생성하고 접속을 시도한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이때 클라이언트가 생성하는 포트번호는 1024이후의 랜덤값이다. 이런이유로 클라이언트입장에서는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;--dport로 제어를 하지않는게 보통이다. 제어를 하더라도 상관없다. 하지만 그것은&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;상당한 비효율적인 룰이 될것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ftp를 위한 상태천이를 이용해 룰 설정]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ftp는 참 유별난 프로토콜이다. 특히 마스커레이드때 쓰이는 nat과 잘 맞지도 않을뿐더러.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ftp서버에서 passive모드로 운영을 할시 iptables로 제어하고 싶다면 따로 모듈이 필요하다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;passive로 1025:65535까지 임이의 데이타 전송포트를 쓸때&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;상태천이로 제어를 하자면,보안상 NEW를 사용하지 않는다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉,새로운 접속을 허가하지 않고&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;RELATED로 기존접속에 관련된것만 접속을 허용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;즉 실제 룰을 보면 아래와 같다&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A INPUT -p tcp --dport 1024:65535&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;-m state --state ESTABLISHED,RELATED -j ACCEPT&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;※ 만약 NEW를 사용한다면 방화벽 구실을 못할것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;왜그런지는 직접 생각해보라 위에서 이미 충분히 설명하였다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ftp에서 위처럼 RELATED로 방화벽룰을 설정했다면&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ip_conntrack_ftp라는 모듈없이 연결이 제대로 되지 않을것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;ip_conntrack_ftp는 ftp서버의 ftp접속 추적 모듈이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;[ 조각(Fragments) 처리하기 ]&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;때때로 하나의 패킷이 한 번에 한 회선을 통과하기에는 너무 큰 경우가 발생한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이 때는 패킷이 `조각'으로 나뉘어 여러 개의 패킷으로 전송된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;받는 쪽에서는 이 조각을 모아 하나의 패킷으로 재구성한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;패킷 필터링 HOWTO에서는 nat이나 접속추적을 할때에는 분절패킷이 하나의 패킷으로&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;재구성되어 필터링되기때문에 해당되지 않는다고 명시되어 있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;하지만 위와 같은 상황이 아니라면 조각을 처리해야하나 안전성을 이유로 처리하지&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;않는 것을 권장하고 있다. 그 이유는 아래에 설명할것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;일반적으로 패킷이 분절(토막)될때 필터링을 할 정보인 특히 발신지 포트,&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;목적지 포트, ICMP 유형, ICMP 코드 또는 TCP SYN 플래그등은 첫번쩨 패킷의&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;헤더에 밖에 포함되지 않는다. 즉 두번째 분절패킷부터는 그 정보가 없다는 말이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이를 위해서 우리는 분절된 패킷을 처리하기 위해 -f 옵션을 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;하지만 -f옵션을 권장하지 않는다. 왜냐하면 첫번째 필터링정보가 담긴 헤더를 보고&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;필터링을 할때 그 패킷이 거부하는 룰에 적용되어 거부되면 분절된 패킷이 거부되지&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;않고 오더라도 그것은 하나의 패킷으로 재구성 되지 않고 버려지기 때문이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;사용법은&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;# iptables -A OUTPUT -f -d 192.168.1.1 -j DROP&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;처럼 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;위의 뜻은 192.168.1.1을 항해 나가는 분절된 패킷은 모두 버린다 이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;다시 한번 말하지만 꼭 필요한경우를 제외하고 이 옵션은 권정하지 않는다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이정도로 iptables의 기본 사용법에 대해 마치고자 한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;이문서에서는 방화벽설정에서 자주 사용하게 되는 옵션에 대해서만 언급했다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;아니 이정도 옵션들이면 어느정도 방화벽은 구성할수 있을것이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;나머지 옵션들은 man패이지나 패킷필터링 HOWTO에서 찾아보기 바란다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;여기서 다루지 않은 forward체인과 nat구성,mangle테이블사용은&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;다음문서에서 다룰것이다..&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;------------------------------------------------------------------------------------------&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;NAT에 대한 추가 참고글&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;1. NAT(Network Address Translation)란?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(1) 개요: 컴퓨터에서 인터넷을 사용하려면 IP주소를 부여받아야 한다. 보통 이러한 IP를 공인 IP라&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 부른다. 그러나 IP주소는 폭발적인 인터넷 사용인구의 증가로 IP가 부족해지는 현상이 나&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 타났다. 이러한 부족현상을 해결하는 방안중의 한 기술이 NAT이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(2) 정의: NAT란 말 그대로 네트워크의 주소를 변환하여 주는 역할을 하는 것이다. 즉 한개의 공인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IP주소를 가지고 있는데 여러개의 컴퓨터를 사용하려는 경우처럼 한대의 컴퓨터에 공인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; IP를 부여하고 나머지는 사설 IP를 부여하여 인터넷사용시에는 공인IP를 공유하여 사용할&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 수 있도록 해주는 기술이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;2. NAT의 사용예&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(1) 여러 대의 피시에서 한 개의 IP를 공유하여 인터넷을 사용하는 경우&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 공인된 IP가 부여된 컴퓨터에는 랜카드를 두개를 장착하여 하나는 공인IP를 부여하고 다른&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 하나는 사설IP가 부여된 사설네트워크 연결을 위해 사설IP를 부여하여 인터넷을 공유할 수&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(2) 한 개의 IP주소(도메인네임)에 여러 대의 서버를 연결하는 경우&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 부하분산을 위해 한 개의 도메인네임(FQDN)에 대해 여러 대의 서버를 운영하는 경우에도&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; NAT를 사용한다. 즉, www.linux.ac.kr 도메인 한개에 웹서버, 메일서버, FTP서버를 따로&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 운영하는 경우 부하평준하(Load Balance) 기능도 구현이 가능하다. 예를 들면 웹서버는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 192.168.0.1, 메일서버는 192.168.0.2 등 이런 방법으로 구현이 가능하다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(3) 투명프락시&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 학원에서 인터넷을 강의하는 경우처럼 동일 네트워크에 연결된 여러 대의 PC에서 동시에&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 같은 사이트를 연결한다. 이 경우 프록시 서버를 이용하면 그 해당사이트를 프록시서버에서&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 참조해 보다 빠른 접속을 할 수 있다. 이런 프록시 서버를 이용하려면 각 컴퓨터에 설치된&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 웹브라우저에서 프록시서버를 지정해 주어야 한다. 리눅스에 프록시서버를 설정하면 리눅스&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 를 통과하는 패킷은 자동으로 리눅스에 설치된 프록시서버 프로그램(SQUID 같은)으로 연결&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;3. iptables에서 NAT의 분류&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(1) 개요: iptables에서는 크게 두 부류의 NAT로 분류한다. 위 (1)의 경우를 SNAT(Source NAT)라&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 하고 (2)와 (3)의 경우를 DNAT(Destination NAT)라 분류한다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(2) 종류&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;1) SNAT: 패킷의 소스 어드레스를 변경한다는 의미이다. 즉 내부 어드레스인 192.168.1.2인 컴&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;퓨터가 다른 웹사이트(예를 들면 www.debian.org)를 접속하면 203.247.XX.XXX 처럼 공인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;IP로 나타나기 때문이다. SNAT는 라우팅(경로) 결정 이후에 이루어진다.(Post-routing)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;패킷의 목적지주소는 이미 정해져 있으므로(www.debian.org) 라우팅 경로는 결정되어&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;있고 패킷의 소스 주소가 리눅스를 떠나기 직전에 변경된다.(192.168.1.1 =&amp;gt; 203.247.xx&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .xxx)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;2) DNAT: 위의 개념과 반대되는 것으로 NAT를 시행하는 리눅스에서 패킷의 목적지 주소를 변경한&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;다. 패킷의 목적지 주소가 먼저 변경되고 그 변경된 주소에 의거하여 새로운 라우팅 경로&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;를 찾는다. 즉 DNAT는 라우팅 이전 단계에서 작용한다.(pre-routing)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;4. iptables를 이용한 설정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(1) SNAT(Source NAT): 기존의 IP Masquerade를 말한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;1) 사용법&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 203.247.50.3&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 203.247.50.3-203.247.50.7&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to 203.247.50.3:1-1023&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; -o는 패킷을 보내는 인터페이스 장치를 지정한다. SNAT에서는 패킷을 내보내는 장치를&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;지정할 수 있다. --to 는 나가는 패킷에 부여할 소스 주소이다. IP공유라면 --to는 인터넷&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;쪽의 공인 IP를 지정하면 된다.(지정하지 않아도 상관없다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;2) 사용예&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄱ. 한국통신 ADSL을 리눅스에 연결해 인터넷을 공유(IP MASQUERADING)하는 경우&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄴ. 고정 IP를 사용하는 리눅스에서 인터넷을 공유하는 경우&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to 203.247.50.3&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; 참고로 192.168.0.0/24는 지정하지 않아도 된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄷ. 유동 IP를 사용하여 인터넷을 공유하는 경우&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;3) 설정의 확인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -L&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; (참고) 위 설정이외에도 다음과 같은 명령을 내려서 포워딩이 가능하게 해야 한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;echo 1 &amp;gt; /proc/sys/net/ipv4/ip_forward&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(2) DNAT(Destination NAT)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;1) 개요: DNAT는 부하분산이나 평준화에만 사용하는 것은 아니다. 간단한 방화벽으로도 유용하다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;리눅스A(203.247.50.3)에 DNAT를 설정하여 웹서버와 메일서버를 각각 내부주소인 리눅스B&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;(192.168.1.11)와 리눅스C(192.168.1.12)에서 서비스 하도록 지정하고 인터넷에서 다른&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;연결은 리눅스A로 지정하면 리눅스A는 간단한 방화벽과 같은 구실을 한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;2) 사용예&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄱ. 웹서버(192.168.1.11) 분산&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -A PREROUTING -t nat -p tcp -d 203.247.50.3 --dport 80 -j DNAT \&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;--to 192.168.1.11:80&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;=&amp;gt; (설명)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- -A PREROUTING: DNAT는 먼저 목적지 주소를 변경하고 (203.247.50.3을 192.168.1.11로)&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 다음에 라우팅이 이루어진다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- -t nat: 부하분산도 nat기능이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- -p tcp: 웹(www)은 tcp를 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- -d 203.247.50.3 --dport 80: 들어오는 패킷의 목적지 주소가 203.247.50.3이고 포트번호&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 가 www(80번)인 경우만 이 규칙을 적용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- j DNAT: destination NAT&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;- --to 192.168.1.11:80 =&amp;gt; 패킷의 목적지 주소를 192.168.1.11 포트번호를 80번으로 설정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 하라는 뜻이다. 192.168.1.11 서버에서는 80번 포트에서 웹서버 프로그램을 가동해야 한&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄴ. 메일서버(192.168.1.12)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -A PREROUTING -t nat -p tcp -d 203.247.50.3 --dport 25 -j DNAT 192.168.1.12:&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;25&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; ㄷ. DNS서버를 192.168.1.10으로 변경하려면 다음과 같이 지정한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -A PREROUTING -t nat -p udp -d 203.247.50.3 --dport 53 -j DNAT --to 192.168.\&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1.10:53&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; DNS는 UDP를 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;3) 설정의 확인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -L&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 설정을 보통 포트이름등으로 보여준다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -nL&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 설정을 포트넘버등 숫자로 보여준다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;4) 설정의 해제&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -F&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;5. iptables를 이용한 투명프록시 구현&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(1) 투명프록시란?&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; 투명프록시는 내부 네트워크의 웹브라우저에서 프록시서버를 지정하지 않아도 강제로 프록시서버를&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;사용하게 하는 설정이다. 프록시를 설정하는 경우의 이점은 캐시를 사용하므로 인터넷 접속 속도를&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;빠르게 할 수 있다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(2) iptables에서 설정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;1) squid 프록시서버를 작동시킨다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;2) 리눅스 서버의 인터넷쪽에 연결된 랜카드의 인터페이스명이 eth0(203.247.50.3), 내부랜인&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;eth1의 주소가 192.168.2.1이라면 다음과 같이 명령을 내린다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 3128&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; (설명)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄱ. -t nat: 투명프록시도 패킷의 주소를 변경하는 설정이므로 nat이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄴ. -A PREROUTING: 투명프록시는 패킷의 주소를 변경하는 작업이 경로를 찾는 것보다&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 우선한다.(즉 라우팅보다 우선한다.:Pre Routing)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄷ. -i eth1: 변경할 패킷이 들어오는 장치를 지정한다. 내부랜이 eth1에 연결되어 있고&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 이 랜에 연결된 내부 네트워크 시스템들은 이 리눅스를 통해 인터넷을 사용\&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 하므로 들어오는 패킷의 장치명은 eth1이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄹ. -p tcp: 들어오는 패킷 중 tcp프로토콜만 nat를 적용한다는 뜻이다. www(80)연결은&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;tcp를 사용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㅁ. --dport 80: 들어오는 패킷의 목적지 포트가 80번(www)인 경우에만 nat를 적용한다는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;뜻이다. 따라서 ftp, telnet등은 적용을 안 받는다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㅂ. -j REDIRECT: 투명프록시는 리눅스 내부에서 패킷의 입력포트번호를 변경해 주는 방법&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㅅ. --to-port 3128: 들어오는 패킷의 목적지 포트번호를 3128번으로 변경하는 뜻이다. 목&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;적지의 IP주소는 지정하지 않았으므로 모든 인터넷 웹 검색에 대해&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;투명프록시가 적용된다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(3) 확인&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;iptables -t nat -L&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(4) 다른예&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;(조건) 투명프록시가 설치된 리눅스 서버에 웹서버를 설치해도 상관없다. 그런데 192.168.2.x네트&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 워크에서 자신의 웹서버 데이터를 접근할 때도 프록시 서버를 공유한다는 것은 아무런 의미가&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 없다. 웹서버에서 읽을 때는 홈페이지 디렉토리에서 찾고 프록시에서 찾을 때는 프록시서버의&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 캐시 디렉토리에서 찾는 차이밖에 없다. 자신의 홈페이지 데이터를 내부랜에서 수시로 변경하&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 는 경우는 오히려 프록시서버 캐시 디렉토리에서 찾으면 문제가 된다. 캐시가 지워지지 않는&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 한 변경된 홈페이지 데이터를 볼 수가 없다. 그래서 내부랜(192.168.2.x)의 윈도우에서 192.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 168.2.1리눅스 서버의 변경된 홈페이지 데이터를 즉시 확인해야 한다면 http://192.168.2.1&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 명령시에는 투명프록시가 작용하지 않아야 한다. 그 방법은 아래와 같다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A PREROUTING -i eth1 -p tcp -d ! 192.168.2.1 --dport 80 -j REDIRECT&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; --to-port 3128&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; 처음의 기본설정에 -d ! 192.168.2.1을 추가하였다.(참고로 !과 192.168.2.1사이에는&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 공백이 필요) 즉 들어오는 패킷의 목적지주소(검색사이트)가 192.168.2.1이면 투명프록&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 시를 적용하지 말라는 뜻이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(5) 설정해제&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; iptables -t nat -F&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(6) www외의 인터넷 연결에 대한 nat설정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;1) 설명: 주의할 것은 투명프록시는 오직 http 즉 www(80)검색만 해당되고 telnet이나 ftp는 적용&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;되지 않으므로 내부랜에서 인터넷의 다른 호스트에 telnet 및 ftp를 사용하려면 추가로&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;SNAT를 설정해 주어야 한다.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;2) 설정&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j SNAT --to 203.247.50.3&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; =&amp;gt; (설명)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄱ. -A ROSTROUTING&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄴ. -s 192.168.2.0/24: 192.168.2.0 네트워크로부터의 패킷에만 SNAT를 적용한다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄷ. -o eth0 : 패킷이 나가는 장치를 말한다. (eth0이 인터넷에 연결되어 있다.)&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㄹ. -j SNAT: Source NAT를 말한다. 소스 주소(192.168.2.x)를 변경한다는 뜻이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ㅁ. --to 203.247.40.3: 소스 주소를 203.247.50.3으로 변경하라는 뜻이다.&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;3) 확인&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;iptables -t nat -L&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;(7) 참고&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; 투명프록시가 적용되려면 인터넷에 나가는 패킷이 투명 프록시가 설정되어 있는 리눅스를 통과해&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;야 한다. 통과하지 않는 패킷에 대해서는 포트의 방향을 변경할 방법이 없다. 따라서 투명프록시&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp;를 사용하는 모든 내부 컴퓨터의 디폴트 게이트웨이는 리눅스에 부여된 내부 IP주소이어야 한다.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;margin: 0px; padding: 0px; font-size: 13px; border: 0px; vertical-align: baseline; color: rgb(31, 31, 31); font-family: '맑은 고딕', 'malgun gothic', 돋움, dotum, AppleGothic, sans-serif;&quot;&gt;출처:&amp;nbsp;http://yahon.tistory.com/174&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Linux&amp;amp;Unix/일반</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/412</guid>
      <comments>https://damduc.tistory.com/412#entry412comment</comments>
      <pubDate>Tue, 16 Feb 2016 10:41:55 +0900</pubDate>
    </item>
    <item>
      <title>Windows용 GNU Utils</title>
      <link>https://damduc.tistory.com/411</link>
      <description>&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;CoreUtils for Windows&lt;/p&gt;&lt;p&gt;http://gnuwin32.sourceforge.net/packages/coreutils.htm&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;GNU Make For Windows&lt;/p&gt;&lt;p&gt;http://www.equation.com/servlet/equation.cmd?fa=make&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>컴퓨터일반/S/W</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/411</guid>
      <comments>https://damduc.tistory.com/411#entry411comment</comments>
      <pubDate>Thu, 14 Jan 2016 10:20:23 +0900</pubDate>
    </item>
    <item>
      <title>[javascript] 브라우져별 unload 이벤트 할당</title>
      <link>https://damduc.tistory.com/409</link>
      <description>&lt;p&gt;if (window.attachEvent) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; /*IE and Opera*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; window.attachEvent(&quot;onunload&quot;, function() {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* ......?!@# */&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; });&lt;/p&gt;&lt;p&gt;} else if (document.addEventListener) {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; /*Chrome, FireFox*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; window.onbeforeunload = function() {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* ......?!@# */&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; };&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; /*IE 6, Mobile Safari, Chrome Mobile*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; window.addEventListener(&quot;unload&quot;, function() {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* ......?!@# */&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }, false);&lt;/p&gt;&lt;p&gt;} else {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; /*etc*/&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; document.addEventListener(&quot;unload&quot;, function() {&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* ......?!@# */&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; }, false);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;출 처 :&amp;nbsp;http://plibet.blogspot.kr/2013/09/javascript-unload.html&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description>
      <category>Programming/Java</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/409</guid>
      <comments>https://damduc.tistory.com/409#entry409comment</comments>
      <pubDate>Tue, 3 Nov 2015 14:20:37 +0900</pubDate>
    </item>
    <item>
      <title>viewDidLoad와 viewWillAppear 차이점</title>
      <link>https://damduc.tistory.com/408</link>
      <description>&lt;p&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;이 두개의 차이를 처음에는 잘 모르죠.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;아래 자세한 영문 설명이 있습니다. (윽 돌 날라온다 ...)&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;한글로 설명을 하자면....&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;view는 한개의 object죠.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;viewDidLoad는 view object가 생성된 후 발생하는 이벤트입니다. 메모리에 view가 올라온 다음이라는 것입니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;그리고 viewWillAppear는 view가 안보이다가 다시 보이게 되었을때 발생하는 이벤트입니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;뷰가 A =&amp;gt; B =&amp;gt; C 이렇게 네비게이션이 발생할때&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;처음에 A =&amp;gt; B =&amp;gt; C 갈때는 viewDidLoad와 viewWillAppear가 모두 발생합니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;C =&amp;gt; B =&amp;gt; A로 돌아올때는 viewWillAppear만 발생하는 것입니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;그다음에 A=&amp;gt;B=&amp;gt;C로 갈때도 viewWillAppear만 발생하는 것입니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;생성시점과 보여주는 시점을 분리한 것입니다.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;1) ViewDidLoad - Whenever I'm adding controls to a view that should appear together with the view, right away, I put it in the ViewDidLoad method. Basically this method is called whenever the view was loaded into memory. So for example, if my view is a form with 3 labels, I would add the labels here; the view will never exist without those forms.&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;2) ViewWillAppear: I use ViewWillAppear usually just to update the data on the form. So, for the example above, I would use this to actually load the data from my domain into the form. Creation of UIViews is fairly expensive, and you should avoid as much as possible doing that on the ViewWillAppear method, becuase when this gets called, it means that the iPhone is already ready to show the UIView to the user, and anything heavy you do here will impact performance in a very visible manner (like animations being delayed, etc).&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;3) ViewDidAppear: Finally, I use the ViewDidAppear to start off new threads to things that would take a long time to execute, like for example doing a webservice call to get extra data for the form above.The good thing is that because the view already exists and is being displayed to the user, you can show a nice &quot;Waiting&quot; message to the user while you get the data.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;color: rgb(68, 68, 68); font-family: Verdana, 굴림; letter-spacing: -1px; line-height: 18.66666603088379px;&quot;&gt;출처 :&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 9pt; line-height: 1.5;&quot;&gt;http://kapps.co.kr/bbs/board.php?bo_table=m52&amp;amp;wr_id=33&lt;/span&gt;&lt;/p&gt;</description>
      <category>Programming/swift</category>
      <author>C.담덕</author>
      <guid isPermaLink="true">https://damduc.tistory.com/408</guid>
      <comments>https://damduc.tistory.com/408#entry408comment</comments>
      <pubDate>Thu, 28 May 2015 10:34:10 +0900</pubDate>
    </item>
  </channel>
</rss>