1. RTA和RTB采用VRRP做备份;
2. RTA、RTB使用VRRP虚地址与RTC起GRE Tunnel。
3. 当RTA链路出现问题时,切换到备用RTB上,保持GRE VPN不断,PC可以快速访问到备用服务器;
RTA的配置
#配置接口地址,并起VRRP
interface GigabitEthernet0/0
port link-mode route
ip address 1.1.1.2 255.255.255.0
vrrp vrid 1 virtual-ip 1.1.1.4
vrrp vrid 1 priority 110
vrrp vrid 1 preempt-mode timer delay 5
#配置连接内网服务器接口地址
interface GigabitEthernet0/1
port link-mode route
ip address 192.168.1.1 255.255.255.0
#配置GRE,此处注意,RTA和RTB上的配置参数需要一致,source地址需要配置为VRRP的虚地址。
interface Tunnel0
ip address 10.1.1.1 255.255.255.0
source 1.1.1.4
destination 1.1.1.10
keepalive 10 3
#配置完,切记要添加一条静态路由,指向tunnel口。
ip route-static 192.168.2.0 255.255.255.0 Tunnel0
RTB的配置
#配置接口地址,并起VRRP
interface GigabitEthernet0/0
port link-mode route
ip address 1.1.1.3 255.255.255.0
vrrp vrid 1 virtual-ip 1.1.1.4
vrrp vrid 1 preempt-mode timer delay 5
#配置连接内网服务器接口地址
interface GigabitEthernet0/1
port link-mode route
ip address 192.168.1.1 255.255.255.0
#配置GRE,此处注意,RTA和RTB上的配置参数需要一致,source地址需要配置为VRRP的虚地址。
interface Tunnel0
ip address 10.1.1.1 255.255.255.0
source 1.1.1.4
destination 1.1.1.10
keepalive 10 3
#
ip route-static 192.168.2.0 255.255.255.0 Tunnel0
#
RTC的配置
#配置出口地址
interface GigabitEthernet0/0
port link-mode route
ip address 1.1.1.10 255.255.255.0
#配置内网地址,这里使用一个loopback地址进行模拟
interface LoopBack5
ip address 192.168.2.2 255.255.255.255
#配置GRE tunnel
interface Tunnel0
ip address 10.1.1.2 255.255.255.0
source 1.1.1.10
destination 1.1.1.4
keepalive 10 3
#添加一条静态路由,指向tunnel口
ip route-static 192.168.1.0 255.255.255.0 Tunnel0
配置完成之后,在RTA上观察VRRP
[RTA]dis vrrp ver
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface GigabitEthernet0/0
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 110 Running Pri : 110
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 1.1.1.4
Virtual MAC : 0000-5e00-0101
Master IP : 1.1.1.2
在RTB上观察VRRP
[RTB]dis vrrp ver
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface GigabitEthernet0/0
VRID : 1 Adver Timer : 1
Admin Status : Up State : Backup
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Become Master : 3100ms left
Auth Type : None
Virtual IP : 1.1.1.4
Master IP : 1.1.1.2
可以看到,RTA为mater设备。
在RTA的观察tunnel0
[RTA]dis interface Tunnel 0
Tunnel0 current state: UP
Line protocol current state: UP
Description: Tunnel0 Interface
The Maximum Transmit Unit is 1476
Internet Address is 20.1.1.1/24 Primary
Encapsulation is TUNNEL, service-loopback-group ID not set.
Tunnel source 1.1.1.4, destination 1.1.1.10
Tunnel bandwidth 64 (kbps)
Tunnel keepalive enabled, Period(10 s), Retries(3)
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/0
Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0
Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0
Last clearing of counters: Never
Last 300 seconds input: 2 bytes/sec, 0 packets/sec
Last 300 seconds output: 2 bytes/sec, 0 packets/sec
404 packets input, 4956 bytes
0 input error
233 packets output, 5700 bytes
0 output error
在RTB上观察tunnel0
[RTB]dis interface Tunnel 0
Tunnel0 current state: DOWN
Line protocol current state: DOWN
Description: Tunnel0 Interface
The Maximum Transmit Unit is 64000
Internet Address is 10.1.1.1/24 Primary
Encapsulation is TUNNEL, service-loopback-group ID not set.
Tunnel source 1.1.1.4, destination 1.1.1.10
Tunnel bandwidth 64 (kbps)
Tunnel keepalive enabled, Period(10 s), Retries(3)
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/0
Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0
Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0
Last clearing of counters: Never
Last 300 seconds input: 0 bytes/sec, 0 packets/sec
Last 300 seconds output: 0 bytes/sec, 0 packets/sec
0 packets input, 0 bytes
0 input error
0 packets output, 0 bytes
0 output error
在RTC上观察tunnel0
[RTC]dis int Tunnel 0
Tunnel0 current state: UP
Line protocol current state: UP
Description: Tunnel0 Interface
The Maximum Transmit Unit is 1476
Internet Address is 10.1.1.2/24 Primary
Encapsulation is TUNNEL, service-loopback-group ID not set.
Tunnel source 1.1.1.10, destination 1.1.1.4
Tunnel bandwidth 64 (kbps)
Tunnel keepalive enabled, Period(10 s), Retries(3)
Tunnel protocol/transport GRE/IP
GRE key disabled
Checksumming of GRE packets disabled
Output queue : (Urgent queuing : Size/Length/Discards) 0/100/0
Output queue : (Protocol queuing : Size/Length/Discards) 0/500/0
Output queue : (FIFO queuing : Size/Length/Discards) 0/75/0
Last clearing of counters: Never
Last 300 seconds input: 0 bytes/sec, 0 packets/sec
Last 300 seconds output: 2 bytes/sec, 0 packets/sec
221 packets input, 324 bytes
0 input error
239 packets output, 5844 bytes
0 output error
断开RTA的连线之后,可以看到VRRP已经切换到了RTB设备上。
[RTB]dis vrrp ver
IPv4 Standby Information:
Run Mode : Standard
Run Method : Virtual MAC
Total number of virtual routers : 1
Interface GigabitEthernet0/0
VRID : 1 Adver Timer : 1
Admin Status : Up State : Master
Config Pri : 100 Running Pri : 100
Preempt Mode : Yes Delay Time : 5
Auth Type : None
Virtual IP : 1.1.1.4
Virtual MAC : 0000-5e00-0101
Master IP : 1.1.1.3
1、 RTA与RTB配置的GRE参数需要保持一致。
2、 配置完之后,记得添加一个路由,指向tunnel口。
该案例暂时没有网友评论
✖
案例意见反馈
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作