思科路由器配置DHCP服务

 

 

R5:
enable
config t
hostname R5
int s1/1
ip add 192.168.56.1 255.255.255.0
no shutdown
exit
int s1/2
ip add 192.168.57.2 255.255.255.0
no shutdown
exit
router rip
network 192.168.56.0
network 192.168.57.0
exit
service dhcp
ip dhcp pool R6   //建立DHCP地址池
network 192.168.6.0 255.255.255.0  //发送的IP
default-router 192.168.6.1  //默认网关
dns-server 202.13.19.25 113.22.0.9  //DNS服务器
lease 8 0 0  //租约
exit
ip dhcp excluded-address 192.168.6.1  //保留的IP
ip dhcp pool R7
network 192.168.7.0 255.255.255.0
default-router 192.168.7.1
dns-server 202.13.19.25 113.22.0.9
lease 8 0 0
exit
ip dhcp excluded-address 192.168.7.1

R6:
enable
config t
hostname R6
int s1/0
ip add 192.168.56.2 255.255.255.0
no shutdown
exit
int fa2/0
ip add 192.168.6.1 255.255.255.0
ip helper-address 192.168.56.1  //设置帮助IP实现跨路由dhcp
no shutdown
exit
router rip
network 192.168.56.0
network 192.168.57.0
network 192.168.6.0
end

R7:
enable
config t
hostname R7
int s1/4
ip add 192.168.57.2 255.255.255.0
no shutdown
exit
int s1/5
ip add 192.168.67.1 255.255.255.0
no shutdown
exit
exit
router rip
network 192.168.57.0
network 192.168.67.0
end


测试:
R5:
host 192.168.1.188
hardware-address 68.AB.C6
show ip dhcp pool
show ip dhcp binding

 

 

 

 

你可能感兴趣的:(路由器,DHCP,休闲,思科,思科路由器)