该网络为中小型企业网络,要求全网互通,路由协议采用OSPF,考虑到网络的可靠性,核心交换机SW1、SW2和接入交换机采用了双链路接入,同时核心交换机之间进行了链路聚合,SW1和SW2上进行了链路冗余备份,实现了PC的冗余网关配置。

ensp的综合实验_链路

ensp的综合实验_Ethernet_02网络拓扑如下图所示:

1、为避免交换环路问题,需配置4台交换机的RSTP功能,加快网络拓扑收敛。

2、交换机之间使用trunk链路,交换机与终端设备相连端口设置为边缘端口。

3、在SW1和SW2上配置VRRP,实现主机的网关冗余,配置参数如下:

VLAN10 VRRP备份组号10 VRRP虚拟ip地址为192.168.1.254;

VLAN20 VRRP备份组号20 VRRP虚拟ip地址为192.168.2.254,

SW1为VLAN 10的master ,为VLAN20的backup,Sw2为VLAN 20的master,为VLAN 10的backup。

SW1、Sw2各VRRP组中高优先级设置为150. 低优先级设置为120。

配置备份组中的交换机工作在抢占方式,并配置抢占延迟时间为30秒,vrrp组的master交换机监听上联接口

4、Su1和SW2之间进行链路聚合。

二、路由器配置如下:

1、R1、R2使用ospf路由协议。

2、R1和下联交换机之间使用OSPF路由协议,保证网络畅通。

三、要求:

1、全网互通,查看pc1和pc2访问pc3的访问路径分别为SW1-R1-R2和SW2-R1-R2。

Sw1配置

undo info-center enable  关闭提示信息
vlan batch 10 20 30 40  创建vlan
stp mode rstp   开启stp
stp instance 0 priority 0   设置为根交换机

interface Vlanif10   创建vlanif 10
 ip address 172.16.1.1 255.255.255.0    给vlanif 10 IP地址
 vrrp vrid 10 virtual-ip 172.16.1.254     设置虚拟网关
 vrrp vrid 10 priority 150                设置优先级
 vrrp vrid 10 track interface GigabitEthernet0/0/3 reduced 70   接口出问题后优先级减少70

interface Vlanif20
 ip address 172.16.2.1 255.255.255.0
 vrrp vrid 20 virtual-ip 172.16.2.254
 vrrp vrid 20 priority 120
 vrrp vrid 20 preempt-mode timer delay 10           抢占功能,延迟10秒

interface Vlanif30
 ip address 172.16.3.1 255.255.255.0
聚合链路
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
trunkport GigabitEthernet 0/0/1 to 0/0/2


interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

interface GigabitEthernet0/0/5
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 30

ospf
 area 1
  network 172.16.1.0 0.0.0.255
  network 172.16.3.0 0.0.0.255


sw2配置


undo info-center enable  关闭提示信息
vlan batch 10 20 30 40  创建vlan

开启stp
stp mode rstp
stp instance 0 priority 4096

interface Vlanif10
 ip address 172.16.1.2 255.255.255.0
 vrrp vrid 10 virtual-ip 172.16.1.254
 vrrp vrid 10 priority 120
 vrrp vrid 10 preempt-mode timer delay 10

interface Vlanif20
 ip address 172.16.2.2 255.255.255.0
 vrrp vrid 20 virtual-ip 172.16.2.254
 vrrp vrid 20 priority 150
 vrrp vrid 20 track interface GigabitEthernet0/0/3 reduced 70

interface Vlanif40
 ip address 172.16.4.1 255.255.255.0

聚合链路
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 mode lacp-static
trunkport GigabitEthernet 0/0/1 to 0/0/2

接口设置
interface GigabitEthernet0/0/3
 port link-type access
 port default vlan 40

interface GigabitEthernet0/0/4
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

interface GigabitEthernet0/0/5
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

ospf
 area 1
  network 172.16.2.0 0.0.0.255
  network 172.16.4.0 0.0.0.255


sw3

undo info-center enable
vlan batch 10

stp mode rstp

interface GigabitEthernet 0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

interface GigabitEthernet 0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094

interface Ethernet0/0/1
 port link-type access
 port default vlan 10
 stp edged-port enable   设置为边缘端口


sw4

undo info-center enable

vlan batch 20

stp mode rstp

interface GigabitEthernet 0/0/1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
interface GigabitEthernet 0/0/2
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
interface Ethernet0/0/1
 port link-type access
 port default vlan 20
 stp edged-port enable

R1

undo info-center enable

interface GigabitEthernet1/0/0
ip address 172.16.5.1 255.255.255.0

interface GigabitEthernet0/0/0
ip address 172.16.3.2 255.255.255.0

interface GigabitEthernet0/0/1
ip address 172.16.4.2 255.255.255.0

ospf
 area 1
  network 172.16.3.0 0.0.0.255
  network 172.16.4.0 0.0.0.255
  network 172.16.5.0 0.0.0.255

R2


undo info-center enable

interface GigabitEthernet0/0/0
 ip address 172.16.5.2 255.255.255.0

interface GigabitEthernet0/0/1
 ip address 172.16.6.254 255.255.255.0

ospf
 area 1
  network 172.16.5.0 0.0.0.255
  network 172.16.6.0 0.0.0.255