DHCP自动分发IP地址

DHCP

动态主机配置协议DHCP,来分配IP地址等网络参数,可以减少管理员的工作量,避免用户手工配置网络参数时造成的地址冲突。

在这里插入图片描述

R1(配置IP地址)
<Huawei>system-view 
[Huawei]undo info-center enable 
[Huawei]sysname R1
[R1]interface e0/0/0
[R1-Ethernet0/0/0]ip address 192.168.1.1 24
[R1-Ethernet0/0/0]quit
[R1]
R1(开启DHCP服务)
[R1]dhcp enable 
R1(配置DHCP服务器)
[R1]ip pool IP
[R1-ip-pool-IP]network 192.168.1.0 mask 24
[R1-ip-pool-IP]gateway-list 192.168.1.1
[R1-ip-pool-IP]dns-list 192.168.1.1 8.8.8.8
[R1-ip-pool-IP]quit
[R1]

##### R1(将DHCP应用于接口)
[R1]interface e0/0/0
[R1-Ethernet0/0/0]dhcp select global 
[R1-Ethernet0/0/0]quit
[R1]
PC机(设置为DHCP)

在这里插入图片描述

PC机(查看是否获取IP地址)
PC>ipconfig

Link local IPv6 address...........: fe80::5689:98ff:fec8:80f6
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.254
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.1.1
Physical address..................: 54-89-98-C8-80-F6
DNS server........................: 192.168.1.1
                                    8.8.8.8
PC机请求DHCP的数据包

在这里插入图片描述

R1(显示DHCP分配记录)
[R1]dis ip pool name IP used  
  Pool-name      : IP
  Pool-No        : 0
  Lease          : 1 Days 0 Hours 0 Minutes
  Domain-name    : -
  DNS-server0    : 192.168.1.1     
  DNS-server1    : 8.8.8.8         
  NBNS-server0   : -               
  Netbios-type   : -               
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.1.1     
  Mask           : 255.255.255.0
  VPN instance   : --
 -----------------------------------------------------------------------------
         Start           End     Total  Used  Idle(Expired)  Conflict  Disable
 -----------------------------------------------------------------------------
     192.168.1.1   192.168.1.254   253     4        249(0)         0        0
 -----------------------------------------------------------------------------

  Network section : 
  --------------------------------------------------------------------------
  Index              IP               MAC      Lease   Status  
  --------------------------------------------------------------------------    
    251   192.168.1.252    5489-9820-0f38        512   Used       
    252   192.168.1.253    5489-98ab-521f        505   Used       
    253   192.168.1.254    5489-98c8-80f6        515   Used       
  --------------------------------------------------------------------------

[R1]
发布了68 篇原创文章 · 获赞 23 · 访问量 7823

猜你喜欢

转载自blog.csdn.net/Yang__Qi/article/details/102469435