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

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

iptablesÊÇÒ»¸ö
Linux
ÏÂÓÅÐãµÄnat+·À»ðǽ¹¤¾ß£¬ÎÒʹÓøù¤¾ßÒԽϵÍÅäÖõĴ«Í³pcÅäÖÃÁËÒ»¸ö
Áé»îÇ¿¾¢µÄ·À»ðǽ+natϵ
ͳ,СÓÐÐĵ㬿´
ÁËÍøÉÏÒ²ÓкܶàÕâ·½ÃæµÄÎÄÕ£¬µ«ÊÇËƺõҪô˵µÄ±È½ÏÉÙ£¬ÒªÃ´¾ÍÊDZȽÏÆ«£¬ÄÚÈݲ»È«£¬ÈÝÒ×Îóµ¼£¬ÎÒÑо¿ÁËÒ»¶Îʱ¼äµÄ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ÏÂcÓïÑÔ±à³Ì vi ¼ò½é

 /*±¾ÎÄÑ¡×Ô²©´´linuxʵÑéÖ¸µ¼Êé
*Áô×Å×Ô¼ºÑ§Ï°Ö®ÓÃ
*ÔÚÕâÀï±£´æ×Å£¬·ÖÏíÒ»ÏÂ*/
VI ¼ò½é
    vi ÊÇ Linux/Unix ÊÀ½çÀKΪÆÕ±éµÄ¿ÉÊÓ»¯µÄÈ«ÆÁÄ»Îı¾±à¼­Æ÷(visual edit),¼¸ºõ¿É
ÒÔ˵ÈκÎһ̨ Linux/Unix »úÆ÷¶¼»áÌṩÕâ¸öÈí¼þ¡£
    vi ÓÐÈýÖÖ״̬,¼´±à¼­·½Ê½¡¢²åÈ뷽ʽºÍÃüÁî·½Ê ......

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

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

linuxÏÂcÓïÑÔÁ¬½ÓmysqlÊý¾Ý¿â

ÔÚFC8ÖÐĬÈÏ°²×°µÄÓÐmysql£¬Ã»ÓеĻ°¿ÉÒԺܷ½±ãµÄ°²×°Ï¡£
ĬÈϵÄmysqlµÄincludeÎļþĿ¼ÔÚ/usr/include/mysql
ĬÈϵÄmysqlµÄlibÎļþ¼ÐÔÚ/usr/lib/mysql
ÕâÁ½¸öĿ¼ÔÚÎÒÃDZàÒëʱºòÐèÒªµ½¡£
ÎҵIJâÊÔÓõÄC´úÂëΪ£º
££include <stdio.h>
#include <stdlib.h>
#include <mysql.h>
#define CONN_HOST ......

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


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

ÔÚLinuxÏ°²×°OpenCV

¸ãÁËÈýÌìµÄOpenCVÖÕÓÚ°ÑÕâ¸öÀà¿â¼ÓÉÏÈ¥ÁË¡£Ô­±¾ÊÇʹÓÃRed Hat Linux 9£¬µ«ÊÇÇ¿ÁÒ²»ÍƼö£¬ÒòΪ»ù±¾ÉϺܶàºÜ¶àµÄÈí¼þ¶¼ÒªÖØÐÂÉý¼¶¸üС£gcc±ØÐëÉý¼¶µ½4.x£¬ÔògmpºÍmpfrÒ²Òª¸üУ¬makeÒ²Òªµ½3.8°æ±¾£¬²¢ÇÒglibcÒ²±ØÐëÔÚ2.6°æ±¾¡£±àÒëgccʵÔÚÊÇÌ«Í´¿àÁË£¬ÎÞ±ÈÎޱȵÄÍ´¿à£¬ºÄʱ3¸ö¶àhours£¬»¹ÊÇÀ´Á˸öerror£¨glibc±ØÐëÉý¼¶£©¡£±à ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ