实验要求:PC通过DHCP获取IP地址,所有PC可以互相访问
实验步骤:
1.给路由器配置IP地址
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 24
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.2.1 24
2.在路由器上配置DHCP
[R1]dhcp enable 开启DHCP服务
[R1]ip pool 1 创建DHCP池塘
[R1-ip-pool-1]network 192.168.1.0 mask 24
[R1-ip-pool-1]gateway-list 192.168.1.1 网关地址
[R1-ip-pool-1]dns-list 114.114.114.114 8.8.8.8 服务器地址
[R1-ip-pool-1]q
[R1]ip pool 2
[R1-ip-pool-2]network 192.168.2.0 mask 24
[R1-ip-pool-2]gateway-list 192.168.2.1
[R1-ip-pool-2]dns-list 114.114.114.114 8.8.8.8
[R1-ip-pool-2]q
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]dhcp select global
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]dhcp select global 在下放地址的接口上开启DHCP服务
实验结果: