对R1进行配置
[dhcp]interface g0/0/0
[dhcp-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[dhcp]interface g0/0/1
[dhcp-GigabitEthernet0/0/0]ip address 172.168.1.1 24
开启dhcp服务
[dhcp]dhcp enable
创建地址池
[dhcp]ip pool xx
Info: It's successful to create an IP address pool.
[dhcp-ip-pool-xx]network 192.168.1.0 mask 255.255.255.0
[dhcp-ip-pool-xx]gateway-list 192.168.1.1
[dhcp-ip-pool-xx]dns-list 8.8.8.8 114.114.114.114
[dhcp]ip pool zz
Info: It's successful to create an IP address pool.
[dhcp-ip-pool-zz]network 172.168.1.0 mask 255.255.255.0
[dhcp-ip-pool-zz]gateway-list 172.168.1.1
[dhcp-ip-pool-zz]dns-list 8.8.8.8 114.114.114.114
调用
-
[dhcp]interface g0/0/0
-
[dhcp-GigabitEthernet0/0/0]dhcp select globa
-
[dhcp]interface g0/0/1
-
[dhcp-GigabitEthernet0/0/1]dhcp select global