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

Linux²Ù×÷ϵͳÏÂRouteÃüÁîÏêϸʹÓÃ˵Ã÷

http://linux.vbird.org/linux_server/0140networkcommand.php
ʹÓ÷ÓÉ·½Ê½£¬Ê¹ÓÃrouteÃüÁî¡£
-- RouteÃüÁîµÄÕýÈ·Ó÷¨
ʹÓà Route ÃüÁîÐй¤¾ß²é¿´²¢±à¼­¼ÆËã»úµÄ IP ·ÓÉ±í¡£Route ÃüÁîºÍÓï·¨ÈçÏÂËùʾ£º
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]
-f Çå³ýËùÓÐÍø¹ØÈë¿ÚµÄ·ÓÉ±í¡£
-p Óë add ÃüÁîÒ»ÆðʹÓÃʱʹ·ÓɾßÓÐÓÀ¾ÃÐÔ¡£
Command Ö¸¶¨ÄúÏëÔËÐеÄÃüÁî (Add/Change/Delete/Print)¡£
Destination Ö¸¶¨¸Ã·ÓɵÄÍøÂçÄ¿±ê¡£
mask Netmask Ö¸¶¨ÓëÍøÂçÄ¿±êÏà¹ØµÄÍøÂçÑÚÂ루Ҳ±»³Æ×÷×ÓÍøÑÚÂ룩¡£
Gateway Ö¸¶¨ÍøÂçÄ¿±ê¶¨ÒåµÄµØÖ·¼¯ºÍ×ÓÍøÑÚÂë¿ÉÒÔµ½´ïµÄÇ°½ø»òÏÂÒ»Ô¾µã IP µØÖ·¡£
metric Metric Ϊ·ÓÉÖ¸¶¨Ò»¸öÕûÊý³É±¾Öµ±ê£¨´Ó 1 ÖÁ 9999£©£¬µ±ÔÚ·Óɱí(Óëת·¢µÄÊý¾Ý°üÄ¿±êµØÖ·×îÆ¥Åä)µÄ¶à¸ö·ÓÉÖнøÐÐÑ¡Ôñʱ¿ÉÒÔʹÓá£
if Interface Ϊ¿ÉÒÔ·ÃÎÊÄ¿±êµÄ½Ó¿ÚÖ¸¶¨½Ó¿ÚË÷Òý¡£ÈôÒª»ñµÃÒ»¸ö½Ó¿ÚÁбíºÍËüÃÇÏàÓ¦µÄ½Ó¿ÚË÷Òý£¬Ê¹Óà route print ÃüÁîµÄÏÔʾ¹¦ÄÜ¡£¿ÉÒÔʹÓÃÊ®½øÖÆ»òÊ®Áù½øÖÆÖµ½øÐнӿÚË÷Òý¡£
/? ÔÚÃüÁîÌáʾ·û´¦ÏÔʾ°ïÖú¡£
ʾÀý
ÈôÒªÏÔʾ IP ·ÓɱíµÄÈ«²¿ÄÚÈÝ£¬Çë¼üÈ룺
route print
ÈôÒªÏÔʾÒÔ 10. ÆðʼµÄ IP ·ÓɱíÖеÄ·ÓÉ£¬Çë¼üÈ룺
route print 10.*
ÈôÒªÌí¼Ó´øÓÐ 192.168.12.1 ĬÈÏÍø¹ØµØÖ·µÄĬÈÏ·ÓÉ£¬Çë¼üÈ룺
route add 0.0.0.0 mask 0.0.0.0 192.168.12.1
ÈôÒªÏò´øÓÐ 255.255.0.0 ×ÓÍøÑÚÂëºÍ 10.27.0.1 ÏÂÒ»Ô¾µãµØÖ·µÄ 10.41.0.0 Ä¿±êÖÐÌí¼ÓÒ»¸ö·ÓÉ£¬Çë¼üÈ룺
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1
ÈôÒªÏò´øÓÐ 255.255.0.0 ×ÓÍøÑÚÂëºÍ 10.27.0.1 ÏÂÒ»Ô¾µãµØÖ·µÄ 10.41.0.0 Ä¿±êÖÐÌí¼ÓÒ»¸öÓÀ¾Ã·ÓÉ£¬Çë¼üÈ룺
route -p add 10.41.0.0 mask 255.255.0.0 10.27.0.1
ÈôÒªÏò´øÓÐ 255.255.0.0 ×ÓÍøÑÚÂë¡¢10.27.0.1 ÏÂÒ»Ô¾µãµØÖ·ÇÒÆä³É±¾Öµ±êΪ 7 µÄ 10.41.0.0 Ä¿±êÖÐÌí¼ÓÒ»¸ö·ÓÉ£¬Çë¼üÈ룺
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 metric 7
ÈôÒªÏò´øÓÐ 255.255.0.0 ×ÓÍøÑÚÂë¡¢10.27.0.1 ÏÂÒ»Ô¾µãµØÖ·ÇÒʹÓà 0x3 ½Ó¿ÚË÷ÒýµÄ 10.41.0.0 Ä¿±êÖÐÌí¼ÓÒ»¸ö·ÓÉ£¬Çë¼üÈ룺
route add 10.41.0.0 mask 255.255.0.0 10.27.0.1 if 0x3
ÈôҪɾ³ýµ½´øÓÐ 255.255.0.0 ×ÓÍøÑÚÂëµÄ 10.41.0.0 Ä¿±êµÄ·ÓÉ£¬Çë¼üÈ룺
route delete 10.41.0.0 mask 255.255.0.0
ÈôҪɾ³ýÒÔ 10. ÆðʼµÄ IP ·ÓɱíÖеÄËùÓзÓÉ£¬Çë¼üÈ룺


Ïà¹ØÎĵµ£º

linux½ø³Ì²é¿´ÖÐSTATµÄº¬Òå

¸ù¾ÝMAN°ïÖú·­ÒëµÄ£¬²»ÖªµÀ×¼²»×¼È·£º
       D    ²»¿ÉÖжϵÄÐÝÃß½ø³Ì(Ò»°ãΪ IOÏà¹ØµÄ)
       R    ÕýÔÚÔËÐеĻò½«ÔËÐеÄ(ÔÚÔËÐжÓÁÐÖÐ)
       S    ÒäÖжϵÄÐÝÃß½ø ......

Linux³ÌÐòÉè¼Æ——ÓÃgetopt´¦ÀíÃüÁîÐвÎÊý

LinuxϺܶà³ÌÐòÉõÖÁÄÇЩ¾ßÓÐͼÐÎÓû§½çÃ棨graphical user interface£¬GUI£©µÄ³ÌÐò£¬¶¼ÄܽÓÊܺʹ¦ÀíÃüÁîÐÐÑ¡Ïî¡£¶ÔÓÚijЩ³ÌÐò£¬ÕâÊÇÓëÓû§½øÐн»»¥µÄÖ÷ÒªÊֶΡ£¾ßÓпɿ¿µÄ¸´ÔÓÃüÁîÐвÎÊý´¦Àí»úÖÆ£¬»áʹµÃÄúµÄÓ¦ÓóÌÐò¸üºÃ¡¢¸üÓÐÓá£getopt()ÊÇÒ»¸öרÃÅÉè¼ÆÀ´¼õÇáÃüÁîÐд¦Àí¸ºµ£µÄ¿âº¯Êý¡£
1¡¢ÃüÁîÐвÎÊý
ÃüÁîÐгÌÐòÉè¼Æ ......

ShellµÄʹÓ×—linux¹¤³Ìʦ±Øѧ»ù´¡

Ô­µØÖ·£ºhttp://selftest.51cto.com/subread.php?sid=213
×Ô²â¼ò½é£º    
ShellÒ²½Ð×öÃüÁîÐнçÃ棬ËüÊÇUnix/ÀàUnix²Ù×÷ϵͳÏ´«Í³µÄÓû§ºÍ¼ÆËã»úµÄ½»»¥½çÃæ¡£Óû§Ö±½ÓÊäÈëÃüÁîÀ´Ö´Ðи÷ÖÖ¸÷ÑùµÄÈÎÎñ¡£µ±È»Î¢ÈíµÄWindows²Ù×÷ϵͳҲÌṩÁËÕâÑùµÄ¹¦ÄÜ£¬ËüÃÇÊÇWindows 9XϵÄcommand.com£¬ºÍ»ùÓÚWindows NTµÄ¸ ......

һЩlinux ÃüÁî

#include<unistd.h>
¡¡¡¡¶¨Ò庯Êý£º
¡¡¡¡int execvp(const char *file ,char * const argv []);
¡¡¡¡º¯Êý˵Ã÷£º
¡¡¡¡execvp()»á´ÓPATH »·¾³±äÁ¿ËùÖ¸µÄĿ¼ÖвéÕÒ·ûºÏ²ÎÊýfile µÄÎļþÃû£¬ÕÒµ½ºó±ãÖ´ÐиÃÎļþ£¬È»ºó½«µÚ¶þ¸ö²ÎÊýargv´«¸ø¸ÃÓûÖ´ÐеÄÎļþ¡£
¡¡¡¡·µ»ØÖµ£º
¡¡¡¡Èç¹ûÖ´Ðгɹ¦Ôòº¯Êý²»»á·µ»Ø£¬Ö´ÐÐʧ°ÜÔ ......

linux/init.h ÖÐ__init

ԭʼ¶¨Òå:include/linux/init.h
__initºÍ__exit±ê¼Çº¯Êý£¬__initdataºÍ__exitdata±ê¼ÇÊý¾Ý¡£
´Ëºê¶¨Òå¿ÉÖª±ê¼ÇºóµÄº¯ÊýÓëÊý¾ÝÆäʵÊǷŵ½ÁËÌض¨µÄ£¨´úÂë»òÊý¾Ý£©¶ÎÖС£±ê¼ÇΪ³õʼ»¯µÄº¯Êý,±íÃ÷¸Ãº¯Êý¹©ÔÚ³õʼ»¯ÆÚ¼äʹÓá£ÔÚÄ£¿é×°ÔØÖ®ºó£¬Ä£¿é×°ÔؾͻὫ³õʼ»¯º¯ÊýÈÓµô¡£ÕâÑù¿ÉÒÔ½«¸Ãº¯ÊýÕ¼ÓõÄÄÚ´æÊͷųöÀ´¡£
 
__ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ