VRRP與VLAN綜合實驗
實驗要求:
1. 使VLAN10中的PC1和VLAN20中的PC2能夠ping通主機PC3,且vlan10和valn20中的主機能夠互通。
2. PC1和PC2的網關都使用虛擬網關(見拓撲圖),並且當交換機S3的GE0/0/3口出現故障時,PC1也能和PC2,PC3通信。
3. 在S1和S2中配置VRRP。且要配置VRRP認證。
實驗拓撲:
實驗思路:
路由器要有分別去往PC1和PC2的路由。S1和S2也要有去往PC3的路由
S1和S2的vlan1要配置與之路由器接口對應的IP地址。
虛擬網關IP的網段要與所在的vlanID的網段一致。
同一個VRRP備份組的認證方式和密碼要一致。
實驗配置:
[Huawei]sysn R1
[R1]inter g0/0/2
[R1-GigabitEthernet0/0/2]ip add 3.3.3.1 24
[R1-GigabitEthernet0/0/1]ip add 192.168.1.1 24
[R1-GigabitEthernet0/0/0]ip add 192.168.2.1 24
[R1]ip route-static 172.16.1.0 24 192.168.1.2 配置靜態路由
[S1]vlan batch 10 20
[S1]inter g0/0/3
[S1-GigabitEthernet0/0/3]port link-type trunk
[S1-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[S1-GigabitEthernet0/0/3]inter g0/0/4
[S1-GigabitEthernet0/0/1]port link-type trunk
[S1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[S1]ip route-static 3.3.3.0 24 192.168.1.1 去往PC3 的路由
[S1-Vlanif1]ip add 192.168.1.2 24 與對端路由器接口IP一個網段
[S1]interface Vlanif 10
[S1-Vlanif10]ip address 172.16.1.3 24
[S1-Vlanif10]vrrp vrid 10 virtual-ip 172.16.1.1 虛擬網關IP一定要與vlan10的IP同一個網段
[S1-Vlanif10]vrrp vrid 10 priority 120 使其成為master
[S1-Vlanif10]vrrp vrid 10 authentication-mode md5 huawei 配置VRRP認證(密碼:huawei)
[S1-Vlanif10]inter vlan 20
[S1-Vlanif20]ip add 172.31.1.4 24 註意一定要為vlan20配置一個IP地址
[S1-Vlanif20]vrrp vrid 20 virtual-ip 172.31.1.1
[S1-Vlanif20]vrrp vrid 20 authentication-mode md5 huawei
[S1-Vlanif20]vrrp vrid 20 preempt-mode disable 關閉S1中VRRP備份組20的搶占模式
[S2]vlan batch 10 20
[S2]inter g0/0/4
[S2-GigabitEthernet0/0/4]port link-type trunk
[S2-GigabitEthernet0/0/4]port trunk allow-pass vlan all
[S2-GigabitEthernet0/0/4]inter g0/0/1
[S2-GigabitEthernet0/0/1]port link-type trunk
[S2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[S2]ip route-static 3.3.3.0 24 192.168.2.1
[S2]interface Vlanif 1
[S2-Vlanif1]ip add 192.168.2.2 24
[S2]interface Vlanif 10
[S2-Vlanif10]ip add 172.16.1.4 24
[S2-Vlanif10]vrrp vrid 10 virtual-ip 172.16.1.1
[S2-Vlanif10]vrrp vrid 10 preempt-mode disable
[S2-Vlanif10]vrrp vrid 10 authentication-mode md5 huawei
[S2-Vlanif10]inter vlan 20
[S2-Vlanif20]ip add 172.31.1.1 24
[S2-Vlanif20]vrrp vrid 20 virtual-ip 172.31.1.1
[S2-Vlanif20]vrrp vrid 20 priority 120
[S2-Vlanif20]vrrp vrid 20 authentication-mode md5 huawei
[Huawei]sysn S3
[S3]vlan batch 10 20
[S3]inter g0/0/1
[S3-GigabitEthernet0/0/1]port link-type access
[S3-GigabitEthernet0/0/1]port default vlan 10
[S3-GigabitEthernet0/0/1]inter g0/0/2
[S3-GigabitEthernet0/0/2]port link-type access
[S3-GigabitEthernet0/0/2]por de vla 20
[S3-GigabitEthernet0/0/2]inter g0/0/3
[S3-GigabitEthernet0/0/3]port link-type trunk
[S3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[S3-GigabitEthernet0/0/2]inter g0/0/4
[S3-GigabitEthernet0/0/4]port link-type trunk
[S3-GigabitEthernet0/0/4]port trunk allow-pass vlan all
實驗驗證:
本文出自 “新網學會博客” 博客,請務必保留此出處http://xwxhvip.blog.51cto.com/13020757/1983463
VRRP與VLAN綜合實驗