综合项目
工具:ENSP
如图创建拓扑图
思路:先进行了红框下的配置 再进行上行链路配置
第一步:创建交换机各VLAN
[SW1]vlan batch 10 20 30 40 100
[SW2]vlan batch 10 20 30 40 100
[SW3]vlan batch 10 20 30 40 100
[SW4]vlan batch 10 20 30 40 100
[SW5]vlan batch 10 20 30 40 100
第二步:设置接口属性
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 10
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default vlan 20
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan all //交换机SW1接口配置
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 10
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default vlan 20
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[SW2-GigabitEthernet0/0/4]port link-type trunk
[SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan all //交换机SW2接口配置
[SW3]port-group group-member g0/0/1 to g0/0/3
[SW3-port-group]port link-type trunk
[SW3-GigabitEthernet0/0/1]port link-type trunk
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-GigabitEthernet0/0/3]port link-type trunk
[SW3-port-group]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
//交换机SW3接口配置
[SW4]port-group group-member g0/0/1 to g0/0/3
[SW4-port-group]port link-type trunk
[SW4-GigabitEthernet0/0/1]port link-type trunk
[SW4-GigabitEthernet0/0/2]port link-type trunk
[SW4-GigabitEthernet0/0/3]port link-type trunk
[SW4-port-group]port trunk allow-pass vlan all
[SW4-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW4-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW4-GigabitEthernet0/0/3]port trunk allow-pass vlan all
//交换机SW4接口配置
[SW5-GigabitEthernet0/0/1]port link-type access
[SW5-GigabitEthernet0/0/1]port default vlan 100
[SW5-GigabitEthernet0/0/2]port link-type trunk
[SW5-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW5-GigabitEthernet0/0/3]port link-type trunk
[SW5-GigabitEthernet0/0/3]port trunk allow-pass vlan all //交换机SW5接口配置
第三步:设置汇入层交换机链路聚合
[SW3]interface Eth-Trunk 0 //设置链路聚合组0
[SW3-Eth-Trunk0]trunkport g0/0/10
[SW3-Eth-Trunk0]trunkport g0/0/11 //将g0/0/10和g0/0/11 接口加入链路组
[SW3-Eth-Trunk0]port link-type trunk
[SW3-Eth-Trunk0]port trunk allow-pass vlan all //允许所有vlan通过
/*汇入层交换机SW3配置 */
[SW4]interface Eth-Trunk 0 //设置链路聚合组0
[SW4-Eth-Trunk0]trunkport g0/0/10
[SW4-Eth-Trunk0]trunkport g0/0/11 //将g0/0/10和g0/0/11 接口加入链路组
[SW4-Eth-Trunk0]port link-type trunk
[SW4-Eth-Trunk0]port trunk allow-pass vlan all //允许所有vlan通过
/*汇入层交换机SW4配置 */
验证聚合路由是否设置完成
[SW3]display interface Eth-Trunk 0 //使用命令查看链路聚合组是否联通
Eth-Trunk0 current state : UP
Line protocol current state : UP
Description:
Switch Port, PVID : 1, Hash arithmetic : According to SIP-XOR-DIP,Maximal BW:
2G, Current BW: 2G, The Maximum Frame Length is 9216
IP Sending Frames' Format is PKTFMT_ETHNT_2, Hardware address is 4c1f-cc09-64f7
Current system time: 2021-04-08 19:00:23-08:00
Input bandwidth utilization : 0%
Output bandwidth utilization : 0%
-----------------------------------------------------
PortName Status Weight
-----------------------------------------------------
GigabitEthernet0/0/10 UP 1
GigabitEthernet0/0/11 UP 1
-----------------------------------------------------
The Number of Ports in Trunk : 2
The Number of UP Ports in Trunk : 2
第四步:将VLAN加入虚接口
[SW3-Vlanif10]ip address 192.168.10.254 24
[SW3-Vlanif20]ip address 192.168.20.254 24
[SW3-Vlanif30]ip address 192.168.30.254 24
[SW3-Vlanif40]ip address 192.168.40.254 24
[SW3-Vlanif100]ip address 192.168.100.254 24 //交换机SW3的虚接口配置
[SW4-Vlanif10]ip address 192.168.10.253 24
[SW4-Vlanif20]ip address 192.168.20.253 24
[SW4-Vlanif30]ip address 192.168.30.253 24
[SW4-Vlanif40]ip address 192.168.40.253 24
[SW4-Vlanif100]ip address 192.168.100.253 24 //交换机SW4的虚接口配置
第五步:配置生成树协议
[SW3]stp mode mstp //使用Mstp生成树协议
[SW3]stp region-configuration //stp区域配置
[SW3-mst-region]region-name huawei // stp区域名称
[SW3-mst-region]revision-level 1 //区域修订版本级别
[SW3-mst-region]instance 10 vlan 10 100 //实例10 映射VLAN10和100
[SW3-mst-region]instance 20 vlan 20 //实例20 映射VLAN 20
[SW3-mst-region]active region-configuration //激活生成树配置
[SW3]stp instance 10 priority 0
[SW3]stp instance 20 priority 4096 //配置交换机通过stp优先级
[SW4]stp mode mstp
[SW4]stp region-configuration
[SW4-mst-region]region-name huawei
[SW4-mst-region]revision-level 1
[SW4-mst-region]instance 10 vlan 10 100
[SW4-mst-region]instance 20 vlan 20
[SW4-mst-region]active region-configuration
[SW4]stp instance 10 priority 4096
[SW4]stp instance 20 priority 0 // 交换机SW4生成树配置
[SW1]stp mode mstp
[SW1]stp region-configuration
[SW1-mst-region]region-name huawei
[SW1-mst-region]revision-level 1
[SW1-mst-region]instance 10 vlan 10 100
[SW1-mst-region]instance 20 vlan 20
[SW1-mst-region]active region-configuration //交换机SW1生成树配置
[SW2]stp mode mstp
[SW2]stp region-configuration
[SW2-mst-region]region-name huawei
[SW2-mst-region]revision-level 1
[SW2-mst-region]instance 10 vlan 10 100
[SW2-mst-region]instance 20 vlan 20
[SW2-mst-region]active region-configuration //交换机SW2生成树配置
[SW5]stp region-configuration
[SW5-mst-region]region-name huawei
[SW5-mst-region]revision-level 1
[SW5-mst-region]instance 10 vlan 10 100
[SW5-mst-region]instance 20 vlan 20
[SW5-mst-region]active region-configuration //交换机SW5生成树配置
第六步:使用路由器充当DHCP服务器角色
[DHCPSERVER]dhcp enable //开启dhcp服务
[DHCPSERVER-GigabitEthernet0/0/0]ip address 192.168.100.100 24
/* 这里没配置默认路由是因为需要配置VRRP的虚拟IP地址下一跳 */
[DHCPSERVER]ip pool vlan10 //创建VLAN10的地址池
[DHCPSERVER-ip-pool-vlan10]network 192.168.10.0 mask 24 //网段
[DHCPSERVER-ip-pool-vlan10]gateway-list 192.168.10.100 //虚拟网关
[DHCPSERVER-ip-pool-vlan10]dns-list 8.8.8.8 //dns服务器设置
[DHCPSERVER]ip pool vlan20 //创建VLAN20的地址池
[DHCPSERVER-ip-pool-vlan20]network 192.168.20.0 mask 24 //网段
[DHCPSERVER-ip-pool-vlan20]gateway-list 192.168.20.100 //虚拟网关
[DHCPSERVER-ip-pool-vlan20]dns-list 8.8.8.8 //dns服务器设置
[DHCPSERVER]int g0/0/0
[DHCPSERVER-GigabitEthernet0/0/0]dhcp select global //dhcp选择全局
第七步:设置汇聚层交换机DHCP中继模式
[SW3]dhcp enable //开启dhcp服务
[SW3-Vlanif10]dhcp select relay //dhcp选择中继模式
[SW3-Vlanif10]dhcp relay server-ip 192.168.100.100 //dhcp服务器地址
[SW3-Vlanif20]dhcp select relay //dhcp选择中继模式
[SW3-Vlanif20]dhcp relay server-ip 192.168.100.100 //dhcp服务器地址
//汇入层交换机SW3配置
[SW4]dhcp enable //开启dhcp服务
[SW4-Vlanif10]dhcp select relay //dhcp选择中继模式
[SW4-Vlanif10]dhcp relay server-ip 192.168.100.100 //dhcp服务器地址
[SW4-Vlanif20]dhcp select relay //dhcp选择中继模式
[SW4-Vlanif20]dhcp relay server-ip 192.168.100.100 //dhcp服务器地址
//汇入层交换机SW4配置
第八步:进入接入层交换机配置VRRP服务<虚拟路由冗余协议>
/*接入层交换机SW3的VRRP配置 */
[SW3-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.100 //启用VRRP服务 虚拟地址192.168.10.100
[SW3-Vlanif10]vrrp vrid 10 priority 120 //设置优先级120 默认100
[SW3-Vlanif10]vrrp vrid 10 preempt-mode timer delay 1 //抢占模式延迟1秒
[SW3-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.200 //启用VRRP服务 虚拟地址192.168.20.200
[SW3-Vlanif100]vrrp vrid 100 virtual-ip 192.168.100.200 //启用VRRP服务 虚拟地址192.168.100.200
[SW3-Vlanif100]vrrp vrid 100 priority 120 //设置优先级120 默认100
[SW3-Vlanif100]vrrp vrid 100 preempt-mode timer delay 1 //抢占模式延迟1秒
/*接入层交换机SW4的VRRP配置 */
[SW4-Vlanif10]vrrp vrid 10 virtual-ip 192.168.10.100 //启用VRRP服务 虚拟地址192.168.10.100
[SW4-Vlanif20]vrrp vrid 20 virtual-ip 192.168.20.200 //启用VRRP服务 虚拟地址192.168.20.200
[SW4-Vlanif20]vrrp vrid 20 priority 120 //设置优先级120 默认100
[SW4-Vlanif20]vrrp vrid 20 preempt-mode timer delay 1 //抢占模式延迟1秒
[SW4-Vlanif100]vrrp vrid 100 virtual-ip 192.168.100.200 //启用VRRP服务 虚拟地址192.168.100.200
第九步:设置dhcp服务器的默认路由<下一跳为两台路由器虚拟出来的地址>
[DHCPSERVER]ip route-static 0.0.0.0 0.0.0.0 192.168.100.200
验证!
PC>ipconfig /release //释放IP地址
IP Configuration
Link local IPv6 address...........: fe80::5689:98ff:fee5:143
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 0.0.0.0
Subnet mask.......................: 0.0.0.0
Gateway...........................: 0.0.0.0
Physical address..................: 54-89-98-E5-01-43
DNS server........................:
PC>ipconfig /renew //获取新的IP地址
IP Configuration
Link local IPv6 address...........: fe80::5689:98ff:fee5:143
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.10.251
Subnet mask.......................: 255.255.255.0
Gateway...........................: 192.168.10.100
Physical address..................: 54-89-98-E5-01-43
DNS server........................: 8.8.8.8
第十步:基础配置
为路由器R3添加新板卡
路由器R4同理
两台路由器连接选择 serial 线 <因为是广域网线>
第十一步:设置分公司路由器
[BOWA-FENBU1-GigabitEthernet0/0/1]ip address 172.10.1.254 24
[BOWA-FENBU1-Serial4/0/0]ip address 10.0.0.2 24
第十二步:设置总公司路由器
[BOWA-ZONGBU-Serial4/0/0]ip address 10.0.0.1 24
[BOWA-ZONGBU-GigabitEthernet0/0/0]ip address 192.168.30.1 24
[BOWA-ZONGBU-GigabitEthernet0/0/1]ip address 192.168.40.1 24
[BOWA-ZONGBU-GigabitEthernet0/0/2]ip address 222.210.1.1 24
第十三步:设置汇聚层交换机上行接口属性
[SW3-GigabitEthernet0/0/4]port link-type access
[SW3-GigabitEthernet0/0/4]port default vlan 30 //汇聚层交换机SW3配置
<BOWA-ZONGBU>ping 192.168.30.254 //验证 使用总部路由器ping vlan30网关
PING 192.168.30.254: 56 data bytes, press CTRL_C to break
Reply from 192.168.30.254: bytes=56 Sequence=1 ttl=255 time=70 ms
Reply from 192.168.30.254: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.30.254: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.30.254: bytes=56 Sequence=4 ttl=255 time=40 ms
Reply from 192.168.30.254: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.30.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/38/70 ms
[SW4-GigabitEthernet0/0/4]port link-type access
[SW4-GigabitEthernet0/0/4]port default vlan 40 //汇聚层交换机SW4配置
<BOWA-ZONGBU>ping 192.168.40.254 //验证 使用总部路由器ping vlan40网关
PING 192.168.40.254: 56 data bytes, press CTRL_C to break
Reply from 192.168.40.254: bytes=56 Sequence=1 ttl=255 time=100 ms
Reply from 192.168.40.254: bytes=56 Sequence=2 ttl=255 time=50 ms
Reply from 192.168.40.254: bytes=56 Sequence=3 ttl=255 time=50 ms
Reply from 192.168.40.254: bytes=56 Sequence=4 ttl=255 time=50 ms
Reply from 192.168.40.254: bytes=56 Sequence=5 ttl=255 time=50 ms
--- 192.168.40.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 50/60/100 ms
第十四步:启用动态路由协议 ospf
/*汇聚层交换机SW3的动态路由宣告 */
[SW3]ospf 1 router-id 1.1.1.1 //ospf身份识别号码 点分十进制
[SW3-ospf-1]area 0 //进入骨干区域0
[SW3-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255 //宣告直连路由 可以精确 但是本拓扑图在同一大网段 可以进行粗略宣告
/*汇聚层交换机SW4的动态路由宣告 */
[SW4]ospf 1 router-id 2.2.2.2 //ospf身份识别号码 点分十进制
[SW4-ospf-1]area 0 //进入骨干区域0
[SW4-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255 //宣告直连路由 可以精确 但是本拓扑图在同一大网段 可以进行粗略宣告
/*公司总部路由器的动态路由宣告 */
[BOWA-ZONGBU]ospf 1 router-id 3.3.3.3 //ospf身份识别号码 点分十进制
[BOWA-ZONGBU-ospf-1]area 0 //进入骨干区域0
[BOWA-ZONGBU-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255
[BOWA-ZONGBU-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255 //因为还有10.0.0.0网段
//宣告直连路由 可以精确 但是本拓扑图在同一大网段 可以进行粗略宣告
[BOWA-ZONGBU-ospf-1]default-route-advertise //宣告默认路由
[BOWA-ZONGBU-ospf-1]display ip routing-table //使用命令查看总部ospf学习情况
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 21 Routes : 33
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/24 Direct 0 0 D 10.0.0.1 Serial4/0/0
10.0.0.1/32 Direct 0 0 D 127.0.0.1 Serial4/0/0
10.0.0.2/32 Direct 0 0 D 10.0.0.2 Serial4/0/0
10.0.0.255/32 Direct 0 0 D 127.0.0.1 Serial4/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.10.1.0/24 OSPF 10 49 D 10.0.0.2 Serial4/0/0
192.168.10.0/24 OSPF 10 2 D 192.168.30.254 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.30.253 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.40.254 GigabitEthernet
0/0/1
OSPF 10 2 D 192.168.40.253 GigabitEthernet
0/0/1
192.168.10.100/32 OSPF 10 2 D 192.168.30.254 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.40.254 GigabitEthernet
0/0/1
192.168.20.0/24 OSPF 10 2 D 192.168.30.254 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.30.253 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.40.254 GigabitEthernet
0/0/1
OSPF 10 2 D 192.168.40.253 GigabitEthernet
0/0/1
192.168.20.200/32 OSPF 10 2 D 192.168.30.253 GigabitEthernet
0/0/0
OSPF 10 2 D 192.168.40.253 GigabitEthernet
0/0/1
192.168.30.0/24 Direct 0 0 D 192.168.30.1 GigabitEthernet
0/0/0
192.168.30.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.30.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.40.0/24 Direct 0 0 D 192.168.40.1 GigabitEthernet
0/0/1
/*肩负重任...*/
宣告默认路由之后的检查
[SW3]display ip routing-table //找到Proto O_ASE即可
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 18 Routes : 25
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 O_ASE 150 1 D 192.168.30.1 Vlanif30
O_ASE 150 1 D 192.168.40.1 Vlanif40
检查!
/* 配置完成后会显示很多ospf学习进程 最后会显示Full表示学习成功 */
[BOWA-ZONGBU-ospf-1-area-0.0.0.0]
Apr 8 2021 23:02:01-08:00 BOWA-ZONGBU %%01OSPF/4/NBR_CHANGE_E(l)[23]:Neighbor c
hanges event: neighbor status changed. (ProcessId=256, NeighborAddress=254.40.16
8.192, NeighborEvent=LoadingDone, NeighborPreviousState=Loading, NeighborCurrent
State=Full)
/*公司分部路由器动态路由宣告*/
[BOWA-FENBU1]ospf 1 router-id 4.4.4.4
[BOWA-FENBU1-ospf-1]area 0
[BOWA-FENBU1-ospf-1-area-0.0.0.0]network 10.0.0.0 0.0.0.255
[BOWA-FENBU1-ospf-1-area-0.0.0.0]network 172.10.1.0 0.0.0.255
[BOWA-FENBU1-ospf-1]display ip routing-table //使用命令查看分部ospf学习情况
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 19 Routes : 19
Destination/Mask Proto Pre Cost Flags NextHop Interface
10.0.0.0/24 Direct 0 0 D 10.0.0.2 Serial4/0/0
10.0.0.1/32 Direct 0 0 D 10.0.0.1 Serial4/0/0
10.0.0.2/32 Direct 0 0 D 127.0.0.1 Serial4/0/0
10.0.0.255/32 Direct 0 0 D 127.0.0.1 Serial4/0/0
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
172.10.1.0/24 Direct 0 0 D 172.10.1.254 GigabitEthernet
0/0/1
172.10.1.254/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
172.10.1.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.10.0/24 OSPF 10 50 D 10.0.0.1 Serial4/0/0
192.168.10.100/32 OSPF 10 50 D 10.0.0.1 Serial4/0/0
192.168.20.0/24 OSPF 10 50 D 10.0.0.1 Serial4/0/0
192.168.20.200/32 OSPF 10 50 D 10.0.0.1 Serial4/0/0
192.168.30.0/24 OSPF 10 49 D 10.0.0.1 Serial4/0/0
192.168.40.0/24 OSPF 10 49 D 10.0.0.1 Serial4/0/0
192.168.100.0/24 OSPF 10 50 D 10.0.0.1 Serial4/0/0
192.168.100.200/32 OSPF 10 50 D 10.0.0.1 Serial4/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
第十五步:配置总部路由器默认地址
目的:公网有无数IP地址 路由器无法进行学习ospf 如果学习会导致路由器崩溃
[BOWA-ZONGBU]ip route-static 0.0.0.0 0.0.0.0 222.210.1.2
验证:
PC>ping 172.10.1.1 //使用左下角PC ping最远分公司主机 验证成功
Ping 172.10.1.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 172.10.1.1: bytes=32 seq=2 ttl=125 time=110 ms
From 172.10.1.1: bytes=32 seq=3 ttl=125 time=109 ms
From 172.10.1.1: bytes=32 seq=4 ttl=125 time=94 ms
From 172.10.1.1: bytes=32 seq=5 ttl=125 time=110 ms
--- 172.10.1.1 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/105/110 ms
第十六步:cloud云设置
如下图配置cloud
网卡设置
验证:使用本机电脑ping cloud公网IP地址 222.210.1.2
C:\Users\10649>ping 222.210.1.1 //验证成功
正在 Ping 222.210.1.1 具有 32 字节的数据:
来自 222.210.1.1 的回复: 字节=32 时间=8ms TTL=255
来自 222.210.1.1 的回复: 字节=32 时间=5ms TTL=255
来自 222.210.1.1 的回复: 字节=32 时间=11ms TTL=255
来自 222.210.1.1 的回复: 字节=32 时间=6ms TTL=255
222.210.1.1 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 5ms,最长 = 11ms,平均 = 7ms
第十七步:线路优化
[SW3-Vlanif10]vrrp vrid 10 track interface g0/0/4 reduced 30 //VRRP追踪上行链路 跟踪上行链路 如果g0/0/4口故障 减少30优先级
验证:
/*使用长ping 断开SW3的g0/0/4口发现很快恢复网络 优化线路成功 */
PC>ping 222.210.1.2 -t
Ping 222.210.1.2: 32 data bytes, Press Ctrl_C to break
From 222.210.1.2: bytes=32 seq=1 ttl=126 time=78 ms
From 222.210.1.2: bytes=32 seq=2 ttl=126 time=94 ms
From 222.210.1.2: bytes=32 seq=3 ttl=126 time=78 ms
From 222.210.1.2: bytes=32 seq=4 ttl=126 time=94 ms
From 222.210.1.2: bytes=32 seq=5 ttl=126 time=125 ms
Request timeout!
From 222.210.1.2: bytes=32 seq=30 ttl=126 time=109 ms
From 222.210.1.2: bytes=32 seq=31 ttl=126 time=94 ms
From 222.210.1.2: bytes=32 seq=32 ttl=126 time=94 ms
From 222.210.1.2: bytes=32 seq=33 ttl=126 time=78 ms
From 222.210.1.2: bytes=32 seq=34 ttl=126 time=93 ms
From 222.210.1.2: bytes=32 seq=35 ttl=126 time=79 ms
From 222.210.1.2: bytes=32 seq=36 ttl=126 time=78 ms
--- 222.210.1.2 ping statistics ---
36 packet(s) transmitted
33 packet(s) received
8.33% packet loss
round-trip min/avg/max = 78/92/125 ms
实验完成:全网互通
实验中可能出现获取新IP地址报错 重新换一台PC就好
转载:https://blog.csdn.net/sixeleven611/article/details/115527774
查看评论