ÔõÑùʹÓÃLinuxÏÂÁî²éÕÒDHCP°ü£¿
ÎÊÌ⣺ÔõÑùʹÓÃLinuxÏÂÁî²éÕÒDHCP°ü£¿
ÔÚÍøÂçÖÎÀíÖУ¬DHCP£¨¶¯Ì¬Ö÷»úÉèÖÃÐÒ飩³äµ±×ÅÖ÷ÒªµÄ½ÇÉ«£¬ÈÏÕæΪÍøÂç×°±¸·ÖÅÉIPµØµãºÍÆäËûÏà¹ØÉèÖᣵ±ÍøÂç·ºÆðÎÊÌâʱ£¬×·×ÙºÍÕï¶ÏDHCP°üÊÇÒ»ÏîÐëÒªµÄ²Ù×÷¡£ÔÚLinuxϵͳÖУ¬Í¨¹ýʹÓÃһЩÏÂÁî¿ÉÒÔºÜÀû±ãµØ²éÕÒ¡¢²¶»ñºÍÆÊÎöDHCP°ü£¬±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃÕâЩÏÂÁîÀ´ÊµÏÖÕâһĿµÄ¡£
1. ʹÓÃtcpdumpÏÂÁî
tcpdumpÊÇÒ»¸öÇ¿Ê¢µÄÍøÂç°üÆÊÎö¹¤¾ß£¬¿ÉÒÔ×ÊÖúÎÒÃDz¶»ñºÍÆÊÎöÍøÂçÁ÷Á¿¡£ÏÂÃæÊÇʹÓÃtcpdump²éÕÒDHCP°üµÄÏÂÁîʾÀý£º
sudo tcpdump -i <interface> port 67 or port 68 -vv
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬-iÑ¡ÏîÓÃÓÚÖ¸¶¨ÍøÂç½Ó¿Ú£¨Èçeth0¡¢wlan0µÈ£©£¬port 67 or port 68ÌåÏÖ¹ýÂËDHCPЧÀÍÆ÷¶Ë¿ÚºÍ¿Í»§¶Ë¶Ë¿Ú£¬-vvÓÃÓÚÊä³ö¸üÏêϸµÄÐÅÏ¢¡£Ö´ÐдËÏÂÁ²¶»ñ¾ÓÉÖ¸¶¨½Ó¿ÚµÄËùÓÐDHCP°ü¡£
2. ʹÓÃdhcpdumpÏÂÁî
dhcpdumpÊÇÁíÒ»¸öÓÃÓÚÆÊÎöDHCP°üµÄ¹¤¾ß£¬¿ÉÒÔ¸üÖ±¹ÛµØÏÔʾDHCP½»»¥Àú³Ì¡£ÒÔÏÂÊÇʹÓÃdhcpdumpÀ´²éÕÒDHCP°üµÄʾÀýÏÂÁ
sudo dhcpdump -i <interface>
µÇ¼ºó¸´ÖÆ
ͨ¹ýÕâ¸öÏÂÁdhcpdump½«ÊµÊ±ÏÔʾ¾ÓÉÖ¸¶¨½Ó¿ÚµÄDHCP½»»¥ÐÅÏ¢£¬°üÀ¨DHCP·¢Ã÷¡¢Ìṩ¡¢ÇëÇóºÍÈ·ÈϵȽ׶εÄÊý¾Ý°ü¡£
3. ʹÓÃwireshark¹¤¾ß
wiresharkÊÇÒ»¸öÊ¢ÐеÄÍøÂçÐÒéÆÊÎö¹¤¾ß£¬¿ÉÒÔͼÐλ¯µØÏÔʾÍøÂçÊý¾Ý°üµÄÄÚÈÝ¡£Í¨¹ýwireshark£¬ÎÒÃÇ¿ÉÒÔÀû±ãµØ¹ýÂ˲¢Éó²éDHCP°üµÄÏêϸÐÅÏ¢¡£ÏÂÃæÊÇʹÓÃwireshark²¶»ñDHCP°üµÄ°ì·¨£º
·¿ªwireshark£¬²¢Ñ¡ÕªÒª¼àÌýµÄÍøÂç½Ó¿Ú¡£
ÔÚ¹ýÂËÀ¸ÖÐÊäÈëbootp»òdhcp×÷Ϊ¹ýÂËÌõ¼þ£¬È»ºó×îÏȲ¶»ñ¡£
ͨ¹ý¹ýÂ˺óµÄÊý¾Ý°üÁбíºÍ°üÏêÇ飬¿ÉÒÔÉó²éµ½DHCP½»»¥µÄÕû¸öÀú³Ì¡£
ÒÔÉÏÊǼ¸ÖÖ³£ÓõÄÔÚLinuxϵͳϲéÕÒDHCP°üµÄÒªÁ죬ͨ¹ýÕâЩÏÂÁîºÍ¹¤¾ßµÄÍŽáʹÓã¬ÎÒÃÇ¿ÉÒÔÀû±ãµØ¾ÙÐÐÍøÂç¹ÊÕÏÅŲéºÍ¼à¿ØÊÂÇ顣ϣÍû±¾ÎÄÄܶԶÁÕßÃ÷È·ºÍÓ¦ÓÃLinuxÏÂÁî²éÕÒDHCP°üÓÐËù×ÊÖú¡£
ÒÔÉϾÍÊÇÔõÑùʹÓÃLinuxÏÂÁî²éÕÒDHCP°ü£¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡