您好,登錄后才能下訂單哦!
1、浮動路由
2、VRRP
1、浮動路由默認是優先級是60,越小越優先,如果是第二條路由
優先級是比默認的要大,一般配置60以上
2、VRRP :(公有協議)
在多個路由器之間運行,
可以虛擬出一個或者多個網關IP地址(虛擬路由器);
從而實現內網不同網段之間的互通;
3、VRRP的工作過程:
●運行VRRP的“多個”路由器之間通過 VRRP 報文的交互,從而選擇
出一個最牛的路由器,作為 Master 路由器 ,以后就用來這個設備來轉發數據包;
●Master 路由器,僅僅只有一個;其他的路由器稱之為 backup 路由器;
●同時,Master 和 Backup 路由器,會產生一個虛擬的路由器,也就是一個
主:配虛擬IP地址、優先級(默認100、鏈路down減10)一般120、監聽上層口和下層口
備:配虛擬IP地址、優先級(默認100、鏈路down減10)一般115、不需要監聽上層口和下層口
<SW1>sys
[Huawei]sysname SW1
[SW1]vlan batch 10 20 100
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type trunk
[SW1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/2]un sh
[SW1-GigabitEthernet0/0/2]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access
[SW1-GigabitEthernet0/0/1]port default vlan 100
[SW1-GigabitEthernet0/0/1]un sh
[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
port link-type access
port default vlan 100
#
[SW1]int vlanif10
[SW1-Vlanif10]ip add 192.168.10.10 24
[SW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
##創建虛擬IP
[SW1-Vlanif10]vrrp vrid 1 priority 120
##設定優先級為120
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/1
[SW1-Vlanif10]vrrp vrid 1 track interface g0/0/2
##監聽自身的兩個接口狀態
[SW1-Vlanif10]dis this
#
interface Vlanif10
ip address 192.168.10.10 255.255.255.0
vrrp vrid 1 virtual-ip 192.168.10.1
vrrp vrid 1 priority 120
vrrp vrid 1 track interface GigabitEthernet0/0/1
vrrp vrid 1 track interface GigabitEthernet0/0/2
#
[SW1-Vlanif10]int vlanif 20
[SW1-Vlanif20]ip add 192.168.20.10 24
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW1-Vlanif20]vrrp vrid 2 priority 115
##配置優先級為115
[SW1]int vlanif 100
[SW1-Vlanif100]ip add 11.0.0.2 30
[SW1-Vlanif100]q
[SW1]ip route-static 0.0.0.0 0.0.0.0 11.0.0.1
##配置默認路由
<Huawei>sys
[Huawei]sysname SW2
[SW2]vlan batch 10 20 100
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type trunk
[SW2-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW2-GigabitEthernet0/0/2]un sh
[SW2-GigabitEthernet0/0/2]int g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access
[SW2-GigabitEthernet0/0/1]port default vlan 100
[SW2-GigabitEthernet0/0/1]un sh
[SW2-GigabitEthernet0/0/1]int vlanif 10
[SW2-Vlanif10]ip add 192.168.10.20 24
[SW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.10.1
[SW2-Vlanif10]vrrp vrid 1 priority 115
[SW2-Vlanif10]int vlanif 20
[SW2-Vlanif20]ip add 192.168.20.20 24
[SW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.20.1
[SW2-Vlanif20]vrrp vrid 2 priority 120
[SW2-Vlanif20]vrrp vrid 2 track interface g0/0/1
[SW2-Vlanif20]vrrp vrid 2 track interface g0/0/2
[SW2]int vlanif 100
[SW2-Vlanif100]ip add 12.0.0.2 30
[SW2-Vlanif100]q
[SW2]ip route-static 0.0.0.0 0.0.0.0 12.0.0.1
<Huawei>sys
[Huawei]sysname R1
[R1]int g 0/0/0
[R1-GigabitEthernet0/0/0]ip add 11.0.0.1 30
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 12.0.0.1 30
[R1-GigabitEthernet0/0/1]un sh
[R1-GigabitEthernet0/0/0]int loop 0
[R1-LoopBack0]ip add 1.1.1.1 24
[R1-LoopBack0]q
[R1]ip route-static 192.168.10.0 24 11.0.0.2
[R1]ip route-static 192.168.10.0 24 12.0.0.2 preference 70
[R1]ip route-static 192.168.20.0 24 12.0.0.2
[R1]ip route-static 192.168.20.0 24 11.0.0.2 preference 70
<Huawei>sys
[Huawei]sysname sw3
[SW3]vlan batch 10 20
[SW3]int e0/0/1
[SW3-Ethernet0/0/1]port link-type access
[SW3-Ethernet0/0/1]port default vlan 10
[SW3-Ethernet0/0/1]un sh
Info: Interface Ethernet0/0/1 is not shutdown.
[SW3-Ethernet0/0/1]int e0/0/2
[SW3-Ethernet0/0/2]port link-type access
[SW3-Ethernet0/0/2]port default vlan 20
[SW3-Ethernet0/0/2]un sh
Info: Interface Ethernet0/0/2 is not shutdown.
[SW3-Ethernet0/0/2]int g0/0/1
[SW3-GigabitEthernet0/0/1]port link-type trunk
[SW3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/1]un sh
[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2]port link-type trunk
[SW3-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[SW3-GigabitEthernet0/0/2]un sh
PC1>ping 1.1.1.1
Ping 1.1.1.1: 32 data bytes, Press Ctrl_C to break
From 1.1.1.1: bytes=32 seq=1 ttl=254 time=93 ms
From 1.1.1.1: bytes=32 seq=2 ttl=254 time=47 ms
From 1.1.1.1: bytes=32 seq=3 ttl=254 time=47 ms
From 1.1.1.1: bytes=32 seq=4 ttl=254 time=62 ms
From 1.1.1.1: bytes=32 seq=5 ttl=254 time=63 ms
--- 1.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/62/93 ms
PC2>ping 1.1.1.1
Ping 1.1.1.1: 32 data bytes, Press Ctrl_C to break
From 1.1.1.1: bytes=32 seq=1 ttl=254 time=109 ms
From 1.1.1.1: bytes=32 seq=2 ttl=254 time=63 ms
From 1.1.1.1: bytes=32 seq=3 ttl=254 time=62 ms
From 1.1.1.1: bytes=32 seq=4 ttl=254 time=63 ms
From 1.1.1.1: bytes=32 seq=5 ttl=254 time=47 ms
--- 1.1.1.1 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/68/109 ms
[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]shutdown
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。