华为设备配置篇——VRRP配置(假造路由冗余)
VRRP可以监视上行端口的状态,当设备感知上行端口大概链路发生故障时,可以主动的低落VRRP的优先级,从而包管上行链路正常的backup设备能够通过选举切换成Master状态,指导报文转发。接入交换机为SW1,核心交换机为SW2和SW3,SW2与SW3做一个VRRP路由冗余。除此之外PC1能够正常的访问到Inetrnet,拓扑如下:
https://img-blog.csdnimg.cn/39c916ab41d647b6840f77175758d605.png
1.PC1配置地址:192.168.10.1 网关:192.168.10.254
https://img-blog.csdnimg.cn/01689a729f5d428993197c47c62950d2.png
2.配置接入交换机SW1
①改名字,取消提示消息并配置g0/0/3接口,思量到PC1要与vlan10的网络互通,因此将PC1的接口分别到VLAN 10 中。
更改名字为:sysname acsw
取消提示消息:undo info-center enable
配置接口g0/0/3:
vlan 10
quit
interface g0/0/3
port link-type access
port default vlan 10 ②配置上行接口。配置接入交换机acsw的上行接口,接入交换机与核心交换机相连,故配置成trunk:
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan all
quit
interface g0/0/2
port link-type trunk
port trunk allow-pass vlan all
3.配置核心交换机SW2
①配置csw1。下行trunk,上行配置access,并配置一个vlanif100从而实现与上行接口网络互连。
配置下行接口g0/0/1
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan all
配置下行接口g0/0/3
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan all
创建vlan,配置接口g0/0/2并将上行端口放入vlan 100中:
vlan 10
vlan 100
quit
interface g0/0/2
port link-type access
port default vlan 100
quit ②配置csw1的三层接口:
int vlan10
ip address 192.168.10.252 24
quit
int vlan 100
ip address 192.168.100.1 30 4.配置核心交换机SW3:与SW2同理
配置接口g0/0/1
interface g0/0/1
port link-type trunk
port trunk allow-pass vlan all
配置接口g0/0/3
interface g0/0/3
port link-type trunk
port trunk allow-pass vlan all
quit
配置接口g0/0/2
vlan 10
vlan 200
quit
interface g0/0/2
port link-type access
port default vlan 200
quit
配置三层接口:
interface vlanif10
ip address 192.168.10.253 24
quit
int vlanif100
Error: The VLAN does not exist.
int vlanif200
ip address 192.168.200.1 30 5.使用两台核心交换机ping测试是否连通,使用PC1ping两台核心交换机是否连通,证明没问题。
6.VRRP配置
配置csw1为master,优先级为120,抢占延迟为20s
int vlanif 10
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
vrrp vrid 10 preempt-mode timer delay 20
quit
配置csw2的backup,默认优先级
interface vlanif 10
vrrp vrid 10 virtual-ip 192.168.10.254 7.查看vrrp配置,可以看到csw1是master而csw2是backup
display vrrp
Vlanif10 | Virtual Router 10
State : Master
Virtual IP : 192.168.10.254
Master IP : 192.168.10.252
PriorityRun : 120
PriorityConfig : 120
MasterPriority : 120
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-010a
Check TTL : YES
Config type : normal-vrrp
Create time : 2023-05-06 15:13:45 UTC-08:00
Last change time : 2023-05-06 15:13:48 UTC-08:00 display vrrp
Vlanif10 | Virtual Router 10
State : Backup
Virtual IP : 192.168.10.254
Master IP : 192.168.10.252
PriorityRun : 100
PriorityConfig : 100
MasterPriority : 120
Preempt : YES Delay Time : 0 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-010a
Check TTL : YES
Config type : normal-vrrp
Create time : 2023-05-06 15:16:30 UTC-08:00
Last change time : 2023-05-06 15:16:30 UTC-08:00 8.配置路由器R1
<Huawei>system-view
sysname R1
interface g0/0/1
ip address 192.168.100.2 30
quit
interface g0/0/0
ip address 100.1.1.2 30
interface g2/0/0
ip address 192.168.200.2 30
9.配置路由器R2
<Huawei>system-view
sysname Internet
interface g0/0/0
ip address 100.1.1.1 30 10.配置静态路由
在PC1ping 路由器100.1.1.1,无法ping通,抓包发现网络还没有送出去,所以要在核心交换机配置默认路由指向出口,把网络送出去(不知道怎么送出去的时候);在三层交换机上配置默认路由指向下一条,确保到目的地有路由;分别在csw1和csw2上配置:
<csw1>system-view
ip route-static 0.0.0.0 0.0.0.0 192.168.100.2
<csw2>system-view
ip route-static 0.0.0.0 0.0.0.0 192.168.200.2 配置以上静态路由,使用PC1继续ping 100.1.1.1,照旧没有ping通,我们通过抓包举行分析,ping 将数据包送出去了,但是并没有回来。
https://img-blog.csdnimg.cn/f443b1eeae364473bc0aeef8056de362.png
11.配置回程路由
接着我们在R1上使用 display ip routing-table下令,可以发现,R1路由并没有PC1的网络,即路由R1没有192.168.10.0网段的路由,因此我们要在R1上配置回程的静态路由。(如许就可以访问到外网了)
ip route-static 192.168.10.0(PC1) 24 192.168.100.1
ip route-static 192.168.10.0 (PC1)24 192.168.200.1 12.在pc1上用tracert下令跟踪路由。
13.调csw1的优先级。将原来的优先级120调到90,再使用tracert下令跟踪路由,发现路由走的是右边的网络。这时候右边的是Master.
而且当你立即改回来,再去使用tracert下令跟踪的时候,网络不会立即走回左边的网络,在前面的配置中配置了抢占延迟的时间为20 S,因此在恢复优先级后,要等过了设置的抢占延时时间才可以恢复。
14.跟踪上行接口,如果上行效果有故障,则优先级会-30,那么原来的Master会变成backup,则网络则通过一边的举行传送。
vrrp vrid 10 track interface g0/0/2 reduced 30
int g0/0/2
shutdown
quit
display vrrp
Vlanif10 | Virtual Router 10
State : Backup
Virtual IP : 192.168.10.254
Master IP : 192.168.10.253
PriorityRun : 90
PriorityConfig : 120
MasterPriority : 100
Preempt : YES Delay Time : 20 s
TimerRun : 1 s
TimerConfig : 1 s
Auth type : NONE
Virtual MAC : 0000-5e00-010a
Check TTL : YES
Config type : normal-vrrp
Track IF : GigabitEthernet0/0/2 Priority reduced : 30
IF state : DOWN
Create time : 2023-05-06 15:13:45 UTC-08:00
Last change time : 2023-05-06 15:59:43 UTC-08:00
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]