6. ÅͳΠÄÚµå °³¹ßÀÚ¸¦ À§ÇÑ Netfilter ÈÅ

Tunnel µå¶óÀ̹ö Á¦ÀÛÀÚµéÀº 2.4 Ä¿³Î¿¡ ´ëÇØ¼­´Â ´ÙÀ½¿¡ º¸ÀÌ´Â ´Ü¼øÇÑ µÎ°³ÀÇ ±ÔÄ¢À» µû¸£±â ¹Ù¶õ´Ù.

ù ¹øÂ°¸¦ ¼öÇàÇϴ ǥÁØ ¹æ¹ýÀº ÆÐŶÀ» wrapÇϰųª unwrapÇϱâ Àü¿¡ ´ÙÀ½°ú À¯»çÇÑ Äڵ带 »ðÀÔÇÏ´Â °ÍÀÌ´Ù.
	/* Tell the netfilter framework that this packet is not the
          same as the one before! */
#ifdef CONFIG_NETFILTER
	nf_conntrack_put(skb->nfct);
	skb->nfct = NULL;
#ifdef CONFIG_NETFILTER_DEBUG
	skb->nf_debug = 0;
#endif
#endif
		

µÎ ¹øÂ°¸¦ ¼öÇàÇϱâ À§ÇØ ÇÊ¿ä·Î ÇÏ´Â °ÍÀº »õ·ÎÀÌ encapsulatedµÈ ÆÐŶÀÌ ``ip_send()''·Î µé¾î°¡´Â À§Ä¡¸¦ ã¾Æ³»°í, À̸¦ ´ÙÀ½°ú °°Àº °ÍÀ¸·Î ´ëüÇÏ´Â °ÍÀÌ´Ù.
	/* Send "new" packet from local host */
	NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, ip_send);
		

´ÙÀ½¿¡ º¸ÀÎ ·êÀÌ ÀǹÌÇÏ´Â °ÍÀº tunnel ¹Ú½º¿¡ ÆÐŶ ÇÊÅ͸µ ·êÀ» Àû¿ëÇϰíÀÚ ÇÏ´Â »ç¶÷ÀÌ tunnel µÇ°í ÀÖ´Â ÆÐŶ¿¡ ´ëÇØ ´ÙÀ½°ú °°Àº ÀýÂ÷¸¦ º¸°Ô µÉ °ÍÀÌ´Ù.

  1. FORWARD hook : normal packet (from eth0 -> tunl0)

  2. LOCAL_OUT hook : encapsulated packet (to eth1)

ÀÀ´ä ÆÐŶ¿¡ ´ëÇØ¼­´Â

  1. LOCAL_IN hook: encapsulated reply packet (from eth1)

  2. FORWARD hook: reply packet (from eth1 -> eth0).