Ìõ: º´Çì δ»Ê <saeki@jp.FreeBSD.org>
. 11 November
1996.
¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ï¡¢ ¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤Ë»²²Ã¤·¤Æ¤¤¤ë¿Í¤Ï¤â¤Á¤í¤ó¤Î¤³¤È¡¢ ¥×¥é¥¤¥Ù¡¼¥È¥Í¥Ã¥È¥ï¡¼¥¯¤Î¥»¥¥å¥ê¥Æ¥£¸þ¾å¤Î¤¿¤á¤Î ¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò õ¤·¤Æ¤¤¤ë¿Í¤Ë¤È¤Ã¤Æ¤â¡¢ ¤Þ¤¹¤Þ¤¹¶½Ì£¿¼¤¯¤Ê¤ê¤Ä¤Ä¤¢¤ëʬÌî¤Ç¤¹¡£ ¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤È¤Ï²¿¤«¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î»ÈÍÑË¡¡¢ ¤½¤·¤Æ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¹½ÃÛ¤¹¤ë¤¿¤á¤Ë FreeBSD ¤Î¥«¡¼¥Í¥ë¤Ç Ä󶡤µ¤ì¤Æ¤¤¤ë¥Õ¥¡¥·¥ê¥Æ¥£ (µ¡Ç½) ¤Î»ÈÍÑË¡¤Ë¤Ä¤¤¤ÆÀâÌÀ¤·¤¿¤¤¤È»×¤¤¤Þ¤¹¡£
注意: ¼ÒÆâ¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤È “µðÂ礫¤Ä¿®Íê¤Î¤ª¤±¤Ê¤¤ ¥¤¥ó¥¿¡¼¥Í¥Ã¥È”¤È¤Î´Ö¤Ë¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¹½ÃÛ¤¹¤ë¤³¤È¤Ç ¥»¥¥å¥ê¥Æ¥£¾å¤Î¤¹¤Ù¤Æ¤ÎÌäÂ꤬²ò·è¤Ç¤¤ë¤È¹Í¤¨¤ë¿Í¤¬¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ï¥»¥¥å¥ê¥Æ¥£¾å¤ÎÌäÂê¤ò ²ò·è¤¹¤ë½õ¤±¤Ë¤Ê¤ë¾ì¹ç¤â¤¢¤ê¤Þ¤¹¤¬¡¢ ½¼Ê¬¤ÊÀßÄ꤬¤Ê¤µ¤ì¤Æ¤¤¤Ê¤¤¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ï¡¢ ¤Þ¤Ã¤¿¤¯¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò »ý¤¿¤Ê¤¤¾ì¹ç¤è¤ê¤â¥»¥¥å¥ê¥Æ¥£¾å¤Î´í¸±¤òÁýÂ礵¤»¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ë¤Ç¤¤ë¤³¤È¤Ï¡¢ ¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Ë¤â¤¦°ì¤Ä¤Î¥»¥¥å¥ê¥Æ¥£Áؤò Äɲ乤뤳¤È¤À¤±¤Ç¡¢ Ëܵ¤¤Ç¥¢¥¿¥Ã¥¯¤ò¤·¤«¤±¤Æ¤¯¤ë¥¯¥é¥Ã¥«¡¼¤¬ÆâÉô¥Í¥Ã¥È¥ï¡¼¥¯¤Ë ¿¯Æþ¤¹¤ë¤Î¤ò˸¤²¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¿¯ÆþÉÔ²Äǽ¤È²á¿®¤·¤Æ ÆâÉô¤Î¥»¥¥å¥ê¥Æ¥£¤ò¤ª¤í¤½¤«¤Ë¤¹¤ë¤³¤È¤Ï¡¢ ñ¤Ë¥¯¥é¥Ã¥«¡¼¤Î»Å»ö¤ò¾¯¤·´Êñ¤Ë¤¹¤ë¤À¤±¤Ç¤·¤« ¤¢¤ê¤Þ¤»¤ó¡£
¸½ºß¥¤¥ó¥¿¡¼¥Í¥Ã¥È¤ÇÉáÄ̤˻ÈÍѤµ¤ì¤Æ¤¤¤ë ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ë¤Ï Æó¤Ä¤Î°Û¤Ê¤ë¥¿¥¤¥×¤¬¤¢¤ê¤Þ¤¹¡£°ì¤Ä¤Ï¡¢ ¸·Ì©¤Ë¤Ï ¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¥ë¡¼¥¿ ¤È ¸Æ¤Ð¤ì¤ë¥¿¥¤¥×¤Î¤â¤Î¤Ç¤¹¡£¤³¤ì¤Ï¥Þ¥ë¥Á¥Û¡¼¥à¤Î¥Û¥¹¥È¥Þ¥·¥ó (Ê£¿ô¤Î ¥Í¥Ã¥È¥ï¡¼¥¯¤ËÀܳ¤µ¤ì¤Æ¤¤¤ë¥Þ¥·¥ó) ¤Î¥«¡¼¥Í¥ë¤¬¡¢ ¤¢¤ëµ¬Â§¤Ë¤·¤¿¤¬¤Ã¤Æ ¥Ñ¥±¥Ã¥È¤òžÁ÷¤·¤¿¤ê¥Ö¥í¥Ã¥¯¤·¤¿¤ê¤¹¤ë¤â¤Î¤Ç¤¹¡£¤â¤¦°ì¤Ä¤Ï¡¢ proxy (ÂåÍý) ¥µ¡¼¥Ð ¤È¤·¤ÆÃΤé¤ì¤Æ¤¤¤ë¥¿¥¤¥×¤Î¤â¤Î¤Ç¤¹¡£¤³¤ì¤Ï¡¢ ¤ª¤½¤é¤¯¤Ï¥Þ¥ë¥Á¥Û¡¼¥à¤Î¥Û¥¹¥È¥Þ¥·¥ó¾å¤Ç¡¢ ¥«¡¼¥Í¥ë¤Ë¤è¤ë¥Ñ¥±¥Ã¥ÈžÁ÷¤ò ¶Ø»ß¤·¤Æ¡¢ ¥Ç¡¼¥â¥ó¤Ë¤è¤êǧ¾Ú¤ÎÄ󶡤ȥѥ±¥Ã¥È¤ÎžÁ÷¤È¤ò ¤ª¤³¤Ê¤¦¤â¤Î¤Ç¤¹¡£
Æó¤Ä¤Î¥¿¥¤¥×¤Î¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤òÁȤ߹ç¤ï¤»¤Æ»ÈÍѤ·¤Æ¡¢ ÆÃÄê¤Î¥Þ¥·¥ó (Í׺ɥۥ¹¥È ¤È¸Æ¤Ð¤ì¤ë) ¤À¤±¤¬ ¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¥ë¡¼¥¿¤òÄ̤·¤ÆÆâÉô¥Í¥Ã¥È¥ï¡¼¥¯¤Ø ¥Ñ¥±¥Ã¥È¤òÁ÷¤ë¤³¤È¤¬¤Ç¤¤ë¤è¤¦ÀßÄꤷ¤Æ¤¤¤ë ¥µ¥¤¥È¤¬¤·¤Ð¤·¤Ð¸ºß¤·¤Þ¤¹¡£proxy (ÂåÍý) ¥µ¡¼¥Ó¥¹¤ÏÄ̾ï¤Îǧ¾Úµ¡¹½¤è¤ê¤â¥»¥¥å¥ê¥Æ¥£¤ò ¶¯²½¤·¤Æ¤¢¤ë Í׺ɥۥ¹¥È¤ÇÆ°ºî¤µ¤»¤Þ¤¹¡£
FreeBSD ¤Ï (IPFW ¤È¤·¤ÆÃΤé¤ì¤ë) ¥«¡¼¥Í¥ë¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¹þ¤ß¤ÇÄ󶡤µ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤³¤ÎÀá¤Î»Ä¤ê¤Ç¤Ï¡¢¤³¤Î¥Õ¥£¥ë¥¿¤Ë¤Ä¤¤¤Æ½¸Ã椷¤ÆÀâÌÀ¤·¤Þ¤¹¡£ ¥µ¡¼¥É¥Ñ¡¼¥Æ¥£¤«¤éÄ󶡤µ¤ì¤ë¥½¥Õ¥È¥¦¥§¥¢¤ò»ÈÍѤ¹¤ë¤³¤È¤Ë¤è¤ê¡¢ Proxy ¥µ¡¼¥Ð¤ò FreeBSD ¾å¤Ë¹½ÃÛ¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ ¤·¤«¤·¡¢¸½ºßÆþ¼ê²Äǽ¤Ê proxy ¥µ¡¼¥Ð¤Ï¤¿¤¤¤Ø¤ó¥Ð¥é¥¨¥Æ¥£¤ËÉÙ¤ó¤Ç¤¤¤ë¤Î¤Ç¡¢ ¤³¤ÎÀá¤Ç¤½¤ì¤é¤¹¤Ù¤Æ¤ò¥«¥Ð¡¼¤¹¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
¥ë¡¼¥¿¤È¤Ï¡¢Æó¤Ä¤Þ¤¿¤Ï¤½¤ì°Ê¾å¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Î´Ö¤Ç ¥Ñ¥±¥Ã¥È¤ÎžÁ÷¤ò¤ª¤³¤Ê¤¦ ¥Þ¥·¥ó¤Î¤³¤È¤Ç¤¹¡£ ¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¥ë¡¼¥¿¤Ï¡¢¤½¤Î¥«¡¼¥Í¥ë¤ÎÆâÉô¤Ë¡¢ °ì¤Ä°ì¤Ä¤Î¥Ñ¥±¥Ã¥È¤ò¥ë¡¼¥ë¥ê¥¹¥È¤ÈÈæ³Ó¤·¤Æ žÁ÷¤¹¤ë¤«¤·¤Ê¤¤¤«¤ò·è¤á¤ë ÆÃÊ̤ʥ³¡¼¥É¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ ºÇ¶á¤Î IP ¥ë¡¼¥Æ¥£¥ó¥°¥½¥Õ¥È¥¦¥§¥¢¤Î¤Û¤È¤ó¤É¤Ï¡¢ÆâÉô¤Ë ¥Ñ¥±¥Ã¥È¤Î¥Õ¥£¥ë¥¿¥ê¥ó¥°¤ò¤ª¤³¤Ê¤¦¤¿¤á¤Î¥³¡¼¥É¤ò»ý¤Ã¤Æ¤¤¤Æ¡¢ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï ¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤òžÁ÷¤¹¤ë¤è¤¦¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¤³¤Î¥Õ¥£¥ë¥¿¤ò͸ú¤Ë¤¹¤ë¤¿¤á¤Ë¤Ï¡¢ ¥Ñ¥±¥Ã¥È¤ÎÄ̲á¤òµö¤¹¤Ù¤¤«¤É¤¦¤«¤ò·è¤á¤ë ¥ë¡¼¥ë¤ò¼«Ê¬¤ÇÄêµÁ¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
¥Ñ¥±¥Ã¥È¤òÄ̤¹¤Ù¤¤«Ä̤¹¤Ù¤¤Ç¤Ê¤¤¤«¤ò·è¤á¤ë¤¿¤á¤Ë¡¢ ¥Ñ¥±¥Ã¥È¥Ø¥Ã¥À¤ÎÆâÍƤ˥ޥåÁ¤¹¤ë¤â¤Î¤¬ ¥ë¡¼¥ë¥ê¥¹¥È¤«¤éõ¤µ¤ì¤Þ¤¹¡£¥Þ¥Ã¥Á¤¹¤ë¥ë¡¼¥ë¤¬¸«¤Ä¤«¤ë¤È¡¢ ¥ë¡¼¥ë¥¢¥¯¥·¥ç¥ó¤¬¼Â¹Ô¤µ¤ì¤Þ¤¹¡£¥ë¡¼¥ë¥¢¥¯¥·¥ç¥ó¤Ë¤Ï¡¢ ¥Ñ¥±¥Ã¥È¤ò¼Î¤Æ¤ë¡¢¥Ñ¥±¥Ã¥È¤òžÁ÷¤¹¤ë¡¢ ¤Þ¤¿¤Ï¥Ñ¥±¥Ã¥È¤Îȯ¿®¸µ¤Ë ICMP ¥á¥Ã¥»¡¼¥¸¤òÁ÷¤êÊÖ¤¹¤È¤¤¤¦¤â¤Î¤¬¤¢¤ê¤Þ¤¹¡£ ¥ë¡¼¥ë¤Î¸¡º÷¤ÏÀèƬ¤«¤é½çÈ֤ˤª¤³¤Ê¤ï¤ì¡¢ Ä̾ï¤ÏºÇ½é¤Ë¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤À¤±¤¬ ŬÍѤµ¤ì¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢ ¤³¤Î¥ë¡¼¥ë¥ê¥¹¥È¤Ï“¥ë¡¼¥ë¥Á¥§¡¼¥ó” ¤È¸Æ¤Ð¤ì¤ë¤³¤È¤â¤¢¤ê¤Þ¤¹¡£
¥Ñ¥±¥Ã¥È¥Þ¥Ã¥Á¥ó¥°¤Î´ð½à¤Ï»ÈÍѤ¹¤ë¥½¥Õ¥È¥¦¥§¥¢¤Ë ¤è¤Ã¤Æ°Û¤Ê¤ê¤Þ¤¹¤¬¡¢Ä̾ï¤Ï¥Ñ¥±¥Ã¥È¤Îȯ¿®¸µ IP ¥¢¥É¥ì¥¹¡¢ °¸Àè IP ¥¢¥É¥ì¥¹¡¢È¯¿®¸µ¥Ý¡¼¥ÈÈֹ桢°¸Àè¥Ý¡¼¥ÈÈÖ¹æ (¥Ý¡¼¥ÈÈÖ¹æ¤Ï¥Ý¡¼¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë¥×¥í¥È¥³¥ë¤Î¾ì¹ç¤Î¤ß)¡¢ ¥Ñ¥±¥Ã¥È¥¿¥¤¥× (UDP, TCP, ICMP ¤Ê¤É) ¤Ë´ð¤Å¤¯¥ë¡¼¥ë¤ò»ØÄꤹ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
Proxy ¥µ¡¼¥Ð¤È¤ÏÄ̾ï¤Î¥·¥¹¥Æ¥à¥Ç¡¼¥â¥ó (telnetd, ftpd ¤Ê¤É) ¤ò ÆÃÊ̤ʥµ¡¼¥Ð¤ÇÃÖ¤´¹¤¨¤¿¥Þ¥·¥ó¤Î¤³¤È¤Ç¤¹¡£ ¤³¤ì¤é¤Î¥µ¡¼¥Ð¤Ï¡¢ Ä̾ï¤ÏÃæ·Ñ¤ò¤ª¤³¤Ê¤Ã¤ÆÆÃÄêÊý¸þ¤Ø¤ÎÀܳ¤À¤±¤òµö¤¹¤¿¤á¡¢ proxy ¥µ¡¼¥Ð ¤È¸Æ¤Ð¤ì¤Þ¤¹¡£(¤¿¤È¤¨¤Ð) proxy telnet ¥µ¡¼¥Ð¤ò¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥Û¥¹¥È¤ÇÁö¤é¤»¤Æ¤ª¤¤Þ¤¹¡£ ³°Éô¤«¤é¥æ¡¼¥¶¤¬¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ËÂФ·¤Æ telnet ¤ò¼Â¹Ô¤¹¤ë¤È¡¢proxy telnet ¥µ¡¼¥Ð¤¬±þÅú¤·¤Æ¡¢ ²¿¤é¤«¤Îǧ¾Úµ¡¹½¤ò¼Â¹Ô¤·¤Þ¤¹¡£¤³¤ì¤òÄ̲ᤷ¤¿¸å¤Ç¡¢ ÆâÉô¥Í¥Ã¥È¥ï¡¼¥¯¤Ø¤Î¥¢¥¯¥»¥¹¤¬¤ª¤³¤Ê¤¨¤ë¤è¤¦¤Ë ¤Ê¤ë¤Î¤Ç¤¹¡£ (ÆâÉô¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤Î¿®¹æ¤Ï proxy ¥µ¡¼¥Ð¤¬¤«¤ï¤ê¤Ë¼õ¤±¼è¤ê¡¢³°¤Ø¸þ¤±¤ÆÁ÷¤ê½Ð¤·¤Þ¤¹)¡£
Proxy ¥µ¡¼¥Ð¤ÏÄ̾ ÉáÄ̤Υµ¡¼¥Ð¤è¤ê·ø¸Ç¤Ë¹½ÃÛ¤µ¤ì¤Æ¤¤¤Æ¡¢¤·¤Ð¤·¤Ð “»È¤¤¼Î¤Æ”¥Ñ¥¹¥ï¡¼¥É¥·¥¹¥Æ¥à¤Ê¤É¤ò´Þ¤à¡¢ ¿ÍͤÊǧ¾Úµ¡¹½¤ò»ý¤Ã¤Æ¤¤¤Þ¤¹¡£ “»È¤¤¼Î¤Æ”¥Ñ¥¹¥ï¡¼¥É¥·¥¹¥Æ¥à¤È¤Ï¡¢ ¤É¤¦¤¤¤¦¤â¤Î¤Ê¤Î¤Ç¤·¤ç¤¦¤«¡£²¾¤Ë狼¤¬²¿¤é¤«¤ÎÊýË¡¤Ç¡¢ ¤¢¤Ê¤¿¤¬»ÈÍѤ·¤¿¥Ñ¥¹¥ï¡¼¥É¤ò¼ê¤ËÆþ¤ì¤¿¤È¤·¤Þ¤¹¡£¤·¤«¤·¡¢ °ìÅÙ»ÈÍѤ·¤¿¤³¤È¤Ç¡¢ ¤½¤Î¥Ñ¥¹¥ï¡¼¥É¤Ï´û¤Ë̵¸ú¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤Î¤Ç¤¹¡£¤Ç¤¹¤«¤é¡¢ ¤½¤Î¥Ñ¥¹¥ï¡¼¥É¤ò¤â¤¦°ìÅÙ»ÈÍѤ·¤¿¤È¤·¤Æ¤â¡¢¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤Ø ¥¢¥¯¥»¥¹¤¹¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¤È¤¤¤¦¤ï¤±¤Ç¤¹¡£ ¤³¤ì¤é¤Î¥µ¡¼¥Ð¤ÏÃæ·Ñ¤ò¤ª¤³¤Ê¤¦¤À¤±¤Ç¡¢ ¼ÂºÝ¤Î¤È¤³¤í¥µ¡¼¥Ð¥Û¥¹¥È¼«¿È¤Ø¤Î ¥¢¥¯¥»¥¹¤ò¥æ¡¼¥¶¤Ëµö¤·¤Æ¤Ï¤¤¤Þ¤»¤ó¡£¤½¤Î¤¿¤á¡¢ ²¿¼Ô¤«¤¬¥»¥¥å¥ê¥Æ¥£¥·¥¹¥Æ¥à¤Ë ¿¯ÆþÍѤÎ΢¸ý¤ò¼è¤êÉÕ¤±¤ë¤³¤È¤Ï¡¢ ¤è¤êº¤Æñ¤Ë¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
proxy ¥µ¡¼¥Ð¤Ï¥¢¥¯¥»¥¹À©¸Â¤ÎÊýË¡¤ò¤¤¤¯¤Ä¤â»ý¤Ã¤Æ¤¤¤Æ¡¢ ÆÃÄê¤Î¥Û¥¹¥È ¤À¤±¤¬¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¸¢¤òÆÀ¤ë¤³¤È¤¬¤Ç¤¤ë¤è¤¦¤Ë ¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤¬¤¢¤ê¤Þ¤¹¡£ ¤½¤·¤ÆÌÜŪ¤Î¥Þ¥·¥ó¤ÈÄÌ¿®¤Ç¤¤ë¥æ¡¼¥¶¤òÀ©¸Â¤¹¤ë¤è¤¦¤Ë ÀßÄꤹ¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£¤â¤¦°ìÅÙ¸À¤¤¤Þ¤¹¤¬¡¢ ¤É¤ó¤Ê¥Õ¥¡¥·¥ê¥Æ¥£ (µ¡Ç½) ¤¬»È¤¨¤ë¤«¤Ï¡¢¤É¤ó¤Ê proxy ¥µ¡¼¥Ó¥¹¤ò¤ª¤³¤Ê¤¦¥½¥Õ¥È¥¦¥§¥¢¤òÁª¤Ö¤«¤ËÂ礤¯ °Í¸¤·¤Þ¤¹¡£
FreeBSD ¤È¤È¤â¤ËÇÛÉÛ¤µ¤ì¤Æ¤¤¤ë IPFW ¤Ï¡¢ ¥«¡¼¥Í¥ëÆâÉô¤Ë¤¢¤Ã¤Æ¥Ñ¥±¥Ã¥È¤Î¥Õ¥£¥ë¥¿¥ê¥ó¥°¤È¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¤ò¤ª¤³¤Ê¤¦¥·¥¹¥Æ¥à¤Ç¤¢¤ê¡¢ ¥æ¡¼¥¶Â¦¤Î¥³¥ó¥È¥í¡¼¥ë¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤¢¤ë ipfw(8) ¤ò´Þ¤ó¤Ç¤¤¤Þ¤¹¡£ ¥ë¡¼¥Æ¥£¥ó¥°¤Î·èÄê¤ò¤ª¤³¤Ê¤¦ºÝ¤Ë¡¢¤³¤ì¤é¤Ï¸ß¤¤¤Ë¶¨ÎϤ·¤Æ¡¢ ¥«¡¼¥Í¥ë¤Ç»ÈÍѤµ¤ì¤ë¥ë¡¼¥ë¤òÄêµÁ¤·¤¿¤ê¡¢ ¸½ºß»ÈÍѤµ¤ì¤Æ¤¤¤ë¥ë¡¼¥ë¤òÌ䤤¹ç¤ï¤»¤¿¤ê¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
IPFW ¤Ï¸ß¤¤¤Ë´ØÏ¢¤¹¤ëÆó¤Ä¤ÎÉôʬ¤«¤é¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥»¥¯¥·¥ç¥ó¤Ï ¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¤ò¤ª¤³¤Ê¤¤¤Þ¤¹¡£¤Þ¤¿¡¢IP ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥»¥¯¥·¥ç¥ó¤Ï¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥»¥¯¥·¥ç¥ó¤Î¤â¤Î¤È »÷¤¿¥ë¡¼¥ë¤Ë´ð¤Å¤¤¤Æ¥ë¡¼¥¿¤Î»ÈÍѤòÄÉÀפ·¤Þ¤¹¡£¤³¤ì¤Ë¤è¤ê¡¢ (¤¿¤È¤¨¤Ð) ÆÃÄê¤Î¥Þ¥·¥ó¤«¤é¥ë¡¼¥¿¤Ø¤Î¥È¥é¥Õ¥£¥Ã¥¯¤¬¤É¤Î¤¯¤é¤¤ ȯÀ¸¤·¤Æ¤¤¤ë¤«Ä´¤Ù¤¿¤ê¡¢¤É¤ì¤À¤±¤Î WWW (World Wide Web) ¥È¥é¥Õ¥£¥Ã¥¯¤¬ ¥Õ¥©¥ï¡¼¥É¤µ¤ì¤Æ¤¤¤ë¤«¤òÃΤ뤳¤È¤¬¤Ç¤¤Þ¤¹¡£
IPFW ¤Ï¡¢ ¥ë¡¼¥¿¤Ç¤Ï¤Ê¤¤¥Þ¥·¥ó¤Ë¤ª¤¤¤Æ¤âÆþ½ÐÎÏ¥³¥Í¥¯¥·¥ç¥ó¤Î ¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¤Î¤¿¤á¤Ë»ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤ë¤è¤¦¤ËÀ߷פµ¤ì¤Æ¤¤¤Þ¤¹¡£ ¤³¤ì¤Ï°ìÈÌŪ¤Ê IPFW ¤Î»ÈÍÑË¡¤È¤Ï°Û¤Ê¤ëÆÃÊ̤ʻȤ¤Êý¤Ç¤¹¤¬¡¢ ¤³¤¦¤¤¤Ã¤¿¾õ¶·¤Ç¤âƱ¤¸¥³¥Þ¥ó¥É¤È¥Æ¥¯¥Ë¥Ã¥¯¤¬»ÈÍѤµ¤ì¤Þ¤¹¡£
IPFW ¥·¥¹¥Æ¥à¤ÎÃæ¿´¤È¤Ê¤ëÉôʬ¤Ï¥«¡¼¥Í¥ëÆâÉô¤Ë¤¢¤ê¤Þ¤¹¡£ ¤½¤Î¤¿¤á¡¢¤É¤Î¥Õ¥¡¥·¥ê¥Æ¥£ (µ¡Ç½) ¤òɬÍפȤ¹¤ë¤«¤Ë¤è¤Ã¤Æ¡¢ 1 ¤Ä¤Þ¤¿¤ÏÊ£¿ô¤Î¥ª¥×¥·¥ç¥ó¤ò¥«¡¼¥Í¥ë¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¥Õ¥¡¥¤¥ë¤ËÄɲä·¡¢ ¥«¡¼¥Í¥ë¤òºÆ¥³¥ó¥Ñ¥¤¥ë¤¹¤ëɬÍפ¬¤¢¤ë¤Ç¤·¤ç¤¦¡£ ¥«¡¼¥Í¥ë¤ÎºÆ¥³¥ó¥Ñ¥¤¥ëÊýË¡¤Î¾ÜºÙ¤Ë¤Ä¤¤¤Æ¤Ï¡¢ ¡Ö¥«¡¼¥Í¥ë¤Î¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¡×(第9章) ¤ò¤´Í÷¤¯¤À¤µ¤¤¡£
¸½ºß¡¢IPFW ¤Ë´Ø·¸¤¹¤ë¥«¡¼¥Í¥ë¥³¥ó¥Õ¥£¥°¥ì¡¼¥·¥ç¥ó¥ª¥×¥·¥ç¥ó¤Ï »°¤Ä¤¢¤ê¤Þ¤¹¡£
¥Ñ¥±¥Ã¥È¥Õ¥£¥ë¥¿¥ê¥ó¥°¤Î¤¿¤á¤Î¥³¡¼¥É¤ò ¥«¡¼¥Í¥ë¤ËÁȤ߹þ¤ß¤Þ¤¹¡£
syslogd(8) ¤òÄ̤¸¤Æ ¥Ñ¥±¥Ã¥È¤Î¥í¥°¤ò¼è¤ë¤¿¤á¤Î¥³¡¼¥É¤ò͸ú¤Ë¤·¤Þ¤¹¡£ ¥Õ¥£¥ë¥¿¥ë¡¼¥ë¤Ç¥Ñ¥±¥Ã¥È¤Î¥í¥°¤ò¼è¤ë¤è¤¦¤Ë»ØÄꤷ¤Æ¤â¡¢ ¤³¤Î¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ ¥í¥°¤ò¼è¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
syslogd(8) ¤òÄ̤¸¤Æ ¥í¥°¤ò¼è¤ë¥Ñ¥±¥Ã¥È¤Î¿ô¤ò¥¨¥ó¥È¥êËè¤ËÀ©¸Â¤·¤Þ¤¹¡£ ŨÂÐŪ¤Ê´Ä¶¤Ë¤ª¤¤¤Æ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î Æ°ºî¤Î¥í¥°¤ò¼è¤ê¤¿¤¤¤±¤ì¤É¡¢ syslog ¤Î¹¿¿å¤Ë¤è¤ë¥µ¡¼¥Ó¥¹µñÀ乶·â¤ËÂФ· ̵ËÉÈ÷¤Ç¤¢¤ê¤¿¤¯¤Ê¤¤¤È¤¤¤¦¾ì¹ç¤Ë¡¢ ¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ÈÍѤ·¤¿¤¤¤È»×¤¦¤³¤È¤¬ ¤¢¤ë¤«¤â¤·¤ì¤Þ¤»¤ó¡£
¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤Î¥í¥°¤¬»ØÄꤵ¤ì¤¿À©¸Â¿ô¤Ë㤹¤ë¤È¡¢ ¤½¤Î¥¨¥ó¥È¥ê¤Ë´Ø¤¹¤ë¥í¥°¼è¤ê¤ÏÄä»ß¤µ¤ì¤Þ¤¹¡£ ¥í¥°¼è¤ê¤òºÆ³«¤¹¤ë¤Ë¤Ï¡¢ipfw(8) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤ò»ÈÍѤ·¤Æ ´ØÏ¢¤¹¤ë¥«¥¦¥ó¥¿¤ò¥ê¥»¥Ã¥È¤¹¤ëɬÍפ¬¤¢¤ê¤Þ¤¹¡£
# ipfw zero 4500
4500 ¤È¤Ï¡¢ ¥í¥°¼è¤ê¤ò³¹Ô¤·¤¿¤¤¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤ÎÈÖ¹æ¤Ç¤¹¡£
注意: °ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î FreeBSD ¤Ï IPFIREWALL_ACCT ¤È¤¤¤¦¥ª¥×¥·¥ç¥ó¤ò »ý¤Ã¤Æ¤¤¤Þ¤·¤¿¡£¤·¤«¤·¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥³¡¼¥É¤¬¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥Õ¥¡¥·¥ê¥Æ¥£ (µ¡Ç½) ¤ò ¼«Æ°Åª¤Ë´Þ¤à¤è¤¦¤Ë¤Ê¤Ã¤¿¤¿¤á¡¢ ¸½ºß¤Ç¤Ï»ÈÍѤµ¤ì¤ë¤³¤È¤Ï¤Ê¤¯¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£
IPFW ¥½¥Õ¥È¥¦¥§¥¢¤ÎÀßÄê¤Ï ipfw(8) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤òÄ̤¸¤Æ¤ª¤³¤Ê¤¤¤Þ¤¹¡£ ¤³¤Î¥³¥Þ¥ó¥É¤Î¹½Ê¸¤ÏÈó¾ï¤ËÊ£»¨¤Ë¸«¤¨¤Þ¤¹¤¬¡¢ °ìö¤½¤Î¹½Â¤¤òÍý²ò¤¹¤ì¤ÐÈæ³ÓŪñ½ã¤Ç¤¹¡£
¤³¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤Ïº£¤Î¤È¤³¤í»Í¤Ä¤Î°Û¤Ê¤ë ¥³¥Þ¥ó¥É¥«¥Æ¥´¥ê¤¬ »ÈÍѤµ¤ì¤Æ¤¤¤Þ¤¹: ¤½¤ì¤ÏÄɲà / ºï½ü¡¢É½¼¨¡¢ ¥Õ¥é¥Ã¥·¥å¡¢¤ª¤è¤Ó¥¯¥ê¥¢¤Ç¤¹¡£Äɲà / ºï½ü¤Ï¥Ñ¥±¥Ã¥È¤Î¼õ¤±Æþ¤ì¡¢µñÀä¡¢¥í¥°¼è¤ê¤ò¤É¤Î¤è¤¦¤Ë¤ª¤³¤Ê¤¦¤« ¤È¤¤¤¦¥ë¡¼¥ë¤ò¹½ÃÛ¤¹¤ë¤Î¤Ë»ÈÍѤ·¤Þ¤¹¡£É½¼¨¤Ï¥ë¡¼¥ë¥ê¥¹¥È (¤Þ¤¿¤Ï¥Á¥§¡¼¥ó) ¤È (¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°ÍÑ) ¥Ñ¥±¥Ã¥È¥«¥¦¥ó¥¿¤Î ÆâÍƤòÄ´¤Ù¤ë¤Î¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¥Õ¥é¥Ã¥·¥å¤Ï¥Á¥§¡¼¥ó¤«¤é¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤ò ¼è¤ê½ü¤¯¤Î¤Ë»ÈÍѤ·¤Þ¤¹¡£ ¥¯¥ê¥¢¤Ï°ì¤Ä¤Þ¤¿¤Ï¤½¤ì°Ê¾å¤Î¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥¨¥ó¥È¥ê¤ò ¥¼¥í¤Ë¤¹¤ë¤Î¤Ë »ÈÍѤ·¤Þ¤¹¡£
¤³¤Î·Á¼°¤Ç¤Î»ÈÍÑË¡¤Ï:
ipfw [-N] ¥³¥Þ¥ó¥É [index] ¥¢¥¯¥·¥ç¥ó [log] ¥×¥í¥È¥³¥ë ¥¢¥É¥ì¥¹ [¥ª¥×¥·¥ç¥ó]
¤³¤Î·Á¼°¤Ç»ÈÍѤ¹¤ëºÝ¤Ë͸ú¤Ê¥Õ¥é¥°¤Ï°ì¤Ä¤À¤±¤Ç¤¹¡£
¥¢¥É¥ì¥¹¤ä¥µ¡¼¥Ó¥¹Ì¾¤ò ʸ»úÎó¤ËÊÑ´¹¤·¤Æɽ¼¨¤·¤Þ¤¹¡£
¥³¥Þ¥ó¥É ¤Ï°ì°Õ¤Ç¤¢¤ë¸Â¤êû½Ì²Äǽ¤Ç¤¹¡£Í¸ú¤Ê ¥³¥Þ¥ó¥É ¤Ï
¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë / ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ë¡¼¥ë¥ê¥¹¥È¤Ë ¥¨¥ó¥È¥ê¤òÄɲä·¤Þ¤¹¡£
¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë / ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ë¡¼¥ë¥ê¥¹¥È¤«¤é ¥¨¥ó¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£
°ÊÁ°¤Î¥Ð¡¼¥¸¥ç¥ó¤Î IPFW ¤Ç¤Ï¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥¨¥ó¥È¥ê¤È ¥Ñ¥±¥Ã¥È¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥¨¥ó¥È¥ê¤¬ÊÌ¡¹¤ËÍøÍѤµ¤ì¤Æ¤¤¤Þ¤·¤¿¡£ ¸½ºß¤Î¥Ð¡¼¥¸¥ç¥ó¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥¨¥ó¥È¥êËè¤Ë ¥Ñ¥±¥Ã¥È¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥¨¥ó¥È¥ê¤¬È÷¤¨¤é¤ì¤Æ¤¤¤Þ¤¹¡£
index Ãͤ¬»ØÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢ ¥¨¥ó¥È¥ê¤Ï¥Á¥§¡¼¥óÃæ¤Î»Ø¼¨¤µ¤ì¤¿°ÌÃÖ¤ËÃÖ¤«¤ì¤Þ¤¹¡£ index Ãͤ¬»ØÄꤵ¤ì¤Æ ¤¤¤Ê¤±¤ì¤Ð¡¢ ¥¨¥ó¥È¥ê¤Ï (65535 È֤Υǥե©¥ë¥È¥ë¡¼¥ë¤Ç¤¢¤ë ¥Ñ¥±¥Ã¥ÈµñÀä¤òÊ̤ˤ·¤Æ) ºÇ¸å¤Î¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤Î index ¤Ë 100 ¤ò¤·¤¿ °ÌÃÖ (¥Á¥§¡¼¥ó¤ÎºÇ¸å) ¤ËÃÖ¤«¤ì¤Þ¤¹¡£
¥«¡¼¥Í¥ë¤¬ IPFIREWALL_VERBOSE ¤Ä¤¤Ç¥³¥ó¥Ñ¥¤¥ë¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¡¢log ¥ª¥×¥·¥ç¥ó¤Ï¥Þ¥Ã¥Á¤·¤¿¥ë¡¼¥ë¤ò ¥·¥¹¥Æ¥à¥³¥ó¥½¡¼¥ë¤Ë½ÐÎϤµ¤»¤Þ¤¹¡£
͸ú¤Ê ¥¢¥¯¥·¥ç¥ó ¤Ï:
¥Ñ¥±¥Ã¥È¤ò¼Î¤Æ¤Þ¤¹¡£ICMP ¥Û¥¹¥È / ¥Ý¡¼¥ÈÅþãÉÔǽ¥Ñ¥±¥Ã¥È¤ò (ŬÀÚ¤ÊÊý¤ò) ȯ¿®¸µ¤ØÁ÷¤ê¤Þ¤¹¡£
Ä̾ïÄ̤ê¥Ñ¥±¥Ã¥È¤òÄ̲ᤵ¤»¤Þ¤¹¡£(ÊÌ̾: pass ¤ª¤è¤Ó accept)
¥Ñ¥±¥Ã¥È¤ò¼Î¤Æ¤Þ¤¹¡£È¯¿®¸µ¤Ï ICMP ¥á¥Ã¥»¡¼¥¸¤Ë¤è¤ë ÄÌÃΤò¼õ¤±¤Þ¤»¤ó (¤½¤Î¤¿¤á¥Ñ¥±¥Ã¥È¤¬ °¸Àè¤ËÅþ㤷¤Ê¤«¤Ã¤¿¤è¤¦¤Ë¸«¤¨¤Þ¤¹)¡£
¤³¤Î¥ë¡¼¥ë¤Ï¥Ñ¥±¥Ã¥È¥«¥¦¥ó¥¿¤ò¹¹¿·¤¹¤ë¤À¤±¤Ç¡¢ ¥Ñ¥±¥Ã¥È¤ò Ä̲ᤵ¤»¤¿¤êµñÀ䤷¤¿¤ê¤·¤Þ¤»¤ó¡£ ¸¡º÷¤Ï¼¡¤Î¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤«¤é³¤±¤é¤ì¤Þ¤¹¡£
¤½¤ì¤¾¤ì¤Î ¥¢¥¯¥·¥ç¥ó ¤Ï°ì°Õ¤ÊÀèƬÉôʬ¤À¤±¤Ç¤âǧ¼±¤µ¤ì¤Þ¤¹¡£
»ØÄê²Äǽ¤Ê ¥×¥í¥È¥³¥ë ¤Ï°Ê²¼¤ÎÄ̤ê¤Ç¤¹¡£
Ǥ°Õ¤Î IP ¥Ñ¥±¥Ã¥È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
ICMP ¥Ñ¥±¥Ã¥È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
TCP ¥Ñ¥±¥Ã¥È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
UDP ¥Ñ¥±¥Ã¥È¤Ë¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
¥¢¥É¥ì¥¹ ¤Î»ØÄê¤Ï:
from address/mask [port] to address/mask [port] [via interface]
port ¤Ï¥Ý¡¼¥È¤ò¥µ¥Ý¡¼¥È¤¹¤ë ¥×¥í¥È¥³¥ë (UDP ¤È TCP) ¤Î ¾ì¹ç¤Ë¤À¤±»ØÄê²Äǽ¤Ç¤¹¡£
via
¤Ïɬ¿Ü¤Ç¤Ï¤Ê¤¯¡¢
ÆÃÄê¤Î¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤òÄ̤äƤ¤¿¥Ñ¥±¥Ã¥È ¤À¤±¤Ë¥Þ¥Ã¥Á¤¹¤ë¤è¤¦¤Ë¡¢IP
¥¢¥É¥ì¥¹¤Þ¤¿¤Ï¥í¡¼¥«¥ë IP ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Î ¥É¥á¥¤¥ó̾¡¢¤Þ¤¿¤Ï¥¤¥ó¥¿¥Õ¥§¡¼¥¹Ì¾
(¤¿¤È¤¨¤Ð ed0) ¤ò »ØÄꤹ¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥æ¥Ë¥Ã¥ÈÈÖ¹æ¤Ï¥ª¥×¥·¥ç¥ó¤Ç¡¢ ¥ï¥¤¥ë¥É¥«¡¼¥É¤Ç»ØÄꤹ¤ë¤³¤È¤¬
¤Ç¤¤Þ¤¹¡£¤¿¤È¤¨¤Ð¡¢ ppp* ¤Ï¤¹¤Ù¤Æ¤Î¥«¡¼¥Í¥ë PPP
¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤Ë ¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
address/mask ¤Î»ØÄê¤Ï:
address¤Þ¤¿¤Ï
address/mask-bits¤Þ¤¿¤Ï
address:mask-pattern
IP ¥¢¥É¥ì¥¹¤Î¤«¤ï¤ê¤Ë͸ú¤Ê¥Û¥¹¥È̾¤ò»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹¡£ mask-bits
¤Ï¥¢¥É¥ì¥¹¥Þ¥¹¥¯¤Ç¾å°Ì²¿¥Ó¥Ã¥È¤ò£±¤Ë¤¹¤ë¤Ù¤¤«¤ò
¼¨¤¹½½¿Ê¿ôÃͤǤ¹¡£¤¿¤È¤¨¤Ð¼¡¤Î»ØÄê¡¢ 192.216.222.1/24
¤Ï¥¯¥é¥¹ C ¤Î¥µ¥Ö¥Í¥Ã¥È (¤³¤Î¾ì¹ç 192.216.222)
¤ÎǤ°Õ¤Î¥¢¥É¥ì¥¹¤Ë¥Þ¥Ã¥Á¤¹¤ë¥Þ¥¹¥¯¤òºîÀ®¤·¤Þ¤¹¡£ mask-pattern
¤ÏÍ¿¤¨¤é¤ì¤¿¥¢¥É¥ì¥¹¤È ÏÀÍý AND
¤µ¤ì¤ë IP ¥¢¥É¥ì¥¹¤Ç¤¹¡£ ¥¡¼¥ï¡¼¥É any ¤Ï“Ǥ°Õ¤Î IP
¥¢¥É¥ì¥¹”¤ò»ØÄꤹ¤ë¤¿¤á¤Ë »ÈÍѤ¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤¹¡£
¥Ö¥í¥Ã¥¯¤¹¤ë¥Ý¡¼¥ÈÈÖ¹æ¤Ï°Ê²¼¤Î¤è¤¦¤Ë»ØÄꤷ¤Þ¤¹:
port [, port [, port [… ]]]
¤Î¤è¤¦¤ËñÆȤΥݡ¼¥È¤Þ¤¿¤Ï¥Ý¡¼¥È¤Î¥ê¥¹¥È¤ò»ØÄꤷ¤Þ¤¹¡£ ¤Þ¤¿¤Ïport- port
¤Î¤è¤¦¤Ë¥Ý¡¼¥È¤ÎÈϰϤò»ØÄꤷ¤Þ¤¹¡£ ñÆȤΥݡ¼¥È¤È¥Ý¡¼¥È¤Î¥ê¥¹¥È¤ò ÁȤ߹ç¤ï¤»¤Æ»ØÄꤹ¤ë¤³¤È¤â²Äǽ¤Ç¤¹¤¬¡¢ ¤½¤Î¾ì¹ç¤Ï¾ï¤ËÈϰϤÎÊý¤ò ºÇ½é¤Ë»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£»ÈÍѲÄǽ¤Ê ¥ª¥×¥·¥ç¥ó ¤Ï:
¥Ç¡¼¥¿¥°¥é¥à¤ÎºÇ½é¤Î ¥Õ¥é¥°¥á¥ó¥È¤Ç¤Ê¤±¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
ÆþÎÏÅÓÃæ¤Î¥Ñ¥±¥Ã¥È¤Ç¤¢¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
½ÐÎÏÅÓÃæ¤Î¥Ñ¥±¥Ã¥È¤Ç¤¢¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
IP ¥Ø¥Ã¥À¤¬ spec ¤Ë»ØÄꤵ¤ì¤¿ ¥«¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿ ¥ª¥×¥·¥ç¥ó¤Î¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£ ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë IP ¥ª¥×¥·¥ç¥ó¤Î¥ê¥¹¥È¤Ï: ssrr (¥¹¥È¥ê¥¯¥È¥½¡¼¥¹¥ë¡¼¥È)¡¢ lsrr (¥ë¡¼¥º¥½¡¼¥¹¥ë¡¼¥È)¡¢ rr (¥ì¥³¡¼¥É¥Ñ¥±¥Ã¥È¥ë¡¼¥È)¡¢ ¤½¤·¤Æ ts (¥¿¥¤¥à¥¹¥¿¥ó¥×) ¤Ç¤¹¡£ ÆÃÄê¤Î¥ª¥×¥·¥ç¥ó¤ò´Þ¤Þ¤Ê¤¤¤³¤È¤ò»ØÄꤹ¤ë¤Ë¤Ï ! ¤òÀèƬ¤Ë¤Ä¤±¤Þ¤¹¡£
¥Ñ¥±¥Ã¥È¤¬´û¤Ë³ÎΩ¤µ¤ì¤Æ¤¤¤ë TCP ¥³¥Í¥¯¥·¥ç¥ó¤Î°ìÉô¤Ç¤¢¤ì¤Ð (¤Ä¤Þ¤ê RST ¤Þ¤¿¤Ï ACK ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤ì¤Ð) ¥Þ¥Ã¥Á¤·¤Þ¤¹¡£ established ¥ë¡¼¥ë¤ò¥Á¥§¡¼¥ó¤ÎºÇ½é¤ÎÊý¤ËÃÖ¤¯¤³¤È¤Ç¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò¸þ¾å¤µ¤»¤ë¤³¤È¤¬ ¤Ç¤¤Þ¤¹¡£
¥Ñ¥±¥Ã¥È¤¬ TCP ¥³¥Í¥¯¥·¥ç¥ó¤ò³ÎΩ¤·¤è¤¦¤È¤¹¤ë¤â¤Î¤Ç¤¢¤ì¤Ð (SYN ¥Ó¥Ã¥È¤¬¥»¥Ã¥È¤µ¤ì ACK ¥Ó¥Ã¥È¤Ï¥»¥Ã¥È¤µ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð) ¥Þ¥Ã¥Á¤·¤Þ¤¹¡£
TCP ¥Ø¥Ã¥À¤¬ flags ¤Ë»ØÄꤵ¤ì¤¿ ¥«¥ó¥Þ¤Ç¶èÀÚ¤é¤ì¤¿¥Õ¥é¥°¤Î ¥ê¥¹¥È¤ò´Þ¤ó¤Ç¤¤¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£ ¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¥Õ¥é¥°¤Ï¡¢fin, syn, rst, psh, ack ¤È urg ¤Ç¤¹¡£ ÆÃÄê¤Î¥Õ¥é¥°¤ò´Þ¤Þ¤Ê¤¤¤³¤È¤ò»ØÄꤹ¤ë¤Ë¤Ï ! ¤òÀèƬ¤Ë¤Ä¤±¤Þ¤¹¡£
ICMP ¥¿¥¤¥×¤¬ types ¥ê¥¹¥È¤Ë ¸ºß¤·¤Æ¤¤¤ì¤Ð¥Þ¥Ã¥Á¤·¤Þ¤¹¡£ ¥ê¥¹¥È¤Ï¥¿¥¤¥×¤ÎÈϰϤޤ¿¤Ï¸Ä¡¹¤Î¥¿¥¤¥×¤ò ¥«¥ó¥Þ¤Ç¶èÀڤä¿Ç¤°Õ¤ÎÁȹ礻¤Ç»ØÄê¤Ç¤¤Þ¤¹¡£ °ìÈÌŪ¤Ë»ÈÍѤµ¤ì¤Æ¤¤¤ë ICMP ¥¿¥¤¥×¤Ï: 0 ¥¨¥³¡¼¥ê¥×¥é¥¤ (ping ¥ê¥×¥é¥¤)¡¢ 3 Áê¼êÀèÅþãÉÔ²Äǽ¡¢ 5 ¥ê¥À¥¤¥ì¥¯¥È¡¢ 8 ¥¨¥³¡¼¥ê¥¯¥¨¥¹¥È (ping ¥ê¥¯¥¨¥¹¥È)¡¢¤½¤·¤Æ 11 »þ´ÖĶ²á (traceroute(8) ¤Ç»ÈÍѤµ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢TTL Ëþλ¤ò¼¨¤¹¤Î¤Ë»ÈÍѤµ¤ì¤Þ¤¹) ¤Ç¤¹¡£
¤³¤Î·Á¼°¤Ç¤Î»ÈÍÑË¡¤Ï:
ipfw [-a] [-t] [-N] l
¤³¤Î·Á¼°¤Ç»ÈÍѤ¹¤ëºÝ¤Ë͸ú¤Ê¥Õ¥é¥°¤Ï»°¤Ä¤¢¤ê¤Þ¤¹¡£
¥ê¥¹¥Èɽ¼¨¤ÎºÝ¤Ë¥«¥¦¥ó¥¿¤ÎÃͤâɽ¼¨¤·¤Þ¤¹¡£ ¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï ¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥«¥¦¥ó¥¿¤Î ÆâÍƤò¸«¤ëÍ£°ì¤Î¼êÃʤǤ¹¡£
³Æ¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤¬ºÇ¸å¤Ë ¥Þ¥Ã¥Á¤·¤¿»þ¹ï¤òɽ¼¨¤·¤Þ¤¹¡£¤³¤Î»þ¹ïɽ¼¨¤Ï ipfw(8) ¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç»ÈÍѤµ¤ì¤ëÆþÎÏ·Á¼°¤È ¸ß´¹À¤¬¤¢¤ê¤Þ¤»¤ó¡£
(²Äǽ¤Ç¤¢¤ì¤Ð) ¥¢¥É¥ì¥¹¤ä¥µ¡¼¥Ó¥¹Ì¾¤òʸ»úÎó¤ËÊÑ´¹¤·¤Æɽ¼¨¤·¤Þ¤¹¡£
¥Á¥§¡¼¥ó¤ò¥Õ¥é¥Ã¥·¥å¤¹¤ë¤Ë¤Ï:
ipfw flush
¥«¡¼¥Í¥ë¤Ë¸ÇÄꤵ¤ì¤Æ¤¤¤ë¥Ç¥Õ¥©¥ë¥È¥ë¡¼¥ë (¥¤¥ó¥Ç¥Ã¥¯¥¹ 65535 ÈÖ) °Ê³°¤Î¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥Á¥§¡¼¥ó¤ÎÃæ¤Î¤¹¤Ù¤Æ¤Î¥¨¥ó¥È¥ê¤òºï½ü¤·¤Þ¤¹¡£ ¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤¬µñÀ䤵¤ì¤ë¤Î¤Ç¡¢ °ìö¤³¤ì¤ò¼Â¹Ô¤¹¤ë¤È¡¢ ¥Ñ¥±¥Ã¥È¤òµö²Ä¤¹¤ë¥¨¥ó¥È¥ê¤¬¥Á¥§¡¼¥ó¤ËÄɲ䵤ì¤ë¤Þ¤Ç¡¢ ¤¢¤Ê¤¿¤Î¥·¥¹¥Æ¥à¤¬¥Í¥Ã¥È¥ï¡¼¥¯¤«¤éÀÚ¤êÊü¤µ¤ì¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ¤½¤Î¤¿¤á¡¢ ¥ë¡¼¥ë¤Î¥Õ¥é¥Ã¥·¥å¤ò¤ª¤³¤Ê¤¦¤È¤¤ÏÃí°Õ¤¬É¬ÍפǤ¹¡£
°ì¤Ä¤Þ¤¿¤Ï¤½¤ì°Ê¾å¤Î¥Ñ¥±¥Ã¥È¥«¥¦¥ó¥¿¤ò¥¯¥ê¥¢¤¹¤ë¤¿¤á¤Ë¤Ï:
ipfw zero [index]
index ¤¬»ØÄꤵ¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð¡¢ ¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¥«¥¦¥ó¥¿¤¬ ¥¯¥ê¥¢¤µ¤ì¤Þ¤¹¡£ index ¤¬»ØÄꤵ¤ì¤Æ¤¤¤ì¤Ð¡¢ ÆÃÄê¤Î¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤À¤±¤¬ ¥¯¥ê¥¢¤µ¤ì¤Þ¤¹¡£
¤³¤Î¥³¥Þ¥ó¥É¤Ï¡¢¥Û¥¹¥È evil.crackers.org ¤«¤é ¥Û¥¹¥È nice.people.org ¤Î telnet ¥Ý¡¼¥È¤Ø¤Î ¤¹¤Ù¤Æ¤Î¥Ñ¥±¥Ã¥È¤òµñÀ䤷¤Þ¤¹¡£
# ipfw add deny tcp from evil.crackers.org to nice.people.org 23
¼¡¤ÎÎã¤Ï¡¢¥Í¥Ã¥È¥ï¡¼¥¯ crackers.org (¥¯¥é¥¹ C) Á´ÂΤ«¤é ¥Þ¥·¥ó nice.people.org (¤ÎǤ°Õ¤Î¥Ý¡¼¥È) ¤Ø¤Î Ǥ°Õ¤Î TCP ¥È¥é¥Õ¥£¥Ã¥¯¤òµñÀ䤷¡¢ ¥í¥°¤ò¼è¤ê¤Þ¤¹¡£
# ipfw add deny log tcp from evil.crackers.org/24 to nice.people.org
¤¢¤Ê¤¿¤ÎÆâÉô¥Í¥Ã¥È¥ï¡¼¥¯ (¥¯¥é¥¹ C ¤Î¥µ¥Ö¥Í¥Ã¥È) ¤ËÂФ¹¤ë X ¥»¥Ã¥·¥ç¥ó¤ò Ä¥¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¾ì¹ç¡¢ °Ê²¼¤Î¥³¥Þ¥ó¥É¤ÇɬÍפʥե£¥ë¥¿¥ê¥ó¥°¤¬¤ª¤³¤Ê¤¨¤Þ¤¹¡£
# ipfw add deny tcp from any to my.org/28 6000 setup
¥¢¥«¥¦¥ó¥Æ¥£¥ó¥°¥ì¥³¡¼¥É¤ò¸«¤ë¤Ë¤Ï:
# ipfw -a list¤Þ¤¿¤Ïû½Ì·Á¼°¤Ç
# ipfw -a l
ºÇ¸å¤Ë¥Á¥§¡¼¥ó¥¨¥ó¥È¥ê¤¬¥Þ¥Ã¥Á¤·¤¿ »þ¹ï¤ò¸«¤ë¤³¤È¤â¤Ç¤¤Þ¤¹¡£
# ipfw -at l
注意: °Ê²¼¤ÎÄó°Æ¤Ï¡¢¤¿¤À¤ÎÄó°Æ¤Ë¤¹¤®¤Þ¤»¤ó: ɬÍפʽèÍý¤Ï¤½¤ì¤¾¤ì¤Î¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ç°Û¤Ê¤ë¤¿¤á¡¢ ¤¢¤Ê¤¿Æȼ«¤ÎÍ×µá¤Ë¤¢¤Ã¤¿¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¹½ÃÛ¤¹¤ëÊýË¡¤ò ¤³¤³¤Ç½Ò¤Ù¤ë¤³¤È¤Ï¤Ç¤¤Ê¤¤¤Î¤Ç¤¹¡£
ºÇ½é¤Ë¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¥»¥Ã¥È¥¢¥Ã¥×¤¹¤ë¤È¤¡¢ ¥³¥ó¥È¥í¡¼¥ë¤µ¤ì¤¿´Ä¶¤Ç¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥Û¥¹¥È¤Î ÀßÄ꤬¤ª¤³¤Ê¤¨¤ë¤è¤¦¤Ê ¥Æ¥¹¥È¥Ù¥ó¥Á¥»¥Ã¥È¥¢¥Ã¥×¤¬ÍѰդǤ¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ ¥«¡¼¥Í¥ë¤Î¥í¥°¼è¤ê¤ò ͸ú¤Ë¤·¤Æ¥í¥°¼è¤êÈǤΥ³¥Þ¥ó¥É¤ò»ÈÍѤ¹¤ë¤³¤È¤ò ¶¯¤¯¤ª¤¹¤¹¤á¤·¤Þ¤¹¡£¤½¤¦¤¹¤ë¤³¤È¤Ç¡¢ Â礷¤¿º®Íð¤äÃæÃǤʤ·¤ËÌäÂê¤È¤Ê¤ëÈϰϤÎÆÃÄê¤È½èÃÖ¤ò ÁÇÁ᤯¤ª¤³¤Ê¤¦¤³¤È¤¬¤Ç¤¤Þ¤¹¡£ ½é´ü¥»¥Ã¥È¥¢¥Ã¥×¥Õ¥§¡¼¥º¤¬´°Î»¤·¤Æ¤«¤é¤Ç¤¢¤Ã¤Æ¤â¡¢ ¥¢¥¿¥Ã¥¯¤Î²ÄǽÀ¤Î¤¢¤ë¥¢¥¯¥»¥¹¤ò¥È¥ì¡¼¥¹¤·¤¿¤ê¡¢ Í×µá¤ÎÊѲ½¤Ë±þ¤¸¤Æ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¥ë¡¼¥ë¤ò Êѹ¹¤·¤¿¤ê¤Ç¤¤ë¤Î¤Ç¡¢`deny' ¤ËÂФ¹¤ë¥í¥°¼è¤ê¤ò¤ª¤³¤Ê¤¦¤³¤È¤ò¤ª¤¹¤¹¤á¤·¤Þ¤¹¡£
注意: accept ¥³¥Þ¥ó¥É¤Ç¥í¥°¤ò¼è¤Ã¤Æ¤¤¤ë¤È¡¢ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò¥Ñ¥±¥Ã¥È¤¬°ì¤ÄÄ̲᤹¤ëËè¤Ë 1 ¹Ô¤Î¥í¥°¤¬À¸À®¤µ¤ì¤ë¤¿¤á ÂçÎ̤Π¥í¥°¥Ç¡¼¥¿¤¬È¯À¸¤·¤Þ¤¹¡£¤½¤Î¤¿¤á¡¢Â絬ÌÏ¤Ê FTP/HTTP žÁ÷¤Ê¤É¤ò¤ª¤³¤Ê¤¦¤È¡¢¥·¥¹¥Æ¥à¤¬Èó¾ï¤Ë ÃÙ¤¯¤Ê¤Ã¤Æ¤·¤Þ¤¤¤Þ¤¹¡£ ¤Þ¤¿¡¢¥Ñ¥±¥Ã¥È¤¬Ä̲᤹¤ë¤Þ¤Ç¤Ë¥«¡¼¥Í¥ë¤Ë¤è¤ê ¿¤¯¤Î»Å»ö¤òÍ׵᤹¤ë¤¿¤á¡¢¥Ñ¥±¥Ã¥È¤Î¥ì¥¤¥Æ¥ó¥· (latency) ¤òÁý²Ã¤µ¤»¤Æ¤·¤Þ¤¤¤Þ¤¹¡£syslogd ¤â¥í¥°¤ò¥Ç¥£¥¹¥¯¤ËµÏ¿¤¹¤ë¤Ê¤É¡¢¤è¤ê¿¤¯¤Î CPU ¥¿¥¤¥à¤ò »ÈÍѤ·»Ï¤á¡¢¼Â¤ËÍÆ°×¤Ë /var/log ¤¬ÃÖ¤«¤ì¤Æ¤¤¤ë¥Ñ¡¼¥Æ¥£¥·¥ç¥ó¤ò°î¤ì¤µ¤»¤Æ¤·¤Þ¤¦²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£
¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ï¡¢ /etc/rc.conf.local ¤«¡¢¤â¤·¤¯¤Ï /etc/rc.conf ¤Ë¤è¤Ã¤Æ͸ú²½¤µ¤ì¤ë¤Ù¤¤Ç¤¹¡£ ´ØÏ¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï¡¢¤É¤Î¥É¥¢¥Î¥Ö (ÌõÃí: ¥Ý¡¼¥È¤ä IP ¥¢¥É¥ì¥¹¤Ê¤É¡¢ ¥Í¥Ã¥È¥ï¡¼¥¯¤«¤é¤ÎÆþ¸ý¤ò¼¨¤¹¤â¤Î¤Î¤³¤È) ¤Ë¼ê¤ò¤Ä¤±¤ì¤ÐÎɤ¤¤Î¤«¤Ë ¤Ä¤¤¤Æ¤ÎÀâÌÀ¤È¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ëÀßÄê¤Î´ûÄêÃͤΥꥹ¥È¤¬¤¢¤ê¤Þ¤¹¡£ ¤â¤·¡¢ÀßÄê¤Î´ûÄêÃͤò»È¤ï¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ ipfw list ¤È¤¹¤ë¤³¤È¤Ç¡¢ ¸½ºß¤Î¥ë¡¼¥ë¥»¥Ã¥È¤ò rc.conf ¤«¤éÆɤ߹þ¤á¤ë·Á¤Ç ¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤǤ¤Þ¤¹¡£ ¤Þ¤¿¡¢/etc/rc.conf.local ¤ä /etc/rc.conf ¤Ë¤è¤Ã¤Æ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤ò͸ú²½¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢ ¤¹¤Ù¤Æ¤Î IP ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤¬ÀßÄꤵ¤ì¤ë¤è¤ê¤âÁ°¤Ë¡¢ ³Î¼Â¤Ë¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Î͸ú²½¤¬¹Ô¤Ê¤ï¤ì¤ë¤è¤¦¤Ë¤¹¤ë¤³¤È¤¬½ÅÍפǤ¹¡£
¼¡¤ÎÌäÂê¤Ï¡¢¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤¬¼ÂºÝ¤Ë¤Ï²¿¤ò ¤¹¤ë ¤Ù¤¤«¤Ç¤¹ ! ¤³¤ì¤Ï³°Éô¤«¤é¤½¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ø¤Î¤É¤ó¤Ê¥¢¥¯¥»¥¹¤òµö¤·¤¿¤¤¤«¡¢ ¤Þ¤¿ÆâÉô¤«¤é³°³¦¤Ø¤Î¥¢¥¯¥»¥¹¤ò ¤É¤Î¤¯¤é¤¤µö¤·¤¿¤¤¤«¤ËÂ礤¯°Í¸¤·¤Þ¤¹¡£ ¤¤¤¯¤Ä¤«°ìÈÌŪ¤Ê¥ë¡¼¥ë¤òµó¤²¤ë¤È:
1024 Èְʲ¼¤Î¥Ý¡¼¥È¤Ø¤Î¤¹¤Ù¤Æ¤Î TCP ÆþÎÏ¥¢¥¯¥»¥¹¤ò¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£¤³¤³¤Ï finger, SMTP (mail) ¤½¤·¤Æ telnet ¤Ê¤É¡¢ºÇ¤â¥»¥¥å¥ê¥Æ¥£¤ËÉÒ´¶¤Ê ¥µ¡¼¥Ó¥¹¤¬Â¸ºß¤¹¤ë¾ì½ê¤À¤«¤é¤Ç¤¹¡£
¤¹¤Ù¤Æ¤Î ÆþÎÏ UDP ¥È¥é¥Õ¥£¥Ã¥¯¤ò¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£¤³¤ì¤Ï UDP ¤ò»ÈÍѤ·¤Æ¤¤¤ë¥µ¡¼¥Ó¥¹¤ÇÍÍѤʤâ¤Î¤Ï¶Ë¤á¤Æ¾¯¤Ê¤¤¤¦¤¨¡¢ (Sun ¤Î RPC ¤È NFS ¥×¥í¥È¥³¥ë¤Î¤è¤¦¤Ë) ÍÍѤʥȥé¥Õ¥£¥Ã¥¯¤Ç¤¢¤Ã¤¿¤È¤·¤Æ¤â¡¢ Ä̾糧¥¥å¥ê¥Æ¥£¤ËÂФ¹¤ë¶¼°Ò¤È¤Ê¤ë¤¿¤á¤Ç¤¹¡£UDP ¤Ï¥³¥Í¥¯¥·¥ç¥ó¥ì¥¹¥×¥í¥È¥³¥ë¤Ç¤¢¤ë¤¿¤á¡¢ÆþÎÏ UDP ¥È¥é¥Õ¥£¥Ã¥¯¤òµñÀ䤹¤ë¤³¤È¤Ï ¤¹¤Ê¤ï¤Á½ÐÎÏ UDP ¥È¥é¥Õ¥£¥Ã¥¯¤ËÂФ¹¤ëÊÖÅú¤ò¤â ¥Ö¥í¥Ã¥¯¤¹¤ë¤³¤È¤Ë¤Ê¤ë¤Î¤Ç¡¢ ¤³¤Î¤³¤È¤Ï¤½¤ì¤Ê¤ê¤ÎÉÔÍø±×¤ò¤â¤¿¤é¤·¤Þ¤¹¡£¤¿¤È¤¨¤Ð³°Éô¤Î archie (prospero) ¥µ¡¼¥Ð¤ò»ÈÍѤ·¤Æ¤¤¤ë (ÆâÉô¤Î) ¥æ¡¼¥¶¤Ë ¤È¤Ã¤ÆÌäÂê¤È¤Ê¤ë²ÄǽÀ¤¬¤¢¤ê¤Þ¤¹¡£¤â¤· archie ¤Ø¤Î¥¢¥¯¥»¥¹¤òµö¤·¤¿¤±¤ì¤Ð¡¢191 ÈÖ¤È 1525 È֤Υݡ¼¥È¤«¤é Ǥ°Õ¤Î UDP ¥Ý¡¼¥È¤ØÍè¤ë¥Ñ¥±¥Ã¥È¤¬¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤òÄ̲᤹¤ë¤³¤È¤ò µö²Ä¤·¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£123 È֤Υݡ¼¥È¤«¤éÍè¤ë¥Ñ¥±¥Ã¥È¤Ï ntp ¥Ñ¥±¥Ã¥È¤Ç¡¢ ¤³¤ì¤âÄ̲á¤Îµö²Ä¤ò¹Íθ¤¹¤ëɬÍפ¬¤¢¤ë ¤â¤¦°ì¤Ä¤Î¥µ¡¼¥Ó¥¹¤Ç¤¹¡£
³°Éô¤«¤é 6000 È֤Υݡ¼¥È¤Ø¤Î¥È¥é¥Õ¥£¥Ã¥¯¤ò¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£6000 È֤Υݡ¼¥È¤Ï X11 ¥µ¡¼¥Ð¤Ø¤Î¥¢¥¯¥»¥¹¤Ë»ÈÍѤµ¤ì¤ë¥Ý¡¼¥È¤Ç¡¢ ¥»¥¥å¥ê¥Æ¥£¤ËÂФ¹¤ë¶¼°Ò¤È¤Ê¤ê¤¨¤Þ¤¹¡£ (Æä˼«Ê¬¤Î¥ï¡¼¥¯¥¹¥Æ¡¼¥·¥ç¥ó¤Ç xhost + ¤ò¤ª¤³¤Ê¤¦Êʤò»ý¤Ã¤Æ¤¤¤ë¿Í¤¬¤¤¤ì¤Ð¤Ê¤ª¤µ¤é¤Ç¤¹)¡£X11 ¤Ï¼ÂºÝ¤Ë 6000 ÈְʹߤΥݡ¼¥È¤ò»ÈÍѤ¹¤ë²ÄǽÀ¤¬¤¢¤ë¤¿¤á¡¢ Ä̲áµö²Ä¤Ë ¾å¸Â¤òÄê¤á¤ë¤È¡¢ ¤½¤Î¥Þ¥·¥ó¤ÇÁö¤é¤»¤ë¤³¤È¤Î¤Ç¤¤ë X ¥Ç¥£¥¹¥×¥ì¥¤¤Î ¸Ä¿ô¤¬À©¸Â¤µ¤ì¤Þ¤¹¡£RFC 1700 (Assigned Numbers) ¤ÇÄêµÁ¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤Ë¡¢¾å¸Â¤Ï 6063 ¤Ç¤¹¡£
ÆâÉô¤Î¥µ¡¼¥Ð (¤¿¤È¤¨¤Ð SQL ¥µ¡¼¥Ð¤Ê¤É) ¤¬¤É¤Î¥Ý¡¼¥È¤ò»ÈÍѤ¹¤ë¤«¤ò ¥Á¥§¥Ã¥¯¤·¤Þ¤¹¡£ ¤½¤ì¤é¤Î¥Ý¡¼¥È¤ÏÄ̾¾å¤Ç»ØÄꤷ¤¿ 1-1024 ÈÖ¤ÎÈϰϤ«¤é³°¤ì¤Æ¤¤¤Þ¤¹¤Î¤Ç¡¢ ¤³¤ì¤é¤âƱÍͤ˥֥í¥Ã¥¯¤·¤Æ¤ª¤¯¤³¤È¤Ï ¤ª¤½¤é¤¯Îɤ¤¹Í¤¨¤Ç¤¹¡£
¤³¤ì¤È¤ÏÊ̤Υե¡¥¤¥¢¥¦¥©¡¼¥ëÀßÄê¤Ë ´Ø¤¹¤ë¥Á¥§¥Ã¥¯¥ê¥¹¥È¤¬ CERT ¤«¤é Æþ¼ê²Äǽ¤Ç¤¹¡£http://www.cert.org/tech_tips/packet_filtering.html
Á°¤Ë¤â½Ò¤Ù¤¿¤è¤¦¤Ë¡¢¤³¤ì¤Ï¤¿¤À¤Î ¥¬¥¤¥É¥é¥¤¥ó ¤Ë¤¹¤®¤Þ¤»¤ó¡£ ¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Ç¤É¤Î¤è¤¦¤Ê¥Õ¥£¥ë¥¿¥ë¡¼¥ë¤ò»ÈÍѤ¹¤ë¤«¤Ï¡¢ ¤¢¤Ê¤¿¼«¿È¤¬ ·è¤á¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£ ¤³¤ì¤Þ¤Ç¤Î¥¢¥É¥Ð¥¤¥¹¤Ë½¾¤Ã¤¿¤Ë¤â´Ø¤ï¤é¤º¡¢ 狼¤¬¤¢¤Ê¤¿¤Î¥Í¥Ã¥È¥ï¡¼¥¯¤Ë ¿¯Æþ¤·¤Æ¤¤¿¤È¤·¤Æ¤â¡¢ ¤ï¤¿¤·¤¿¤Á¤Ï¡Ö¤¤¤«¤Ê¤ë¡×ÀÕǤ¤â¤È¤ë¤³¤È¤Ï¤Ç¤¤Þ¤»¤ó¡£
¿¤¯¤Î¿Í¤¬ IPFW ¤¬¤É¤Î¤¯¤é¤¤¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤ò¥·¥¹¥Æ¥à¤Ë²Ã¤¨¤ë¤«¤òÃΤꤿ¤¬¤Ã¤Æ¤¤¤Þ¤¹¡£ ¤³¤ÎÅú¤¨¤Ï¡¢»È¤Ã¤Æ¤¤¤ë¥ë¡¼¥ë¥»¥Ã¥È¤È¥×¥í¥»¥Ã¥µ¤Î¥¹¥Ô¡¼¥É¤Ë¤è¤Ã¤Æ¤Û¤Ü·è¤Þ¤ê¤Þ¤¹¡£ ¥¤¡¼¥µ¥Í¥Ã¥È¤ò»È¤Ã¤Æ¤¤¤Æ¥ë¡¼¥ë¥»¥Ã¥È¤¬¾¯¤Ê¤¤¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Ë¤È¤Ã¤ÆÅú¤¨¤Ï¡¢ “¤½¤Î±Æ¶Á¤Ï̵»ë¤Ç¤¤ëÄøÅÙ” ¤Ç¤¹¡£ ¼ÂºÝ¤Î¬ÄêÃͤò¸«¤Ê¤¤¤ÈËþ¤Ǥ¤Ê¤¤Êý¤Ï¡¢°ú¤Â³¤¤ªÆɤߤ¯¤À¤µ¤¤¡£
¼¡¤Î¬Äê¤Ï 486-66 (ÌõÃí: Intel ¼ÒÀ½ CPU i486, 66MHz ¤Î¤³¤È) ¾å¤Ç 2.2.5-STABLE ¤ò»ÈÍѤ·¤Æ¹Ô¤Ê¤ï¤ì¤Þ¤·¤¿ (IPFW ¤Ï¤½¤Î¸å¤Î FreeBSD ¤Î¥ê¥ê¡¼¥¹¤Ç¿¾¯Êѹ¹¤µ¤ì¤Æ¤¤¤Þ¤¹¤¬¡¢ ¸½ºß¤âƱÄøÅ٤ήÅÙ¤ÇÆ°¤¤Þ¤¹)¡£IPFW ¤Ë¤Ï¡¢ ip_fw_chk ¥ë¡¼¥Á¥óÆâ¤Ç¤«¤«¤ë»þ´Ö¤ò¬Äꤷ¤Æ¡¢ 1000 ¥Ñ¥±¥Ã¥ÈËè¤Ë·ë²Ì¤ò¥³¥ó¥½¡¼¥ë¤Ëɽ¼¨¤¹¤ëÊѹ¹¤¬²Ã¤¨¤é¤ì¤Æ¤¤¤Þ¤¹¡£
¤½¤ì¤¾¤ì 1000 ¤º¤Ä¤Î¥ë¡¼¥ë¤«¤é¤Ê¤ë 2 ¤Ä¤Î¥ë¡¼¥ë¥»¥Ã¥È¤Ç¥Æ¥¹¥È¤¬¹Ô¤Ê¤ï¤ì¤Þ¤·¤¿¡£ 1 ¤ÄÌܤΥ롼¥ë¥»¥Ã¥È¤ÏºÇ°¤Î¥±¡¼¥¹¤ò¸«¤ë¤¿¤á¤Ë¡¢ ¼¡¤Î¥ë¡¼¥ë¤ò·«¤êÊÖ¤·¤Æ¤¤¤Þ¤¹¡£
# ipfw add deny tcp from any to any 55555
¤³¤ì¤Ï¡¢ºÇ½ªÅª¤Ë¥Ñ¥±¥Ã¥È¤¬ (¥Ý¡¼¥ÈÈֹ椫¤é) ¥ë¡¼¥ë¤Ë¥Þ¥Ã¥Á¤·¤Ê¤¤¤³¤È¤¬¤ï¤«¤ë¤Þ¤Ç¤Ë IPFW ¤Î¤Û¤È¤ó¤É¤Î¥Ñ¥±¥Ã¥È¥Á¥§¥Ã¥¯¥ë¡¼¥Á¥ó¤¬¼Â¹Ô¤µ¤ì¤ë¤è¤¦¤Ê¡¢ ºÇ°¤Î¾ì¹ç¤ò¼¨¤·¤Þ¤¹¡£¤³¤Î¥ë¡¼¥ë¤ò 999 ¸Ä·«¤êÊÖ¤·Ê¤٤¿¸å¤Ë allow ip from any to any ¤¬¤¤Þ¤¹¡£
2 ¤ÄÌܤΥ롼¥ë¥»¥Ã¥È¤Ï¡¢ ¤Ê¤ë¤Ù¤¯Á᤯³Îǧ¤¬½ªÎ»¤¹¤ë¤è¤¦¤Ë½ñ¤«¤ì¤¿¤â¤Î¤Ç¤¹¡£
# ipfw add deny ip from 1.2.3.4 to 1.2.3.4
¤³¤Î¥ë¡¼¥ë¤Ç¤Ï¡¢È¯¿®¸µ¤Î IP ¥¢¥É¥ì¥¹¤¬°ìÃפ·¤Ê¤¤¤Î¤Ç¡¢ ¤¹¤°¤Ë³Îǧ¤¬½ª¤ï¤ê¤Þ¤¹¡£Á°¤È¤ª¤Ê¤¸¤è¤¦¤Ë¡¢1000 ¸ÄÌܤΥ롼¥ë¤Ï allow ip from any to any ¤Ç¤¹¡£
Á°¼Ô¤Î¥Ñ¥±¥Ã¥È¤¢¤¿¤ê¤Î¥ª¡¼¥Ð¥Ø¥Ã¥É¤Ï¤ª¤è¤½ 2.703 ms/packet ¤Þ¤¿¤Ï 1 ¤Ä¤Î¥ë¡¼¥ë¤Ë¤Ä¤ 2.7 ¥Þ¥¤¥¯¥íÉäǤ¹¡£¤·¤¿¤¬¤Ã¤Æ¡¢ ¤³¤Î¥ë¡¼¥ë¤Ë¤ª¤±¤ë¥Ñ¥±¥Ã¥È½èÍý»þ´Ö¤ÎÍýÏÀŪ¤Ê¸Â³¦¤Ï¡¢ ËèÉÃÌó 370 ¥Ñ¥±¥Ã¥È¤Ç¤¹¡£10 Mbps ¤Î Ethernet ¤Ç 1500 ¥Ð¥¤¥ÈÄøÅ٤Υѥ±¥Ã¥È¥µ¥¤¥º¤ò²¾Äꤹ¤ë¤È¡¢ ¥Ð¥ó¥ÉÉý¤ÎÍøÍѸúΨ¤Ï 55.5% ¤¬¸Â³¦¤Ç¤¹¡£
¸å¼Ô¤Ç¤Ï¡¢¤½¤ì¤¾¤ì¤Î¥Ñ¥±¥Ã¥È¤¬¤ª¤è¤½ 1.172 ms ¤Þ¤¿¤Ï¡¢1 ¤Ä¤Î¥ë¡¼¥ë¤Ë¤Ä¤ 1.2 ¥Þ¥¤¥¯¥íÉäǽèÍý¤µ¤ì¤Æ¤¤¤Þ¤·¤¿¡£ ¥Ñ¥±¥Ã¥È½èÍý»þ´Ö¤ÎÍýÏÀŪ¤Ê¸Â³¦¤Ï¡¢ ËèÉÃÌó 853 ¥Ñ¥±¥Ã¥È¤È¤Ê¤ê¤Þ¤¹¤Î¤Ç¡¢10 Mbps Ethernet ¤Î¥Ð¥ó¥ÉÉý¤ò»È¤¤Àڤ뤳¤È¤¬¤Ç¤¤Þ¤¹¡£
¤³¤Î¥Æ¥¹¥È¤Ë»È¤ï¤ì¤¿¥ë¡¼¥ë¤Î¿ô¤¬Â¿²á¤®¤ë¤³¤È¤È¡¢ ¤½¤ÎÀ¼Á¤«¤é¡¢¤³¤ì¤Ï¼ÂºÝ¤Î¾õ¶·¤òÈ¿±Ç¤·¤¿¤â¤Î¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó¡£ ¤³¤ì¤é¤Ï¾å¤Ë¼¨¤·¤¿¥¿¥¤¥ß¥ó¥°¾ðÊó¤ò½Ð¤¹¤¿¤á¤À¤±¤ËÍѤ¤¤é¤ì¤¿¤â¤Î¤Ç¤¹¡£ ¸úΨ¤ÎÎɤ¤¥ë¡¼¥ë¥»¥Ã¥È¤òºî¤ë¤¿¤á¤Ë¤Ï¡¢ ¼¡¤Î¤è¤¦¤Ê»ö¤ò¹Í¤¨¤ì¤Ð¤è¤¤¤Ç¤·¤ç¤¦¡£
established ¥ë¡¼¥ë¤Ï TCP ¥È¥é¥Õ¥£¥Ã¥¯¤ÎÂçȾ¤ò½èÍý¤¹¤ë¤¿¤á¡¢ ÀèƬ¤ÎÊý¤Ë»ý¤Ã¤Æ¤¤Æ¤¯¤À¤µ¤¤¡£¤³¤Î¥ë¡¼¥ë¤ÎÁ°¤Ë¤Ï allow tcp ¤È¤¤¤¦µ½Ò¤òÃÖ¤«¤Ê¤¤¤Ç¤¯¤À¤µ¤¤¡£
Îɤ¯»È¤ï¤ì¤ë¥ë¡¼¥ë¤ò¡¢ ¤¢¤Þ¤êÎɤ¯»È¤ï¤ì¤Ê¤¤¥ë¡¼¥ë¤è¤ê¤âÁ°¤ÎÊý¤Ë (¤â¤Á¤í¤ó¥Õ¥¡¥¤¥¢¥¦¥©¡¼¥ë¤Îµö²ÄÀßÄê¤òÊѤ¨¤Ê¤¤ÈϰϤÇ) »ý¤Ã¤Æ¤¤Æ¤¯¤À¤µ¤¤¡£ipfw -a l ¤Ç¥Ñ¥±¥Ã¥È¿ô¤ÎÅý·×¤ò¼è¤ë¤³¤È¤Ç¡¢ ¤É¤Î¥ë¡¼¥ë¤¬ºÇ¤â¤è¤¯»È¤ï¤ì¤Æ¤¤¤ë¤«¤òÄ´¤Ù¤é¤ì¤Þ¤¹¡£
ËÜʸ½ñ¡¢¤ª¤è¤Ó¾¤Îʸ½ñ¤Ï ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/ ¤«¤é¥À¥¦¥ó¥í¡¼¥É¤Ç¤¤Þ¤¹¡£
FreeBSD ¤Ë´Ø¤¹¤ë¼ÁÌ䤬¤¢¤ë¾ì¹ç¤Ë¤Ï¡¢¥É¥¥å¥á¥ó¥È ¤òÆɤó¤À¾å¤Ç <questions@FreeBSD.org> ¤Þ¤Ç (±Ñ¸ì¤Ç)
Ï¢Íí¤·¤Æ¤¯¤À¤µ¤¤¡£
ËÜʸ½ñ¤Ë´Ø¤¹¤ë¼ÁÌä¤Ë¤Ä¤¤¤Æ¤Ï¡¢<doc@FreeBSD.org> ¤Þ¤ÇÅŻҥ᡼¥ë¤ò (±Ñ¸ì¤Ç)
Á÷¤Ã¤Æ¤¯¤À¤µ¤¤¡£