#头条创作挑战赛#
所谓三层组网结构就是将路由交换设备分为三层即核心层、汇聚层和接入层进行组网,以达到灵活分配数据到各工作层的目的。三层组网下的网络结构在冗余性、健壮性和可控性上可以做到最优。由于该结构易辩性,使得多数后期维护的工程师都能够上手维护和变更。同时该结构的配置并不复杂,用到的路由协议和冗余特性都是最常见的,所以在中小型企业或者校园内被广泛运用。下面依据模拟环境搭建实验,以下描述和数据对实验环境做整体概述:
设备 | 命名规则 | 设备标识 |
核心交换机 | Core switch | CS1 |
CS2 | ||
汇聚交换机 | aggregation switch | AgS1 |
AgS2 | ||
接入交换机 | access switch | AcS1 |
AcS2 |
设备所在层结构 | 设备标识 |
核心层 | CS1、CS2 |
汇聚层 | AgS1、AgS2 |
接入层 | AcS1、AcS2 |
本端设备 | 接口 | IP地址/掩码 | Loopback接口/管理IP地址 |
CS1 | Eth-Trunk | 12.1.1.1/24 | 1.1.1.1 |
GE1/0/2 | 13.1.1.1/24 | ||
GE1/0/3 | 14.1.1.1/24 | ||
CS2 | Eth-Trunk | 12.1.1.2/24 | 2.2.2.2 |
GE1/0/2 | 24.1.1.1/24 | ||
GE1/0/3 | 23.1.1.1/24 | ||
AgS1 | GE0/0/1 | 13.1.1.2/24 | 3.3.3.3 |
GE0/0/2 | 23.1.1.2/24 | ||
GE0/0/3 | Bridge | ||
GE0/0/4 | Bridge | ||
AgS2 | GE0/0/1 | 14.1.1.2/24 | 4.4.4.4 |
GE0/0/2 | 24.1.1.2/24 | ||
GE0/0/3 | Bridge | ||
GE0/0/4 | Bridge | ||
AcS1 | GE0/0/1 | Bridge | 192.168.100.1 |
GE0/0/2 | Bridge | ||
GE0/0/3 | Bridge | ||
GE0/0/4 | Bridge | ||
AcS2 | GE0/0/1 | Bridge | 192.168.100.2 |
GE0/0/2 | Bridge | ||
GE0/0/3 | Bridge | ||
GE0/0/4 | Bridge |
设备 | IP地址 | 子网掩码 | 网关 | 所属vlan |
PC1 | 192.168.10.1 | 255.255.255.0 | 192.168.10.254 | 40 |
PC2 | 192.168.10.2 | 255.255.255.0 | 192.168.10.254 | 40 |
Client1 | 192.168.20.1 | 255.255.255.0 | 192.168.20.254 | 50 |
Server1 | 192.168.20.2 | 255.255.255.0 | 192.168.20.254 | 50 |
将核心层和汇聚层上联接口划分到OSPF区域0内,做动态路由协议,方便后期的设备接入和维护,汇聚层下联接口和接入层做二层,透传vlan即可完成通信,也方便后期维护。
由于核心-汇聚层(OSPF区域)各设备都配置了loopback地址,所以该区域的设备均可通过loopback地址进行管理,在汇聚层-接入层由于是二层网络,所以只能配置管理vlan和管理IP地址进行管理。在此实验中,管理vlan统一为100,业务vlan为40和50,其中vlan 40为PC业务(模拟个人业务),vlan 50为server业务(模拟统一业务),实现业务和管理互不影响。
由于核心设备承载整网数据,设备承受压力较大,所以需要做链路和设备的双重备份,此时VRR协议就可以实现这种功能。同时因为核心设备的转发带宽需求较高,使用eth-trunk就可以增大链路带宽,保证链路冗余。
vlan batch 10 20 30
interface Vlanif10
ip address 13.1.1.1 255.255.255.0
interface Vlanif20
ip address 14.1.1.1 255.255.255.0
interface Vlanif30
ip address 12.1.1.1 255.255.255.0
interface Eth-Trunk12
port default vlan 30
interface GE1/0/0
undo shutdown
eth-trunk 12
interface GE1/0/1
undo shutdown
eth-trunk 12
interface GE1/0/2
undo shutdown
port default vlan 10
interface GE1/0/3
undo shutdown
port default vlan 20
interface LoopBack0
ip address 1.1.1.1 255.255.255.255
interface Vlanif30
vrrp vrid 1 virtual-ip 12.1.1.250
vrrp vrid 1 priority 120
vrrp vrid 1 preempt timer delay 3
vrrp vrid 1 authentication-mode md5 huawei@123
vrrp vrid 1 track bfd session-name 1 reduce 50
vrrp vrid 1 track bfd session-name 2 reduce 50
vrrp vrid 2 virtual-ip 12.1.1.251
vrrp vrid 2 authentication-mode md5 huawei@123
bfd //配置bfd监测链路
bfd 1 bind peer-ip 13.1.1.2 interface Vlanif10 source-ip 13.1.1.1 one-arm-echo
discriminator local 10
bfd 2 bind peer-ip 14.1.1.2 interface Vlanif20 source-ip 14.1.1.1 one-arm-echo
discriminator local 20
ospf 10 router-id 1.1.1.1
area 0.0.0.0
authentication-mode md5 1 cipher huawei@123
network 1.1.1.1 0.0.0.0
network 12.1.1.0 0.0.0.255
network 13.1.1.0 0.0.0.255
network 14.1.1.0 0.0.0.255
vlan batch 10 20 30
interface Vlanif10
ip address 24.1.1.1 255.255.255.0
interface Vlanif20
ip address 23.1.1.1 255.255.255.0
interface Vlanif30
ip address 12.1.1.2 255.255.255.0
interface Eth-Trunk12
port default vlan 30
interface GE1/0/0
undo shutdown
eth-trunk 12
interface GE1/0/1
undo shutdown
eth-trunk 12
interface GE1/0/2
undo shutdown
port default vlan 10
interface GE1/0/3
undo shutdown
port default vlan 20
interface LoopBack0
ip address 2.2.2.2 255.255.255.255
interface Vlanif30
ip address 12.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 12.1.1.250
vrrp vrid 1 authentication-mode md5 huawei@123
vrrp vrid 2 virtual-ip 12.1.1.251
vrrp vrid 2 priority 120
vrrp vrid 2 preempt timer delay 3
vrrp vrid 2 authentication-mode md5 huawei@123
vrrp vrid 2 track bfd session-name 1 reduce 50
vrrp vrid 2 track bfd session-name 2 reduce 50
bfd
bfd 1 bind peer-ip 24.1.1.2 interface Vlanif10 source-ip 24.1.1.1 one-arm-echo
discriminator local 10
bfd 2 bind peer-ip 23.1.1.2 interface Vlanif20 source-ip 23.1.1.1 one-arm-echo
discriminator local 20
ospf 10 router-id 2.2.2.2
area 0.0.0.0
authentication-mode md5 1 cipherhuawei@123
network 2.2.2.2 0.0.0.0
network 12.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
network 24.1.1.0 0.0.0.255
vlan batch 10 20 40 100
interface Vlanif10
ip address 13.1.1.2 255.255.255.0
interface Vlanif20
ip address 23.1.1.2 255.255.255.0
ospf cost 10
interface Vlanif40
description YW_PC
ip address 192.168.10.254 255.255.255.0
interface Vlanif100
description GuanLi
ip address 192.168.100.254 255.255.255.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 10
interface GigabitEthernet0/0/2
port link-type access
port default vlan 20
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface LoopBack0
ip address 3.3.3.3 255.255.255.255
ospf 10 router-id 3.3.3.3
import-route direct //引入直连路由
area 0.0.0.0
authentication-mode md5 1 cipher huawei@123
network 3.3.3.3 0.0.0.0
network 13.1.1.0 0.0.0.255
network 23.1.1.0 0.0.0.255
bfd
bfd 1 bind peer-ip 13.1.1.1 interface Vlanif10 source-ip 13.1.1.2 one-arm-echo
discriminator local 10
bfd 2 bind peer-ip 23.1.1.1 interface Vlanif20 source-ip 23.1.1.1 one-arm-echo
discriminator local 20
vlan batch 10 20 50 100
interface Vlanif10
ip address 24.1.1.2 255.255.255.0
interface Vlanif20
ip address 14.1.1.2 255.255.255.0
ospf cost 10
interface Vlanif50
description YW_Server
ip address 192.168.20.254 255.255.255.0
interface Vlanif100
description GuanLi
ip address 192.168.100.254 255.255.255.0
interface GigabitEthernet0/0/1
port link-type access
port default vlan 20
interface GigabitEthernet0/0/2
port link-type access
port default vlan 10
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/4
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface LoopBack0
ip address 4.4.4.4 255.255.255.255
ospf 10 router-id 4.4.4.4
import-route direct
area 0.0.0.0
authentication-mode md5 1 cipher huawei@123
network 4.4.4.4 0.0.0.0
network 24.1.1.0 0.0.0.255
network 14.1.1.0 0.0.0.255
bfd
bfd 1 bind peer-ip 24.1.1.1 interface Vlanif10 source-ip 24.1.1.2 one-arm-echo
discriminator local 10
bfd 2 bind peer-ip 14.1.1.1 interface Vlanif20 source-ip 14.1.1.2 one-arm-echo
discriminator local 20
vlan batch 40 50 100
interface Vlanif100
description GuanLi
ip address 192.168.100.1 255.255.255.0
interface Ethernet0/0/1
port link-type access
port default vlan 40
interface Ethernet0/0/2
port link-type access
port default vlan 50
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 192.168.100.254 //配置缺省路由,以便远程管理二层设备
vlan batch 40 50 100
interface Vlanif100
description GuanLi
ip address 192.168.100.2 255.255.255.0
interface Ethernet0/0/1
port link-type access
port default vlan 40
interface Ethernet0/0/2
port link-type access
port default vlan 50
interface Ethernet0/0/3
port link-type access
port default vlan 40
interface GigabitEthernet0/0/1
port link-type trunk
port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet0/0/2
port link-type trunk
port trunk allow-pass vlan 2 to 4094
ip route-static 0.0.0.0 0.0.0.0 192.168.100.254
以CS1为例,查看VRRP状态:
VRRP状态正常。VRRP切换感兴趣的小伙伴可以自行检测!
以CS1为例,查看ospf邻居状态如下:
状态全部为FULL,邻居正常。
以CS1为例,查看路由表如下:
路由表项完整,有全网路由信息。
以PC1和Server1互ping验证,结果如下:
业务连通性正常。
以PC1和管理网段(192.168.100.254)互ping验证,结果如下:
管理连通性正常。
页面更新:2024-05-16
本站资料均由网友自行发布提供,仅用于学习交流。如有版权问题,请与我联系,QQ:4156828
© CopyRight 2020-2024 All Rights Reserved. Powered By 71396.com 闽ICP备11008920号-4
闽公网安备35020302034903号