您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 数据通信与网络 > H3C三层交换机DHCP配置实例(H3C网络设备)
DHCP典型配置【需求】DHCP的主要用途是:通过DHCP服务器的协助来控管各个客户机(执行中的用户端)上不可缺少的网络配置参数,包括DNS(DomainNameService域名服务),WINS(WindowsInternetNameServiceWindows互联网名字服务)等。【组网图】【配置脚本】RouterA配置脚本#sysnameRouterA#radiusschemesystem#domainsystem#dhcpserverip-pool1/创建DHCP地址池/network192.168.0.0mask255.255.255.0/指定可以分配的地址段/gateway-list192.168.0.1/指定网关/dns-list192.168.0.2/指定DNSserver地址/domain-namehuawei-3com.com/指定域名/#interfaceEthernet0/0ipaddress192.168.0.1255.255.255.0/配置网关地址/#interfaceSerial2/0link-protocolppp#interfaceNULL0#dhcpserverforbidden-ip192.168.0.1192.168.0.2/保留网关、DNS的地址/#user-interfacecon0user-interfacevty04#return【验证】在PC上执行“ipconfig”,该PC已经通过DHCP自动获取IP地址、网关、域名信息。C:\ipconfigWindowsIPConfigurationEthernetadapter本地连接:Connection-specificDNSSuffix.:huawei-3com.comIPAddress............:192.168.0.3SubnetMask...........:255.255.255.0DefaultGateway.........:192.168.0.1【提示】1、只给出DHCPserver上最基本的配置,其它可选配置可以查看《操作手册》5.1.2DHCPRelay典型配置【需求】路由器进行DHCPRelay,将DHCP报文进行中继。【组网图】【配置脚本】RouterA配置脚本#sysnameRouterA#radiusschemesystem#domainsystem#interfaceEthernet1/0/0ipaddress192.168.0.1255.255.255.0iprelayaddress202.38.1.2/指定DHCPServer地址/dhcpselectrelay/配置为DHCPrelay方式/#interfaceSerial2/0/0link-protocolpppipaddress10.0.0.2255.255.255.252#interfaceNULL0#iproute-static0.0.0.00.0.0.010.0.0.1preference60#user-interfacecon0user-interfacevty04#return【提示】1、DHCPServer可以使用PCServer,也可以使用路由器充当。2、当使用路由器作为DHCPServer的配置,和上一节的配置类似。5.1.3DHCPClient典型配置【需求】路由器作为DHCPClient,获取接口的动态IP地址。主要用在使用路由器的以太网接口通过LAN方式接入公网的组网。【组网图】【配置脚本】RouterA配置脚本#sysnameRouterA#radiusschemesystem#domainsystem#interfaceEthernet1/0/0ipaddressdhcp-alloc/配置DHCP方式获取地址/#interfaceEthernet1/0/1ipaddress192.168.0.1255.255.255.0#interfaceNULL0#iproute-static0.0.0.00.0.0.0202.101.68.1preference60/指定默认出口路由/#user-interfacecon0user-interfacevty04#return【验证】通过dispint可以查看接口获取的IP地址[Quidway]dispinte1/0/0Ethernet1/0/0currentstate:UPLineprotocolcurrentstate:UPDescription:Ethernet1/0/0InterfaceTheMaximumTransmitUnitis1500,Holdtimeris10(sec)InternetAddressis202.101.xx.4/24,acquiredviaDHCPIPSendingFrames'FormatisPKTFMT_ETHNT_2,Hardwareaddressis00e0-fc45-2ca7Mediatypeistwistedpair,loopbacknotset,promiscuousmodenotset100Mb/s,Full-duplex,linktypeisautonegotiationOutputflow-controlisdisabled,inputflow-controlisdisabledOutputqueue:(Urgentqueue:Size/Length/Discards)0/50/0Outputqueue:(Protocolqueue:Size/Length/Discards)0/500/0Outputqueue:(FIFOqueuing:Size/Length/Discards)0/75/0Last300secondsinputrate0.00bytes/sec,0.00packets/secLast300secondsoutputrate0.00bytes/sec,0.00packets/secInput:406packets,57174bytes,406buffers218broadcasts,0multicasts,0pauses0errors,0runts,0giants0crc,0alignerrors,0overruns0dribbles,0drops,0nobuffersOutput:268packets,37113bytes,269buffers86broadcasts,19multicasts,0pauses0errors,0underruns,0collisions0deferred,0lostcarriers【提示】1、为了实现上网功能必须指定默认路由器。该网关的地址可以通过debugdhcpclientpacket获得。将设备的默认路由指向该网关就可以了。该默认网关一般都是固定不变的,不会随地址的获取和释放而变化。
本文标题:H3C三层交换机DHCP配置实例(H3C网络设备)
链接地址:https://www.777doc.com/doc-7024893 .html