一、配置路由器名称以及各接口的IP地址R1:enableconfig thostname R1interface s 0/2/0ip address 12.1.1.1 255.255.255.0clo
.
一、配置路由器名称以及各接口的IP地址
R1:
enableconfig thostname R1interface s 0/2/0ip address 12.1.1.1 255.255.255.0clock rate 64000no shutdowninterface g 0/0ip address 192.168.2.1 255.255.255.0no shutdownexit
R2:
enableconfig thostname R2interface s 0/2/0ip address 12.1.1.2 255.255.255.0no shutdowninterface g 0/0ip address 192.168.3.1 255.255.255.0no shutdownexit
二、配置静态路由,实现网络通信
R1:
ip route 192.168.3.0 255.255.255.0 12.1.1.2
R2:
ip route 192.168.2.0 255.255.255.0 12.1.1.1
三、配置R1为dhcp服务器
R1:
ip dhcp pool zhulou //定义dhcp地址池名称为“zhulou”network 192.168.2.0 255.255.255.0 //定义动态分配的ip地址范围default-router 192.168.2.1 //配置dns服务器地址dns-server 218.2.135.1 //配置网关地址ip dhcp pool fulounetwork 192.168.3.0 255.255.255.0default-router 192.168.3.1dns-server 218.2.135.1exitip dhcp excluded-address 192.168.2.1 // 排除主楼客户机网关ip dhcp excluded-address 192.168.3.1 // 排除辅楼客户机网关
四、在R2上配置dhcp中继
R2:
interface g 0/0ip helper-address 12.1.1.1 //配置辅助寻址,指向DHCP服务器的地址
五、配置PC0 和PC1的ip获取方式
- 1、将PC0和PC1的ip地址获取方式配置为自动获取,验证效果。
PC0:
PC1:
- 2、PC0 拼 PC1,查看网络连通性