*大概是第二天的小实验
DHCP分配ip地址
首先如图所示连接设备
(别忘记开启设备)
开始配置路由器
system-view
Enter system view, return user view with Ctrl+Z.
[Huawei]interface GigabitEthernet 0/0/0 #(进入0/0/0接口)
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 255.255.255.0 #(配置接口ip)
[Huawei-GigabitEthernet0/0/0]q
[Huawei]interface GigabitEthernet 0/0/1 #(进入0/0/1接口)
[Huawei-GigabitEthernet0/0/1]ip address 192.168.2.1 255.255.255.0***#(配置接口ip***)
[Huawei]dhcp enable #(在设备上开启DHCP服务)
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool xbox #(在设备上创建名为xbox的DHCP池塘)
Info: It’s successful to create an IP address pool.
[Huawei-ip-pool-xbox]network 192.168.1.0 mask 255.255.255.0
[Huawei-ip-pool-xbox]gateway-list 192.168.1.1.
[Huawei-ip-pool-xbox]dns-list 114.114.114.114 8.8.8.8
[Huawei-ip-pool-xbox]q
[Huawei]interface GigabitEthernet 0/0/0 #(进入0/0/0接口)
[Huawei-GigabitEthernet0/0/0]dhcp select global #(在下放地址的接口上开启DHCP服务)
[Huawei-GigabitEthernet0/0/0]q
[Huawei]ip pool playstation #(在设备上创建名为playstation的池塘)
Info: It’s successful to create an IP address pool.
[Huawei-ip-pool-playstation]network 192.168.2.0 mask 255.255.255.0
[Huawei-ip-pool-playstation]gateway-list 192.168.2.1
[Huawei-ip-pool-playstation]dns-list 114.114.114.114 8.8.8.8
[Huawei-ip-pool-playstation]q
[Huawei]interface GigabitEthernet 0/0/1
[Huawei-GigabitEthernet0/0/1]dhcp select global
获取IP
通过ipconfig查看设备ip地址等数据
然后PING一下
好,通了