华为路由DHCP实验一
一、实验要求
1,R1 0/0/0端口设置ip地址省了
2,R2 0/0/0和0/0/1设置ip地址省了
3.设置路由器3
[ar3]dhcp enable //开通dhcp服务
Info: The operation may take a few seconds. Please wait for a moment.done.
[ar3-Ethernet0/0/0]ip address dhcp-alloc //指定端口dhcp分配
4,设置路由器1
[ar1]dhcp enable //开通dhcp服务
[ar1]ip pool yeslab-1 //dhcp组命名
Info:It’s successful to create an IP address pool.
[ar1-ip-pool-yeslab-1]network 23.1.1.0 mask 255.255.255.0 //设置网段与子网掩码
[ar1-ip-pool-yeslab-1]dns-list 4.4.4.4 //设置dns
[ar1-ip-pool-yeslab-1]excluded-ip-address 23.1.1.3 23.1.1.99 //dhcp分配地址
[ar1-ip-pool-yeslab-1]gateway-list 23.1.1.2 //设置网关
[ar1-ip-pool-yeslab-1]lease day 2 //分配地址租赁时间
[ar1-Ethernet0/0/0]dhcp select global //端口选择全局
5,设置路由器2
[ar2]dhcp enable //开通dhcp服务
[ar2]dhcp server group yeslab //加入服务组
Info:It’s successful to create a DHCP server group.
[ar2-dhcp-server-group-yeslab]dhcp-server 12.1.1.1 //dhcp服务器端口
[ar2-Ethernet0/0/1]dhcp select relay //端口为中继状态
[ar2-Ethernet0/0/1]dhcp relay server-select yeslab //端口服务为X服务
6.设置路由器1
[ar1]ip route-static 23.1.1.0 24 12.1.1.2 //必须加一个静态路由
7,设置路由器3
如果你能显示,就表示正常了哦
[ar3]display ip interface brief //正常获取地址
Interface IP Address/Mask Physical Protocol
Ethernet0/0/0 23.1.1.254/24 up up
[ar3]display interface Ethernet 0/0/0
Ethernet0/0/0 current state : UP
Line protocol current state : UP
Last line protocol up time : 2020-12-15 11:45:52 UTC-08:00
Description:
Route Port,The Maximum Transmit Unit is 1500
Internet Address is allocated by DHCP, 23.1.1.254/24