Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Linux iptables ¶Ë¿Ú Ó³Éä°¸Àý

iptablesÊÇÒ»¸ö
Linux
ÏÂÓÅÐãµÄnat+·À»ðǽ¹¤¾ß£¬ÎÒʹÓøù¤¾ßÒԽϵÍÅäÖõĴ«Í³pcÅäÖÃÁËÒ»¸ö
Áé»îÇ¿¾¢µÄ·À»ðǽ+natϵ
ͳ,СÓÐÐĵ㬿´
ÁËÍøÉÏÒ²ÓкܶàÕâ·½ÃæµÄÎÄÕ£¬µ«ÊÇËÆºõҪô˵µÄ±È½ÏÉÙ£¬ÒªÃ´¾ÍÊÇ±È½ÏÆ«£¬ÄÚÈݲ»È«£¬ÈÝÒ×Îóµ¼£¬ÎÒÑо¿ÁËÒ»¶Îʱ¼äµÄiptablesͬʱҲÓÃÁ˺ܾã¬ÓеãµÎ
¾­Ñ飬дÀ´¹©´ó¼Ò²Î¿¼£¬Í¬Ê±Ò²±¸ÈÕºó×Ô¼º·­ÔÄ¡£
Ê×ÏÈҪ˵Ã÷µÄÊÇ£¬iptables²Ù×÷µÄÊÇ2.4ÒÔÉÏÄں˵Änetfilter.ËùÒÔÐèÒª linuxµÄÄÚºËÔÚ2.4ÒÔÉÏ¡£Æä¹¦ÄÜÓ밲ȫÐÔÔ¶Ô¶±ÈÆäǰ±²
ipfwadm,ipchainsÇ¿´ó£¬iptables´óÖÂÊǹ¤×÷ÔÚOSIÆß²ãµÄ¶þ¡¢Èý¡¢ËIJ㣬Æäǰ±²ipchains
²»Äܵ¥¶ÀʵÏÖ¶Ôtcp/udp
portÒÔ¼°¶ÔmacµØÖ·
µÄ
µÄ¶¨ÒåÓë²Ù×÷£¬ËùÒÔÎÒÏëipchainsÓ¦¸ÃÊǽö½ö¹¤×÷ÔÚÈý²ãÉϵġ£
ÎÒÃÇ
Ïȼòµ¥½éÉÜÒ»ÏÂ
netfilterµÄ´óÖ¹¤×÷Á÷³Ì£¬Ò²¾ÍÊÇÒ»¸öÊý¾Ý°ü£¨»òÕ߽зÖ×é¡¢packet,ÎÒ¸öÈËϰ¹ß½Ð°ü£©ÔÚµ½´ïlinuxµÄÍøÂç½Ó¿ÚµÄʱºò
£¨Íø¿¨£©ÈçºÎ´¦ÀíÕâ¸ö°ü£¬È»ºóÔÙ½éÉÜÒ»ÏÂÈçºÎÓÃiptables¸Ä±ä»òÕß˵¿ØÖƶÔÕâ¸öÊý¾Ý°ü½øÐвÙ×÷¡£netfilterÄÚ²¿·ÖΪÈý¸ö±í£¬·Ö±ðÊÇ
filter,nat,mangle£¬Ã¿¸ö±íÓÖÓв»Í¬µÄ²Ù×÷Á´£¨Chains£©¡£ÔÚfilter£¨¹ýÂË£©±íÖУ¬Ò²¾ÍÊÇËûµÄ·À»ðǽ¹¦ÄܵÄÕâ¸ö±í£¬¶¨ÒåÁËÈý¸ö

Chain¡£·Ö±ðÊÇINPUT,FORWARD,OUTPUT¡£Ò²¾ÍÊǶ԰üµÄÈ롢ת·¢¡¢³ö½øÐж¨ÒåµÄÈý¸ö¹ýÂËÁ´¡£¶ÔÓÚÕâ¸öfilter±íµÄ²Ù×÷ºÍ¿ØÖÆÒ²ÊÇ
ÎÒÃÇ
ʵÏÖ·À»ðǽ¹¦ÄܵÄÒ»¸ö
ÖØÒªÊֶΣ»ÔÚnat(Network Address
Translation¡¢ÍøÂçµØÖ··­Òë)±íÖУ¬Ò²¾ÍÊÇÎÒÃÇÓÃÒÔʵÏÖµØÖ·×ª»»ºÍ¶Ë¿Úת·¢¹¦ÄܵÄÕâ¸ö±í£¬¶¨ÒåÁËPREROUTING,
POSTROUTING,OUTPUTÈý¸öÁ´,ÏÂÃæÎÒÃÇ»á¶ÔÕâÈý¸öÁ´×÷ÏêϸµÄ˵Ã÷£»¶ønetfilterµÄmangle±íÔòÊÇÒ»¸ö×Ô¶¨Òå±í£¬ÀïÃæ°üÀ¨ÉÏÃæ

µÄfilterÒÔ¼°nat±íÖеĸ÷ÖÖchains,Ëü¿ÉÒÔÈÃÎÒÃǽøÐÐһЩ×Ô¶¨ÒåµÄ²Ù×÷£¬Í¬Ê±Õâ¸ömangle±íÖеÄchainsÔÚnetfilter¶Ô°ü

µÄ´¦ÀíÁ÷³ÌÖд¦ÔÚÒ»¸ö±È½ÏÓÅÏȵÄλÖã¬ÏÂÃæÓÐÒ»ÕÅͼÇåÎúµÄÃè»æÁËnetfilter¶Ô°üµÄ´¦ÀíÁ÷³Ì£¨¸Ãͼժ×ÔÍøÉÏ£¬²»Öª×÷ÕßÊÇË­£¬ÔÚ´ËÉî±í¾´Ò⣡£©£¬Ò»°ã
Çé¿öÏ£¬ÎÒÃÇÓò»µ½Õâ¸ömangle±í£¬ÔÚÕâÀïÎÒÃǾͲ»×ö½éÉÜÁË¡£
´ó¼Ò¿ÉÒÔ¿´µ½£¬PREROUTINGÕâ¸öchainÔÚ×îÇ°Ãæ£¬µ±Ò»¸ö°üÀ´µ½linuxµÄÍøÂç½Ó¿ÚµÄʱºòÏȹýmangleµÄPREROUTING,È»ºóÊÇ
natµÄPREROUTING,´ÓÕâ¸öchainµÄÃû×ÖÎÒÃÇ¿ÉÒÔ¿´³ö£¬Õâ¸öchainÊÇÔÚ·ÓÉ֮ǰ(pre-routing)Òª¹ýµÄ¡£ÎªÊ²Ã´ÒªÔÚ·ÓÉ֮ǰ
¹ýÄØ£¿´ó¼Ò¿ÉÒÔ¿´µ½Õâ¸öͼÉÏ£¬ÉÏÃæÓÐÒ»¸öÁâÐεIJ¿·Ö½ÐROUTING,Õâ¸öROUTING²¿·Ö¾ÍÊÇLinuxµÄroute


Ïà¹ØÎĵµ£º

Linux²é¿´ÏµÍ³ÅäÖó£ÓÃÃüÁî

ϵͳ
# uname -a               # ²é¿´
ÄÚºË/²Ù×÷ϵͳ/CPUÐÅÏ¢
# head -n
1 /etc/issue   # ²é¿´
²Ù×÷ϵͳ°æ±¾
# cat /proc/cpuinfo      # ²é¿´
CPUÐÅÏ¢
#
hostname    &nb ......

LINUXϹÒÔØusb

Ò»ÔçÉ϶¼ÊÇŪÔÚLINUXϹÒÔØusb£¬ºÜÎÞÓ¼¸ºõÕÒ±éÁËËùÓÐÍøÉÏÈ˼ҽéÉܵķ½·¨£¬¿É¶ÔÓÚÒ»¸öÐÂÊÖÀ´Ëµ£¬ËûÃÇ´ó¶¼½²µÄ²»Çå³þ²»³þ£¬×îºó»¹ÊǾõµÃÕâ¸ö±È½Ï·½·¨±È½Ï³É¹¦£¬ËùÒÔÌù³öÀ´´ó¼Ò·ÖÏí£¬Ëµ²»¶¨ÒÔºó»¹ÄÜÓõõ½
1.USBÒÆ¶¯´æ´¢É豸ͨ³£±»Ê¶±ðΪsda1£¬¾ßÌå¿ÉÒÔͨ¹ýfdisk -lÃüÁî²éѯ¡£Ò»°ãÍâ¹ÒµãµÄ×ÓĿ¼¶¼Êǽ¨Á¢ÔÚ/mntÀïÃæµÄ ʹÓà ......

Linux ×Ö·ûÉ豸Çý¶¯³ÌÐòµÄ±àд¿ò¼Ü

Ò»¡¢Linux device driver µÄ¸ÅÄî

ϵͳµ÷ÓÃÊDzÙ×÷ϵͳÄں˺ÍÓ¦ÓóÌÐòÖ®¼äµÄ½Ó¿Ú£¬É豸Çý¶¯³ÌÐòÊDzÙ×÷ϵͳÄں˺ͻúÆ÷Ó²¼þÖ®¼äµÄ½Ó¿Ú¡£É豸Çý¶¯³ÌÐòΪӦÓóÌÐòÆÁ±ÎÁËÓ²¼þµÄϸ½Ú£¬ÕâÑùÔÚÓ¦ÓóÌ
Ðò¿´À´£¬Ó²¼þÉ豸ֻÊÇÒ»¸öÉ豸Îļþ£¬Ó¦ÓóÌÐò¿ÉÒÔÏó²Ù×÷ÆÕͨÎļþÒ»Ñù¶ÔÓ²¼þÉ豸½øÐвÙ×÷¡£Éè±¸Ç ......

linux bin Ŀ¼ÏÂÃüÁî¼òҪ˵Ã÷


ÃüÁî
½âÊÍ˵Ã÷
alsacard
¼ì²âÉù¿¨
alsaunmute
¾²ÒôÉèÖÃ
arch
²é¿´Ó²¼þÀàÐÍ
awk
Ò»ÖÖ³ÌÐòÓïÑÔ»·¾³
basename
È¥³ýÎļþÃûµÄĿ¼²¿·ÖºÍºó׺²¿·Ö£¬·µ»ØÒ»¸ö×Ö·û´®²ÎÊýµÄ»ù±¾Îļþ
Ãû³Æ
busybox
±ê×¼Linux
¹¤¾ßµÄÒ»¸öµ¥¸ö¿ÉÖ´ÐгÌÐòʵÏÖ£¬³£ÓÃÓÚǶÈëʽLinux
£¬²Î¼û±¾Êé“Îļþϵͳ”ÄÚÈÝ
cat
Á¬½Ó»òÏ ......

ǶÈëʽLinux½»²æ±àÒë»·¾³µÄ½¨Á¢£¨»ùÓÚ ubuntu 8.10£©


ÔÚ½øÐÐǶÈëʽ¿ª·¢Ö®Ç°£¬Ê×ÏÈÒª½¨Á¢Ò»¸ö½»²æ±àÒë»·¾³£¬ÕâÊÇÒ»Ì×±àÒëÆ÷¡¢Á¬½ÓÆ÷ºÍlibc¿âµÈ×é³ÉµÄ¿ª·¢»·¾³¡£±¾ÎľßÌå˵Ã÷ÁËǶÈëʽ½»²æ±àÒë»·¾³µÄ½¨Á¢¹ý³Ì
ºÍ¾ßÌåµÄ²Ù×÷²½Ö裬ϣÍûÄܹ»¶Ô¸÷λÅóÓѴ¶ÔÓ¦µÄ½»²æ±àÒë»·¾³ÓÐËù°ïÖú¡£
Ò»¡¢ËùÐèÈíÓ²¼þ»·¾³
¡ö Ö÷»ú»·¾³
½¨Á¢½»²æ±àÒ빤¾ßÁ´µÄÖ÷»ú»·¾³£º
Ubuntu 8.10£¬gcc-4.3 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ