路由器DHCP配置

路由器DHCP配置

1、配置路由器名稱以及各接口的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

2、配置靜態路由,實現網絡通訊

R1:ide

ip route 192.168.3.0 255.255.255.0 12.1.1.2

R2:3d

ip route 192.168.2.0 255.255.255.0 12.1.1.1

3、配置R1爲dhcp服務器

R1:code

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  // 排除輔樓客戶機網關

4、在R2上配置dhcp中繼

R2:router

interface g 0/0
ip helper-address 12.1.1.1  //配置輔助尋址,指向DHCP服務器的地址

5、配置PC0 和PC1的ip獲取方式

  • 一、將PC0和PC1的ip地址獲取方式配置爲自動獲取,驗證效果。
    PC0:
    路由器DHCP配置

PC1:
路由器DHCP配置server

  • 二、PC0 拼 PC1,查看網絡連通性

路由器DHCP配置

相關文章
相關標籤/搜索