HCNA-45 配置DHCP中继
基本配置+OSPF协议配置 <Huawei>system-view [Huawei]sysnamer1 [r1]interfaceGigabitEthernet 0/0/1 [r1-GigabitEthernet0/0/1]ipaddress 172.16.12.1 24 [r1-GigabitEthernet0/0/1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]ipaddress 192.168.10.1 24 [r1-GigabitEthernet0/0/0]quit [r1]ospf1 [r1-ospf-1]area0 [r1-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r1-ospf-1-area-0.0.0.0]network192.168.10.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 [r1-ospf-1-area-0.0.0.0]return <Huawei>system-view [Huawei]sysnamer2 [r2]interfaceGigabitEthernet 0/0/0 [r2-GigabitEthernet0/0/0]ipaddress 172.16.12.2 24 [r2-GigabitEthernet0/0/0]interfaceGigabitEthernet 0/0/1 [r2-GigabitEthernet0/0/1]ipaddress 172.16.23.2 24 [r2-GigabitEthernet0/0/1]quit [r2]ospf1 [r2-ospf-1]area0 [r2-ospf-1-area-0.0.0.0]network172.16.12.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]network172.16.23.0 0.0.0.255 [r2-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r2-ospf-1-area-0.0.0.0]return <Huawei>system-view [Huawei]sysnamer3 [r3]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]ipaddress 172.16.23.3 24 [r3-GigabitEthernet0/0/0]quit [r3]ospf1 [r3-ospf-1]area0 [r3-ospf-1-area-0.0.0.0]network172.16.23.0 0.0.0.255 [r3-ospf-1-area-0.0.0.0]authentication-modemd5 1 cipher admin1234 [r3-ospf-1-area-0.0.0.0]return
配置全局DHCP服务器 <r3>system-view [r3]dhcpenable //DHCP服务开启 [r3]ippool zurkj //创建IP地址池zurkj [r3-ip-pool-zurkj]network192.168.10.0 mask 24 //配置网段 掩码 [r3-ip-pool-zurkj]gateway-list192.168.10.1 //配置网关地址 [r3-ip-pool-zurkj]excluded-ip-address192.168.10.200 192.168.10.254 //配置不参于分配IP地址(保留地址) [r3-ip-pool-zurkj]leaseday 0 hour 12 minute 0 //配置DHCP租约 [r3-ip-pool-zurkj]dns-list114.114.114.114 8.8.8.8 //配置DHCP DNS主DNS 备用DNS [r3-ip-pool-zurkj]quit [r3]interfaceGigabitEthernet 0/0/0 [r3-GigabitEthernet0/0/0]dhcpselect global //配置选择全局DHCP方式 [r3]displayip pool //查看IP地址池信息 ----------------------------------------------------------------------- Pool-name : zurkj Pool-No : 0 Position : Local Status : Unlocked Gateway-0 : 192.168.10.1 Mask : 255.255.255.0 VPN instance : -- IP address Statistic Total :253 Used :0 Idle :198 Expired :0 Conflict :0 Disable :55
配置DHCP中继功能 方法1:适用于小规模DHCP,无需太多繁琐的配置 <r1>system-view [r1]dhcpenable //开启DHCP [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]dhcpselect relay //DHCP选择中继方式 [r1-GigabitEthernet0/0/0]dhcprelay server-ip 172.16.23.3 //配置DHCP中继服务IP地址(地址为DHCP服务器地址)
方法2:适合于较大规模DHCP,可以卫降低配置量 [r1]dhcpenable //DHCP功能开启 [r1]dhcpserver group zurkj //配置DHCP服务组 zurkj [r1-dhcp-server-group-zurkj]dhcp-server172.16.23.3 //配置DHCP服务地址 [r1-dhcp-server-group-zurkj]quit [r1]interfaceGigabitEthernet 0/0/0 [r1-GigabitEthernet0/0/0]dhcpselect relay //配置DHCP选择中继 [r1-GigabitEthernet0/0/0]dhcprelay server-select zurkj //配置DHCP中继服务选择zurkj组 [r1-GigabitEthernet0/0/0]quit |