您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > 华为dhcp命令详解和配置案例整理
±ØÑ¡ÅäÖÃsystem-view½øÈëϵͳÊÓͼdhcpenable¿ªÆôDHCP·þÎñinterfacevlanif1VLANIF1½Ó¿ÚÊÓͼipaddress192.168.1.1VLANIF½Ó¿ÚµÄIPµØÖ·dhcpselectglobalÄܽӿڵÄDHCP·þÎñ¹¦ÄÜ£¬Ö¸¶¨DHCP·þÎñÆ÷´ÓÈ«¾ÖµØÖ·³Ø·ÖÅäµØÖ·¡££¨¿ÉÒÔ¼ÓÔÚ½Ó¿Ú»òVLANÏ£©quitÀ뿪µ±Ç°ÊÓͼippoolbg½øÈëÈ«¾ÖµØÖ·³Øbgnetworkmask255.255.250.0ÅäÖõØÖ·³ØϵÄIPµØÖ··¶Î§gateway-list192.168.1.1DHCPµÄÍø¹Ø¿ÉÑ¡ÅäÖÃdomain-nameXXXÅäÖ÷ÖÅä¸øDHCP¿Í»§¶ËµÄDNSÓòÃûºó׺£¨¿ÉÑ¡ÖеĿÉÑ¡£©dns-list202.106.0.208.8.4.4ÅäÖÃDNSÖ÷ºÍ±¸leaseday1hour1minute1ÅäÖÃIPµØÖ·×âÆÚ£¬´ËÅäÖÃΪһÌìһСʱһ·ÖÖÓ£¬Ä¬ÈÏΪһÌ죬unlimitedΪÎÞÏÞexcluded-ip-address192.168.1.100192.168.1.254excluded-ip-address192.168.1.1ÅäÖõØÖ·³ØÖв»²ÎÓë×Ô¶¯·ÖÅäµÄIPµØÖ·,¶à´ÎÖ´ÐиÃÃüÁ¿ÉÒÔÅäÖöà¸ö²»²ÎÓë×Ô¶¯·ÖÅäµÄIPµØÖ·¶Î¡£static-bindip-address172.16.35.253mac-address28d2-4469-5a55µ±Ò»¸öÓû§ÐèÒª¹Ì¶¨µÄIPµØַʱ£¬¿ÉÒÔ½«µØÖ·³ØÖÐûÓÐÔÚʹÓõÄIPµØÖ·ÓëÓû§µÄMACµØÖ·°ó¶¨¡£DHCPÖм̵±¿Í»§¶ËÓëDHCP·þÎñÆ÷²»ÔÚͬһÍø¶Îʱ£¬Í¨¹ýÔÚDHCPÖмÌÉ豸ת·¢¿Í»§¶Ëµ½DHCP·þÎñÆ÷µÄÇëÇó¡£dhcpenable¿ªÆôDHCP¹¦ÄÜinterfacevlanif1VLANIF1½Ó¿ÚÊÓͼipaddress192.168.1.1VLANIF½Ó¿ÚµÄIPµØÖ·dhcpselectrelayÆô¶¯VLANIF½Ó¿ÚµÄDHCPÖм̹¦ÄÜ¡£ÇëÔÚ×÷ΪDHCPÖм̵ÄÉ豸ÉϽøÐÐÒÔÏÂÅäÖá£dhcpservergroupgroup-name´´½¨DHCP·þÎñÆ÷×é²¢½øÈëDHCP·þÎñÆ÷×éÊÓͼdhcp-serverip-address[ip-address-index]ÏòDHCP·þÎñÆ÷×éÖÐÌí¼ÓDHCP·þÎñÆ÷¡£Ã¿¸öDHCP·þÎñÆ÷×éÏÂ×î¶à¿ÉÒÔÅäÖÃ20¸öDHCP·þÎñÆ÷¡£²»Ö¸¶¨Ë÷Òýʱ£¬ÏµÍ³½«×Ô¶¯·ÖÅäÒ»¸ö¿ÕÏеÄË÷Òý¡£DHCPά»¤ÔÚÈ·ÈÏÐèÒªÇå³ýDHCP·þÎñÆ÷µÄͳ¼ÆÐÅÏ¢ºó£¬ÇëÔÚÓû§ÊÓͼÏÂÖ´ÐÐresetdhcpserverstatisticsÃüÁî¡£ÔÚÈ·ÈÏÐèÒªÇå³ýDHCPÖм̵Äͳ¼ÆÐÅÏ¢ºó£¬ÇëÔÚÓû§ÊÓͼÏÂÖ´ÐÐresetdhcprelaystatisticsÃüÁʹÓÃÃüÁîdisplaydhcpserverstatistics²é¿´DHCP·þÎñÆ÷µÄͳ¼ÆÐÅÏ¢¡£Ê¹ÓÃÃüÁîdisplayippoolnameip-pool-name[low-ip-addresshigh-ip-address|all|expired|conflict|used]²é¿´ÒѾÅäÖõÄÈ«¾ÖµØÖ·³ØÐÅÏ¢¡£Ê¹ÓÃdisplaydhcprelay{all|interfaceinterface-typeinterface-number}ÃüÁî²é¿´VLANIF½Ó¿ÚÅäÖõÄÖмÌDHCP·þÎñÆ÷×éºÍ·þÎñÆ÷×é¶ÔÓ¦µÄ·þÎñÆ÷¡£Ê¹ÓÃdisplaydhcprelaystatisticsÃüÁî²é¿´DHCPRelayͳ¼ÆÐÅÏ¢¡£Ê¹ÓÃdisplaydhcpservergroup[group-name]ÃüÁî²é¿´DHCP·þÎñÆ÷×é³ÉÔ±µÄÅäÖÃÐÅÏ¢¡£ÊÍ·ÅDisippool²é¿´É豸µÄµØÖ·³Øresetippoolinterfacexxall//ÊÍ·ÅÕë¶Ô»ùÓڽӿڵĵØÖ·³Øresetippoolnameyyall//ÊÍ·ÅÕë¶ÔÈ«¾ÖµÄµØÖ·³ØÖ´ÐÐÃüÁîdhcprelayreleaseclient-ip-addressmac-address[server-ip-address|vpn-instancevpn-instance-name]£¬ÏòDHCP·þÎñÆ÷ÉêÇëÊÍ·ÅDHCP¿Í»§¶ËÒѾ»ñÈ¡µ½µÄIPµØÖ·¡£ÔÚϵͳÊÓͼÏ£¬ÅäÖÃͨ¹ýS5300ÊÍ·Å¿Í»§¶ËµÄIPµØַʱ£ºÈç¹û²»Ö¸¶¨DHCP·þÎñÆ÷£¬ÔòÏòËùÓÐÅäÖÃΪÖмÌģʽµÄ½Ó¿ÚËù¶ÔÓ¦µÄDHCP·þÎñÆ÷×éÖеÄDHCP·þÎñÆ÷·¢ËÍÊÍ·ÅÉêÇë¡£Èç¹ûÖ¸¶¨ÁËDHCP·þÎñÆ÷µÄIPµØÖ·£¬ÔòÖ»ÏòÖ¸¶¨DHCP·þÎñÆ÷·¢ËÍÊÍ·ÅÉêÇë¡£ÔÚVLANIF½Ó¿ÚÊÓͼÏ£¬ÅäÖÃͨ¹ýS5300ÊÍ·Å¿Í»§¶ËµÄIPµØַʱ£ºÈç¹û²»Ö¸¶¨DHCP·þÎñÆ÷£¬ÔòÏò¸Ã½Ó¿ÚËù¶ÔÓ¦µÄDHCP·þÎñÆ÷×éÖеÄËùÓÐDHCP·þÎñÆ÷·¢ËÍÊÍ·ÅÉêÇë¡£Èç¹ûÖ¸¶¨ÁËDHCP·þÎñÆ÷µÄIPµØÖ·£¬ÔòÖ»ÏòÖ¸¶¨DHCP·þÎñÆ÷·¢ËÍÊÍ·ÅÉêÇë¡£dhcprelayreleaseÃüÁîÓÃÀ´Í¨¹ýDHCPRelayÏòDHCP·þÎñÆ÷·¢³öÊÍ·Å¿Í»§¶ËÉêÇëµ½µÄIPµØÖ·µÄÇëÇó¡£ÃüÁî¸ñʽdhcprelayreleaseclient-ip-addressmac-address[server-ip-address|vpn-instancevpn-instancename]²ÎÊý˵Ã÷²ÎÊý²ÎÊý˵Ã÷È¡Öµclient-ip-addressÖ¸¶¨DHCP¿Í»§¶ËIPµØÖ·¡£µã·ÖÊ®½øÖÆÐÎʽ¡£mac-addressÖ¸¶¨DHCP¿Í»§¶ËµÄMACµØÖ·¡£¸ñʽΪH-H-H¡£server-ip-addressÖ¸¶¨DHCP·þÎñÆ÷µÄIPµØÖ·¡£µã·ÖÊ®½øÖƸñʽ¡£vpn-instancevpn-instancenameÊÍ·ÅIPµØÖ·³Øʱָ¶¨Server-IPµÄVPNÃû³Æ¡£Ö»ÔÚϵͳÊÓͼÏÂÖ§³Ö´Ë²ÎÊývpn-instancenameΪ×Ö·û´®ÐÎʽ£¬È¡Öµ·¶Î§ÊÇ1¡«31ÅäÖð¸Àý1ͬÍø¶ÎÄÚÅäÖûùÓÚÈ«¾ÖµØÖ·³ØµÄDHCP·þÎñÆ÷ʾÀý¿Í»§¶ËºÍDHCP·þÎñÆ÷ÔÚͬһÍø¶Î£¬ÅäÖûùÓÚÈ«¾ÖµØÖ·³ØµÄDHCP·þÎñÆ÷¸ø¿Í»§¶Ë·ÖÅäIPµØÖ·µÄ¹ý³Ì¡£×éÍøÐèÇóij¹«Ë¾ÓÐÁ½¸ö´¦ÓÚͬһÍøÂçÄڵİ칫ÊÒ£¬ÎªÁ˽ÚÊ¡ÍøÂç×ÊÔ´£¬Á½¸ö°ì¹«ÊÒÄÚµÄPC»úÓÉһ̨½»»»»ú×÷Ϊ·þÎñÆ÷ͳһ·ÖÅäIPµØÖ·¡£Èçͼ1Ëùʾ£¬SwitchAÓ¦ÓÃΪDHCP·þÎñÆ÷£¬SwitchBºÍSwitchCΪÓû§½ÓÈë½»»»»ú¡£¿ÉÔÚSwitchAÉÏÅäÖûùÓÚÈ«¾ÖµÄµØÖ·³ØºÍ½Ó¿ÚµÄµØÖ·³Ø£¬ÏÂÃæÒÔÈ«¾ÖµØÖ·³ØΪÀýÅäÖÃSwitchAΪͬһÍø¶ÎÖеĿͻ§¶Ë¶¯Ì¬·ÖÅäIPµØÖ·¡£µØÖ·³ØÍø¶Î10.1.1.0/24·ÖΪÁ½¸öÍø¶Î£º10.1.1.0/25ºÍ10.1.1.128/25¡£DHCP·þÎñÆ÷Á½¸öVLANIF½Ó¿ÚµÄIPµØÖ··Ö±ðΪ10.1.1.1/25ºÍ10.1.1.129/25¡£Íø¶Î10.1.1.0/25ÄÚµÄPC»úÊýÁ¿±È½ÏÉÙÇÒλÖñȽϹ̶¨£¬µØÖ·×âÓÃÆÚÏÞÅäÖÃΪ10Ì죬DNSµØַΪ10.1.1.2£¬ÎÞNetBIOSµØÖ·£¬³ö¿ÚÍø¹ØµØַΪ10.1.1.126¡£Íø¶Î10.1.1.128/25ÄÚµÄPC»úÊýÁ¿½Ï¶àµ«¾³£Íâ½è£¬µØÖ·×âÓÃÆÚÏÞÅäÖÃΪ2Ì죬DNSµØַΪ10.1.1.2£¬NetBIOSµØַΪ10.1.1.4£¬³ö¿ÚÍø¹ØµØַΪ10.1.1.254¡£Í¼1ÅäÖûùÓÚÈ«¾ÖµØÖ·³ØµÄDHCP·þÎñÆ÷×éÍøͼÅäÖÃ˼·DHCP·þÎñÆ÷µÄÅäÖÃ˼·ÈçÏ£ºÆô¶¯¹«Ë¾ÍøÂçÄÚSwitchAµÄDHCP·þÎñÆ÷¹¦ÄÜ¡£ÔÚSwitchÉÏ´´½¨µØÖ·³Ø²¢ÅäÖõØÖ·³ØµÄÏà¹ØÊôÐÔ£¬ÈçµØÖ·³Ø·¶Î§¡¢³ö¿ÚÍø¹Ø¡¢NetBIOSµØÖ·¡¢µØÖ·×âÓÃÆÚÏ޵ȣ¬×¼±¸Ìṩ¸ø¿Í»§¶Ë¡£ÅäÖÃVLANIF½Ó¿Úϱ¾µØDHCP·þÎñÆ÷µÄµØÖ··ÖÅ䷽ʽ£¬DHCP·þÎñÆ÷´ÓÈ«¾ÖµØÖ·³ØÖиø¿Í»§¶Ë·ÖÅäIPµØÖ·¡£Êý¾Ý×¼±¸ÒªÍê³É´ËÅäÖþÙÀý£¬ÐèҪ׼±¸ÒÔÏÂÊý¾Ý£ºSwitchAÉÏÈ«¾ÖµØÖ·Ãû³Æ¼°·¶Î§ËµÃ÷£ºÒÔÏÂÅäÖþùÔÚSwitchAÉϽøÐС£²Ù×÷²½ÖèÆô¶¯DHCP·þÎñ¡£Quidwaysystem-view[Quidway]dhcpenable´´½¨µØÖ·³Ø²¢ÅäÖÃÏà¹ØÊôÐÔ¡£#ÅäÖÃIPµØÖ·³Ø1µÄÊôÐÔ£¨µØÖ·³Ø·¶Î§¡¢DNSµØÖ·¡¢³ö¿ÚÍø¹ØºÍµØÖ·³Ø×âÆÚ£©¡£[Quidway]ippool1[Quidway-ip-pool-1]network10.1.1.0mask255.255.255.128[Quidway-ip-pool-1]dns-list10.1.1.2[Quidway-ip-pool-1]gateway-list10.1.1.126[Quidway-ip-pool-1]excluded-ip-address10.1.1.2[Quidway-ip-pool-1]excluded-ip-address10.1.1.4[Quidway-ip-pool-1]leaseday10[Quidway-ip-pool-1]quit#ÅäÖÃIPµØÖ·³Ø2µÄÊôÐÔ£¨µØÖ·³Ø·¶Î§¡¢DNSµØÖ·¡¢³ö¿ÚÍø¹Ø¡¢NetBIOSµØÖ·ºÍµØÖ·³Ø×âÆÚ£©[Quidway]ippool2[Quidway-ip-pool-2]network10.1.1.128mask255.255
本文标题:华为dhcp命令详解和配置案例整理
链接地址:https://www.777doc.com/doc-6069717 .html