Next Previous Contents

2. ©x¤èªººô¯¸©M³q«H½×¾Â¦ó³B³V¡S

¥Ø«e¦³¤T­Ó©x¤èºô¯¸¥i¨ÑÂsÄý¡R

¦Ó©x¤èªº netfilter ¶l¥ó½×¾Â¡M«h¥i¥H¨ì³o¸Ì¬Ý¡R Netfilter List.

2.1 ¦ó¬° Network Address Translation?

¤@¯ë¨Ó»¡¡M¦bºô¸ô¤W«Ê¥]±q¨ä¨Ó·½(¤ñ¤è±z®a¤¤ªº¹q¸£)¥X¥h¡MµM«á¨ì¹F¥Øªº¦a(¤ñ¤èwww.gnumonks.org)¡M·|¸g¹L³\³\¦h¦h­Ó¤£¦Pªº³s±µ(links)¡R´N§Ú©Ò¦bªº¿D¬w¨Ó»¡´N¤j¬ù¦³ 19 ­Ó¤§¦h¡C¨S¦³¥ô¦ó¤@­Ó³s±µ·|¯uªº¥h§ó§ï±zªº«Ê¥]¡R¥L­Ì¶È¶È¬O±N¤§¶Ç°e¥X¥h¦Ó¤w¡C

°²¦p¨ä¤¤¤@­Ó³s±µ·|°µ NAT ªº¸Ü¡MµM«á¥¦­Ì´N·|§ó§ï¨º¨Ç¸g¥¦¦Ó¹Lªº«Ê¥]¤§¨Ó·½©Î¥Øªº¦a¦a§}¡C¸Û¦p±z¯à·Q¹³±o¨ìªº¡M³o¨Ã«D¨t²Î³Q³]­p¦¨³o¼Ëªº¡M¦Ó¬O NAT ©Ò°µªº¤â¸}¦Ó¤w¡C³q±`­n°µ NAT ªº³s½u·|°O¦í¥¦¦p¦ó mangled «Ê¥]ªº¡MµM«á·í¦^À³«Ê¥]±q¥t¤@¤è¦V¹L¨Óªº®É­Ô¡MµM«á´N¤Ï¹L¨Ó mangling ¨º­Ó¦^À³«Ê¥]¡M©Ò¥H©Ò¦³ªF¦è³£¤u§@°_¨Ó¤F¡C

2.2 ¬°¤°»ò§Ú­n°µ NAT ©O¡S

¦b§¹¬üªº¥@¬É¸Ì¡M±zµL»Ý³o¼Ë°µ°Õ¡C¦b¥Ø«e¨Ó»¡¡MÁÙ¬O¦³¨ä²z¥Ñªº¡R

¥Î modem ¼·±µ¤Wºô

¤j¦h¼Æªº ISP ¦b±z³s¤W¥hªº®É­Ô¥u·|µ¹±z¤@­Ó³æ¤@ IP ¦a§}¡C±z³ßÅwªº¸Ü¡M¥H¥ô¦ó¨Ó·½¦a§}§â«Ê¥]°e¥X¥h³£¦æ¡M¦ý¥u¦³¦^À³¨ì³o­Ó¨Ó·½¦a§}ªº«Ê¥]¤ ¥i¥H¦^¨ì±z¨º¸Ì¡C¦pªG±z·Q¥Î¦h¥x¤£¦P¥D¾÷(¨Ò¦p®a¤¤ºô¸ô)³z¹L¸Ó³s±µ¤W internet ªº¸Ü¡M¨º±z´N­n NAT ¤F¡C

³o¤]´N¬O¤µ¤Ñ NAT ³Ì±`¥Î¤§³B¡M¦Ó¦b Linux ¥@¬É³Ì¬°¤Hª¾ªº´N¬O©Ò¿×ªº `masquerading(«Ê¥]°°¸Ë³N)' ¤F¡C§ÚºÙ¤§¬° SNAT¡M¦]¬°±z§ïÅܤF²Ä¤@­Ó«Ê¥]ªº source(¨Ó·½) ¦a§}ªº½t¬G¡C

¦h­«¦øªA¾¹

¦³®É­Ô¡M±z·|·Q¥h§ïÅܨº¨Ç¶i¤J±zºô¸ôªº«Ê¥]¤§¸ô¦V¡C³o³Ì±`¬O¦]¬°(¦p¤W­z)±z¥u¦³¤@­Ó IP ¦a§}¡M¦ý±z«o·QÅý§O¤H¯à°÷³s±µ¨ì `¯u¹ê' IP ¦a§}«á­±ªº¥D¾÷¥h¡C¦pªG±z­«¼g³o¨Ç¤º°e«Ê¥]ªº¥Øªº¦a§}¡M³o¼Ë±z´N¥i¥HºÞ²z¥¦­Ì¤F¡C

¤@­Ó±`¨£ªºÅܰʬO­t¸ü¤À¾á(load-sharing)¡M¤]´N¬O¦b¤@²Õ¾÷¾¹¤W­±¬°«Ê¥]°µ¬M¹ï(mapping)ªº°Ê§@¡C³oÃþ«¬ªº NAT ¡M¦b¥H«eªºªº Linux ª©¥»¤¤¤]´N³QºÙ¬° port-forwarding ¡C

³z©ú¥N²z(Transparent Proxying)

¦³®É­Ô¡M±z©Î³\·Q­n¨C¤@­Ó¸g¹L±zªº Linux ¥D¾÷ªº«Ê¥]°e¦Ü¥D¾÷¥»¨­ªº¤@­Óµ{¦¡¥h¡C³o´N»Ý­n¶i¦æ³z©ú¥N²zªº°Ê§@¤F¡R¤@­Ó¥N²z´N¬O¤@­Ó¦ì©ó±zªººô¸ô©M¥ ³¡ºô¸ôªºµ{¦¡¡M¬°©¼¦¹Âù¤è­t°_·¾³qªº¥ô°È¡C¦Ó©Ò¿×ªº³z©ú¡M«h¬O¦]¬°±zªººô¸ô¬Æ¦ÜµL¶·ª¾¹D¦b©M¤@­Ó¥N²z¹ïÁ¿¡M·íµM¤F¡M°£«D¥N²z¤£¦A¤u§@¤F§a¡C

Squid ¥i¥H°t¸m¦¨³o¼Ëªº¤u§@¤è¦¡¡M³o´N¬O¦b¹L©¹ªº Linux ª©¥»¤¤©Ò¿×ªº­«¾É¦V(redirection)¡N©Î³z©ú¥N²z¤F¡C


Next Previous Contents