实验拓扑
实验目的:
实现总部与分部之间的外网通信配置,总部可访问分部网络权限,但分部无法访问总部网络。
例如:
- PC3可以ping通PC7和PC8
- PC7和PC8无法ping通PC3
- 所有PC均可与PC9进行通信
网络配置方案:
总部
DHCP服务部署:
- 总部采用DHCP服务器为PC终端提供自动IP地址分配功能
网络架构配置:
- 汇聚层与核心层网络设备部署MSTP(多生成树协议)技术
- 同时配置VRRP(虚拟路由器冗余协议)实现网关冗余
分部
1. 通过DHCP协议动态获取IP地址
总部与分部外网的路由使用OSPF(Open Shortest Path First)动态路由协议,OSPF划分了3个区域,具体网络架构如下:
- 区域0(Area 0)作为骨干区域,部署在总部核心网络
- 区域1(Area 1)用于各分部外网接入
- 区域2(Area 2)用于总部分支机构网络
实验配置过程及结果:
总部(vlan 的创建)
交换机1 交换机2(vl 10 20 30 40 50)
交换机5(vl 10 20)交换机6(vl 30 40)
交换机4(vl 50)
接口配置:
交换机5 6
交换机1 2
交换机4
注意二台核心交换机之间使用了链路聚合技术
system-view
interface Eth-Trunk 1
interface GigabitEthernet 0/0/1
eth-trunk 1
interface GigabitEthernet 0/0/5
eth-trunk 1
mstp配置:
交换机1
system-view
stp enable
stp mode mstp
stp region-configuration
region-name 2
revision-level 0
instance 5 vlan 50
active region-configuration
stp instance 5 priority 120
region-name 1
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
stp instance 1 priority 120
stp instance 3 priority 120
交换机2
system-view
stp enable
stp mode mstp
stp region-configuration
region-name 2
revision-level 0
instance 5 vlan 50
active region-configuration
region-name 1
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
stp instance 2 priority 120
stp instance 4 priority 120
交换机5 6
system-view
stp enable
stp mode mstp
stp region-configuration
region-name 1
revision-level 1
instance 1 vlan 10
instance 2 vlan 20
instance 3 vlan 30
instance 4 vlan 40
active region-configuration
交换机4
system-view
stp enable
stp mode mstp
stp region-configuration
region-name 2
revision-level 0
instance 5 vlan 50
active region-configuration
查看生成树(dis stp brief):
交换机5
交换机6
可以看到实现了环路的阻塞
vrrp配置:
交换机1
interface vl 10
vrrp vrid 1 virtual-ip 10.1.1.254
vrrp vrid 1 priority 120
interface vl 20
vrrp vrid 1 virtual-ip 10.1.2.254
interface vl 30
vrrp vrid 1 virtual-ip 20.1.1.254
vrrp vrid 1 priority 120
interface vl 40
vrrp vrid 1 virtual-ip 20.1.2.254
interface vl 50
vrrp vrid 1 virtual-ip 50.1.1.254
vrrp vrid 1 priority 120
交换机2
interface vl 10
vrrp vrid 1 virtual-ip 10.1.1.254
interface vl 20
vrrp vrid 1 virtual-ip 10.1.2.254
vrrp vrid 1 priority 120
interface vl 30
vrrp vrid 1 virtual-ip 20.1.1.254
interface vl 40
vrrp vrid 1 virtual-ip 20.1.2.254
vrrp vrid 1 priority 120
interface vl 50
vrrp vrid 1 virtual-ip 50.1.1.254
查看vrrp(dis vrrp brief)
DHCP配置
DHCP服务器配置
sys
dhcp enable
华为要进入接口打开DHCP功能
int g0/0/0
dhcp select global
注意配置去往pc 的路由,以及注意地址池中做地址排除
DHCP中继(二台核心交换机上都配置)
dhcp enable
int vl 10
dhcp select relay
dhcp relay server-ip 50.1.1.1
int vl 20
dhcp select relay
dhcp relay server-ip 50.1.1.1
int vl 30
dhcp select relay
dhcp relay server-ip 50.1.1.1
int vl 40
dhcp select relay
dhcp relay server-ip 50.1.1.1
查看pc能否获取IP:
查看pc 之间通信:
路由器与交换机的接口IP配置参考拓扑
分部:
DHCP配置(交换机3)
dhcp enable
vl 100 200
ip pool 100
network 172.16.1.0 ma 24
gateway-list 172.16.1.254
dns 114.114.114.114
ip pool 200
network 172.16.2.0 ma 24
gateway-list 172.16.2.254
dns 114.114.114.114
int vl 100
dhcp select global
int vl 200
dhcp select global
dhcp 分配结果:
路由器采用ospf(可以查看相关案例)
连通性测试
pc 4 ping pc 7
pc 4 ping pc 9
pc 7 ping pc 9