路由器DHCP配置

路由器DHCP配置

一、配置路由器名称以及各接口的IP地址

R1:

enable
config t
hostname R1
interface s 0/2/0
ip address 12.1.1.1 255.255.255.0
clock rate 64000
no shutdown
interface g 0/0
ip address 192.168.2.1 255.255.255.0
no shutdown
exit

R2:

enable
config t
hostname R2
interface s 0/2/0
ip address 12.1.1.2 255.255.255.0
no shutdown
interface g 0/0
ip address 192.168.3.1 255.255.255.0
no shutdown
exit

二、配置静态路由,实现网络通信

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 fulou
network 192.168.3.0 255.255.255.0
default-router 192.168.3.1
dns-server 218.2.135.1
exit

ip dhcp excluded-address 192.168.2.1   // 排除主楼客户机网关
ip dhcp excluded-address 192.168.3.1  // 排除辅楼客户机网关

四、在R2上配置dhcp中继

R2:

interface g 0/0
ip helper-address 12.1.1.1  //配置辅助寻址,指向DHCP服务器的地址

五、配置PC0 和PC1的ip获取方式

  • 1、将PC0和PC1的ip地址获取方式配置为自动获取,验证效果。
    PC0:
    路由器DHCP配置

PC1:
路由器DHCP配置

  • 2、PC0 拼 PC1,查看网络连通性

路由器DHCP配置

猜你喜欢

转载自blog.51cto.com/12184141/2318893