ENSP教程---配置DHCP

目录

一、实验目标

二、实验拓扑图

三、配置基本环境

四、启用DHCP服务

R1配置:

SY AR1

#
interface GigabitEthernet0/0/0
 ip address 11.1.11.1 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 11.1.12.1 255.255.255.0 
#
ospf 1 
 area 0.0.0.0 
  network 11.1.11.1 0.0.0.0 
  network 11.1.12.1 0.0.0.0 

R2配置:

SY AR2
dhcp enable
#
ip pool vlan2
 gateway-list 192.168.2.1 
 network 192.168.2.0 mask 255.255.255.0 
 excluded-ip-address 192.168.2.253 192.168.2.254 
 dns-list 10.1.12.1 
#
ip pool vlan3
 gateway-list 192.168.3.1 
 network 192.168.3.0 mask 255.255.255.0 
 excluded-ip-address 192.168.3.253 192.168.3.254 
 dns-list 10.1.22.1 
#
interface GigabitEthernet0/0/0
 ip address 10.1.22.1 255.255.255.0 
 dhcp select global
#
interface GigabitEthernet0/0/1
 ip address 10.1.12.1 255.255.255.0 
 dhcp select global

rip 1
 undo summary
 version 2
 network 10.0.0.0
 

S1配置:

sysname S1
#
vlan batch 2 to 8

stp instance 2 root primary
stp instance 3 root secondary

dhcp enable

stp region-configuration
 region-name EXAM
 revision-level 1
 instance 2 vlan 2
 instance 3 vlan 3
 active region-configuration

dhcp server group dhcp
 dhcp-server 10.1.12.1 0

interface Vlanif2
 ip address 192.168.2.254 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.1
 vrrp vrid 2 priority 120
 vrrp vrid 2 preempt-mode timer delay 55
 dhcp select relay
 dhcp relay server-select dhcp
#
interface Vlanif3
 ip address 192.168.3.254 255.255.255.0
 vrrp vrid 3 virtual-ip 192.168.3.1
#
interface Vlanif5
 ip address 11.1.11.254 255.255.255.0
#
interface Vlanif7
 ip address 10.1.12.254 255.255.255.0

interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 7
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk pvid vlan 3
 port trunk allow-pass vlan 3 5
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk pvid vlan 2
 port trunk allow-pass vlan 2 5
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 5

#
ospf 1
 import-route rip 1
 area 0.0.0.0
  network 11.1.11.254 0.0.0.0
#
rip 1
 undo summary
 version 2
 network 10.0.0.0
 network 192.168.2.0
 import-route ospf 1

S2配置:

sysname S2
#
vlan batch 2 to 8
#
stp instance 2 root secondary
stp instance 3 root primary

dhcp enable

stp region-configuration
 region-name EXAM
 revision-level 1
 instance 2 vlan 2
 instance 3 vlan 3
 active region-configuration


dhcp server group dhcp
 dhcp-server 10.1.22.1 0

interface Vlanif2
 ip address 192.168.2.253 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.1
#
interface Vlanif3
 ip address 192.168.3.253 255.255.255.0
 vrrp vrid 3 virtual-ip 192.168.3.1
 vrrp vrid 3 priority 120
 vrrp vrid 3 preempt-mode timer delay 55
 dhcp select relay
 dhcp relay server-select dhcp
#
interface Vlanif6
 ip address 11.1.12.254 255.255.255.0
#
interface Vlanif8
 ip address 10.1.22.254 255.255.255.0

interface GigabitEthernet0/0/1
 port link-type access
 port default vlan 6
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk pvid vlan 2
 port trunk allow-pass vlan 2 5
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk pvid vlan 3
 port trunk allow-pass vlan 3 5
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 8

#
ospf 1
 import-route rip 1
 area 0.0.0.0
  network 11.1.12.254 0.0.0.0
#
rip 1
 undo summary
 version 2
 network 10.0.0.0
 network 192.168.3.0
 import-route ospf 1

S3配置:

sysname S3
#
vlan batch 2 to 8

stp region-configuration
 region-name EXAM
 revision-level 1
 instance 2 vlan 2
 instance 3 vlan 3
 active region-configuration

interface Ethernet0/0/1
 port link-type access
 port default vlan 2
#
interface Ethernet0/0/2
 port link-type trunk
 port trunk pvid vlan 2
 port trunk allow-pass vlan 2 5
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk pvid vlan 2
 port trunk allow-pass vlan 2 5
#
 

S4配置:

sysname S4
#
vlan batch 2 to 8
stp region-configuration
 region-name EXAM
 revision-level 1
 instance 2 vlan 2
 instance 3 vlan 3
 active region-configuration

interface Ethernet0/0/1
 port link-type access
 port default vlan 3
#
interface Ethernet0/0/2
 port link-type trunk
 port trunk pvid vlan 3
 port trunk allow-pass vlan 3 5
#
interface Ethernet0/0/3
 port link-type trunk
 port trunk pvid vlan 3
 port trunk allow-pass vlan 3 5
#

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值