linuxÏÂping¶Ë¿ÚÏÂÁîÊÇʲô
ÔÚlinuxÖУ¬ping¶Ë¿ÚÏÂÁîÊÇ¡°telnet¡±ÏÂÁtelnetÏÂÁîÊÇÒ»¸öÓÃÓÚÔÚÔ¶³ÌÖ÷»úÉϽ¨ÉèÓëÖ¸¶¨¶Ë¿ÚµÄÅþÁ¬µÄ¹¤¾ß£¬Ê¾ÀýΪ£º¡°telnet ¡±£¬ÆäÖУ¬ÊÇÄúÏëÒªpingµÄÖ÷»úµÄipµØµã»òÓòÃû£¬ÊÇÄúÏëÒªpingµÄ¶Ë¿ÚºÅ¡£
±¾½Ì³Ì²Ù×÷ϵͳ£ºLinux5.18.14ϵͳ¡¢Dell G3µçÄÔ¡£
ÔÚLinuxÖУ¬¿ÉÒÔʹÓÃtelnetÏÂÁîÀ´Ä£ÄâpingÒ»¸öÌض¨µÄ¶Ë¿Ú¡£telnetÏÂÁîÊÇÒ»¸öÓÃÓÚÔÚÔ¶³ÌÖ÷»úÉϽ¨ÉèÓëÖ¸¶¨¶Ë¿ÚµÄÅþÁ¬µÄ¹¤¾ß¡£È»ºó£¬Äú¿ÉÒÔͨ¹ýʵÑéÓëÄ¿µÄÖ÷»úµÄ¶Ë¿Ú½¨ÉèÅþÁ¬À´¼ì²é¶Ë¿ÚµÄ¿É´ïÐÔ¡£
ÒÔÏÂÊÇʹÓÃtelnetÏÂÁî¾ÙÐÐ¶Ë¿Ú ping µÄʾÀý£º
telnet <Ä¿µÄÖ÷»ú> <Ä¿µÄ¶Ë¿Ú>
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬ ÊÇÄúÏëÒªpingµÄÖ÷»úµÄIPµØµã»òÓòÃû£¬ ÊÇÄúÏëÒªpingµÄ¶Ë¿ÚºÅ¡£
ÀýÈ磬ÈôÊÇÄúÏëpingÄ¿µÄÖ÷»ú example.com µÄ¶Ë¿ÚºÅ 80£¨HTTP¶Ë¿Ú£©£¬Ôò¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ
telnet example.com 80
µÇ¼ºó¸´ÖÆ
ÈôÊǶ˿ڿɴÄú½«¿´µ½Ò»ÌõÀàËÆÓÚÒÔÏÂÐÂÎŵÄÊä³ö£º
Trying xxx.xxx.xxx.xxx... Connected to example.com. Escape character is '^]'.
µÇ¼ºó¸´ÖÆ
ÕâÅú×¢ÄúµÄÅÌËãÐÔÄܹ»ÀÖ³ÉÅþÁ¬µ½Ä¿µÄÖ÷»úµÄÖ¸¶¨¶Ë¿Ú¡£ÈôÊǶ˿ڲ»¿É´ï£¬Äú½«¿´µ½ÅþÁ¬Ê§°ÜµÄ¹ýʧÐÂÎÅ¡£
Çë×¢ÖØ£¬Ä³Ð©Linux¿¯Ðаæ¿ÉÄÜĬÈÏûÓÐ×°ÖÃtelnetÏÂÁî¡£Äú¿ÉÒÔʹÓðü¹ÜÀíÆ÷×°ÖÃtelnet£¬ÀýÈçÔÚUbuntuÉÏ£¬¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁî¾ÙÐÐ×°Öãº
sudo apt-get install telnet
µÇ¼ºó¸´ÖÆ
ÓÐʱҲ¿ÉÒÔʹÓÃncÏÂÁnetcat£©À´¾ÙÐж˿Ú̽²â£¬ËüºÍtelnetÏÂÁîÀàËÆ¡£ÒÔÏÂÊÇʹÓÃncÏÂÁî¾ÙÐÐ¶Ë¿Ú ping µÄʾÀý£º
nc -zv <Ä¿µÄÖ÷»ú> <Ä¿µÄ¶Ë¿Ú>
µÇ¼ºó¸´ÖÆ
ÀýÈ磺
nc -zv example.com 80
µÇ¼ºó¸´ÖÆ
ÎÞÂÛÄúÊÇʹÓÃtelnetÕÕ¾Énc£¬¶¼¿ÉÒÔͨ¹ýÕâЩÏÂÁîÀ´²âÊÔÄ¿µÄÖ÷»úÉϵÄÌض¨¶Ë¿ÚÊÇ·ñ¿É´ï¡£
ÒÔÉϾÍÊÇlinuxÏÂping¶Ë¿ÚÏÂÁîÊÇʲôµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡