vrrp适用范围:
vrrp是一种非常实用的协议,在各个企业公司的环境下,很受欢迎,他保障了路由的畅通,降低了路由堵塞所造成的损失和不变,他和mstp,osftp,nat协议等一样,是一种很实用的协议。
四.案例应用
拓扑图如下:
R5的配置如下:
Now create configuration...
Current configuration
!
version 1.74
sysname r5
firewall enable
aaa-enable
aaa accounting-scheme optional
vrrp ping-enable
!
acl 2000 match-order auto
rule normal permit source 192.168.10.0 0.0.0.255
rule normal permit source 192.168.20.0 0.0.0.255
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
!
interface Ethernet0.10
vlan-type dot1q vid 10
ip address 192.168.10.1 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
vrrp vrid 10 priority 120
!
interface Ethernet0.20
vlan-type dot1q vid 20
ip address 192.168.20.1 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
!
interface Ethernet1
!
interface Serial0
link-protocol ppp
!
interface Serial1
link-protocol ppp
ip address 192.168.30.2 255.255.255.0
nat outbound 2000 interface
!
interface Async0
physical-mode async
async mode protocol
link-protocol ppp
!
interface Async7
physical-mode async
async mode protocol
link-protocol ppp
!
voice-setup
!
subscriber-line 0
!
subscriber-line 1
!
quit
!
quit
ip route-static 0.0.0.0 0.0.0.0 192.168.30.1 preference 60
!
return
R9的配置如下:
Now create configuration...
Current configuration
!
version 1.74
local-user user1 service-type administrator password simple 123
sysname R9
firewall enable
aaa-enable
aaa accounting-scheme optional
vrrp ping-enable
!
acl 2000 match-order auto
rule normal permit source 192.168.10.1 0.0.0.255
rule normal permit source 192.168.20.1 0.0.0.255
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
ip address 192.168.100.9 255.255.255.0
!
interface Ethernet0.10
vlan-type dot1q vid 10
ip address 192.168.10.2 255.255.255.0
vrrp vrid 10 virtual-ip 192.168.10.254
!
interface Ethernet0.20
vlan-type dot1q vid 20
ip address 192.168.20.2 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
vrrp vrid 20 priority 120
vrrp vrid 20 track Serial1 reduced 30
!
interface Ethernet1
!
interface Serial0
link-protocol ppp
!
interface Serial1
clock DTECLK1
link-protocol ppp
ip address 192.168.40.2 255.255.255.0
nat outbound 2000 interface
!
interface Async0
physical-mode async
async mode protocol
link-protocol ppp
!
!
interface Async15
physical-mode async
async mode protocol
link-protocol ppp
!
quit
ip route-static 0.0.0.0 0.0.0.0 192.168.40.1 preference 60
!
return
R10的配置如下:
Now create configuration...
Current configuration
!
version 1.74
local-user user1 service-type administrator password simple 123
sysname r10
firewall enable
aaa-enable
aaa accounting-scheme optional
!
interface Aux0
async mode flow
link-protocol ppp
!
interface Ethernet0
ip address 192.168.100.10 255.255.255.0
!
interface Ethernet1
!
interface Serial0
link-protocol ppp
ip address 192.168.40.1 255.255.255.0
!
interface Serial1
clock DTECLK1
link-protocol ppp
ip address 192.168.30.1 255.255.255.0
!
interface LoopBack1
ip address 2.2.2.2 255.255.255.0
!
return
SW13配置如下:
stp enable
#
vlan 1
#
vlan 10
#
vlan 20
#
interface Vlan-interface1
ip address 192.168.100.33 255.255.255.0
#
interface Aux0/0
#
interface Ethernet0/1
port link-type trunk
port trunk permit vlan all
#
interface Ethernet0/2
port link-type trunk
port trunk permit vlan all
interface Ethernet0/23
#
interface Ethernet0/24
port link-type trunk
port trunk permit vlan all
#
interface NULL0
#
user-interface aux 0
user-interface vty 0 4
authentication-mode scheme
#
return
SW11配置如下:
stp enable
#
vlan 1
#
vlan 10
#
vlan 20
#
interface Vlan-interface1
ip address 192.168.100.41 255.255.255.0
#
interface Aux0/0
#
interface Ethernet0/1
port link-type trunk
port trunk permit vlan all
#
interface Ethernet0/2
port link-type trunk
port trunk permit vlan all
interface Ethernet0/24
port link-type trunk
port trunk permit vlan all
#
interface NULL0
#
user-interface aux 0
user-interface vty 0 4
authentication-mode none
#
return
R10 R9 R5中配置好结果如图
交换机上配置的端口属性
PC上测试
10网段测试 正常情况下能够访问外网2.2.2.2
关闭10.1 则无法访问外网,然后又可以访问
开启10.1 跟踪测试
在20网段测试 跟踪如下