DHCP中继(实验操作)

简介: DHCP中继(实验操作)

DHCP中继(实验操作)

实验拓扑:

20200821120053346.png

实验配置:

#DHCP服务器基础配置
sys
sys AR1
int g0/0/0
ip add 192.168.12.1 24
ip route-static 192.168.10.0 24 192.168.12.2
ip route-static 192.168.20.0 24 192.168.12.2
#DHCP中继基础配置
sys
sys SW1
vlan batch 10 20
int g0/0/1
p l a
p d v 10
int g0/0/2
p l a
p d v 20
int vlanif 10
ip add 192.168.10.254 24
int vlanif 20
ip add 192.168.20.254 24
int vlanif 1
ip add 192.168.12.2 24
#DHCP服务器配置全局地址池
#开启全局DHCP
[AR1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[AR1]
#配置vlan10 地址池
[AR1]ip pool vlan10
Info: It's successful to create an IP address pool. 
[AR1-ip-pool-vlan10]network 192.168.10.0 mask 24  
[AR1-ip-pool-vlan10]gateway-list 192.168.10.254 
[AR1-ip-pool-vlan10]dns-list 114.114.114.114
[AR1-ip-pool-vlan10]dis thi
[V200R003C00]
#
ip pool vlan10
 gateway-list 192.168.10.254 
 network 192.168.10.0 mask 255.255.255.0 
 dns-list 114.114.114.114 
#
return
[AR1-ip-pool-vlan10]
#配置vlan20 地址池
[AR1]ip pool vlan20
Info: It's successful to create an IP address pool.
[AR1-ip-pool-vlan20]
[AR1-ip-pool-vlan20] gateway-list 192.168.20.254 
[AR1-ip-pool-vlan20]
[AR1-ip-pool-vlan20] network 192.168.20.0 mask 255.255.255.0 
[AR1-ip-pool-vlan20]
[AR1-ip-pool-vlan20] dns-list 114.114.114.114 
[AR1-ip-pool-vlan20]
[AR1-ip-pool-vlan20]dis thi
[V200R003C00]
#
ip pool vlan20
 gateway-list 192.168.20.254 
 network 192.168.20.0 mask 255.255.255.0 
 dns-list 114.114.114.114 
#
return
[AR1-ip-pool-vlan20]
#进入接口,开启全局DHCP服务功能
[AR1]interface GigabitEthernet 0/0/0
[AR1-GigabitEthernet0/0/0]dhcp select global 
#查询DHCP地址池
[AR1]display ip pool 
  -----------------------------------------------------------------------
  Pool-name      : vlan10
  Pool-No        : 0
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.10.254  
  Mask           : 255.255.255.0
  VPN instance   : --
  -----------------------------------------------------------------------
  Pool-name      : vlan20
  Pool-No        : 1
  Position       : Local           Status           : Unlocked
  Gateway-0      : 192.168.20.254  
  Mask           : 255.255.255.0
  VPN instance   : --
  IP address Statistic
    Total       :506   
    Used        :0          Idle        :506   
    Expired     :0          Conflict    :0          Disable   :0     
[AR1]
#DHCP中继
[SW1]dhcp enable 
Info: The operation may take a few seconds. Please wait for a moment.done.
[SW1]
[SW1]dhcp server group office
Info:It's successful to create a DHCP server group.
[SW1-dhcp-server-group-office]dhcp-server 192.168.12.1
[SW1]interface Vlanif 10
[SW1-Vlanif10]dhcp select relay 
[SW1-Vlanif10]dhcp relay server-select office
[SW1-Vlanif10]dis thi
#
interface Vlanif10
 ip address 192.168.10.254 255.255.255.0
 dhcp select relay
 dhcp relay server-select office
#
return
[SW1-Vlanif10]
[SW1]interface Vlanif20
[SW1-Vlanif20] ip address 192.168.20.254 255.255.255.0
Error: The address already exists.
[SW1-Vlanif20] dhcp select relay
[SW1-Vlanif20] dhcp relay server-select office
[SW1-Vlanif20]dis thi
#
interface Vlanif20
 ip address 192.168.20.254 255.255.255.0
 dhcp select relay
 dhcp relay server-select office
#
return
[SW1-Vlanif20]
#主机自动获取DHCP IP地址
#vlan 10 PC1
PC>ipconfig /renew
IP Configuration
Link local IPv6 address...........: fe80::5689:98ff:fe35:5abc
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.10.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.10.254
Physical address..................: 54-89-98-35-5A-BC
DNS server........................: 114.114.114.114
#vlan20 PC2
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe98:45b7
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.20.253
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.20.254
Physical address..................: 54-89-98-98-45-B7
DNS server........................: 114.114.114.114
PC>

20200821120526544.png

相关文章
|
4月前
|
网络协议 Linux Shell
CentOS 7系统下DHCP及中继服务部署
设备 IP地址 主DNS服务器 192.168.100.254 从DNS服务器 192.168.100.1 客户端 192.168.200.2 一、DHCP服务器的部署
120 0
|
11天前
|
网络协议
DHCP实验-动态主机配置协议
DHCP实验-动态主机配置协议
网络技术基础(16)——DHCP中继
【3月更文挑战第3天】刚加完班又去南京出差了,实在是太忙了。。。。网络基础笔记(加班了几天,中途耽搁了,预计推迟6天),这篇借鉴了之前师兄的笔记。
|
10月前
|
vr&ar
DHCP 的综合实验
DHCP 的综合实验
57 0
|
11月前
|
网络协议 网络虚拟化
【DHCP实验】使用三层交换机配置DHCP Server服务器(基于全局地址池配置)
【DHCP实验】使用三层交换机配置DHCP Server服务器(基于全局地址池配置)
180 0
|
11月前
|
安全 网络架构
DHCP欺骗实验操作及防护措施
DHCP欺骗实验操作及防护措施
104 0
|
网络协议 Shell 网络虚拟化
思科复习实验,含dhcp,三层交换机,ospf
思科复习实验,含dhcp,三层交换机,ospf
106 0
思科复习实验,含dhcp,三层交换机,ospf
|
安全 网络安全 数据中心
华为USG防火墙配置DHCP及单臂路由小实验
华为USG防火墙配置DHCP及单臂路由小实验
734 0
华为USG防火墙配置DHCP及单臂路由小实验
|
7月前
|
网络协议 Linux 应用服务中间件
2022红帽企业版网络配置--centos7配置DHCP DNS绑定域名 FTP HTTP(apache) nginx samba
2022红帽企业版网络配置--centos7配置DHCP DNS绑定域名 FTP HTTP(apache) nginx samba
151 0