分享
 
 
 

用bgpcommunity属性实现路由的双路备份

王朝other·作者佚名  2008-05-19
窄屏简体版  字體: |||超大  

用户有两个网络6.6.6.0和7.7.7.0,

要求:所有访问6网络的数据都通过RTB到RTA,所有访问7.7.7.0的数据都走RTC到RTA,并且互相备份;

实现:通过路由策略在RTA向RTB和RTC通告这两个路由的时候分别赋予不同的community属性,然后在RTB和RTC上通过community属性设置路由的本地优先属性从而达到客户的要求;

[RTA]display current-configuration

Now create configuration...

Current configuration

!

version 1.74

sysname RTA

firewall enable

aaa-enable

aaa accounting-scheme optional

!

acl 100 match-order auto

rule normal permit ip source 6.6.6.0 0.0.0.255 destination any

rule normal deny ip source any destination any

!

acl 110 match-order auto

rule normal permit ip source 7.7.7.0 0.0.0.255 destination any

rule normal deny ip source any destination any

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

!

interface Serial0

clock DTECLK1

link-protocol ppp

ip address 10.1.0.1 255.255.255.0

!

interface Serial1

link-protocol ppp

ip address 10.2.0.1 255.255.255.0

!

interface LoopBack1

ip address 6.6.6.1 255.255.255.0

!

interface LoopBack2

ip address 7.7.7.1 255.255.255.0

!

quit

bgp 100

undo synchronization

network 6.6.6.0 mask 255.255.255.0

network 7.7.7.0 mask 255.255.255.0

peer 10.1.0.2 as-number 200

peer 10.1.0.2 route-policy for6 export

peer 10.1.0.2 advertise-community

peer 10.2.0.2 as-number 200

peer 10.2.0.2 route-policy for7 export

peer 10.2.0.2 advertise-community

!

quit

!

quit

route-policy for6 permit 10

if-match ip address 100

apply community 100:1

quit

route-policy for6 permit 20

if-match ip address 110

apply community 200:1

quit

route-policy for7 permit 10

if-match ip address 100

apply community 200:1

quit

route-policy for7 permit 20

if-match ip address 110

apply community 100:1

!

return

[RTA]dis ip rou

Routing Tables:

Destination/Mask

Proto

Pref

Metric

Nexthop

Interface

6.6.6.0/24

Direct

0

0

6.6.6.1 LoopBack1

6.6.6.1/32

Direct

0

0

127.0.0.1 LoopBack0

7.7.7.0/24

Direct

0

0

7.7.7.1 LoopBack2

7.7.7.1/32

Direct

0

0

127.0.0.1 LoopBack0

10.1.0.0/24

Direct

0

0

10.1.0.2 Serial0

10.1.0.1/32

Direct

0

0

127.0.0.1 LoopBack0

10.1.0.2/32

Direct

0

0

10.1.0.2 Serial0

10.2.0.0/24

Direct

0

0

10.2.0.2 Serial1

10.2.0.1/32

Direct

0

0

127.0.0.1 LoopBack0

10.2.0.2/32

Direct

0

0

10.2.0.2 Serial1

127.0.0.0/8

Direct

0

0

127.0.0.1 LoopBack0

127.0.0.1/32

Direct

0

0

127.0.0.1 LoopBack0

[RTA]

[RTA]dis bgp su

Peer

State

version AS

Msg-Rx

Msg-Tx

Queued-Tx Up/Down

10.1.0.2

Established 4

200

35

29

0

00:24:42

10.2.0.2

Established 4

200

35

29

0

00:24:43

[RTA]

[RTA]

[RTB]

[RTB]display current-configuration

Now create configuration...

Current configuration

!

version 1.74

sysname RTB

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

!

interface Serial0

link-protocol ppp

!

interface Serial1

link-protocol ppp

ip address 10.1.0.2 255.255.255.0

!

interface Serial2

clock DTECLK1

link-protocol ppp

ip address 10.3.0.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Serial3

link-protocol ppp

!

quit

ospf enable

!

quit

!

bgp 200

undo synchronization

network 10.1.0.0 mask 255.255.255.0

peer 10.3.0.2 as-number 200

peer 10.4.0.1 as-number 200

peer 10.1.0.1 as-number 100

peer 10.1.0.1 route-policy for6_7 import

!

quit

!

quit

route-policy for6_7 permit 10

if-match community 1

apply local-preference 400

quit

route-policy for6_7 permit 20

if-match community 2

apply local-preference 300

!

quit

ip community-list 1

permit 100:1

ip community-list 2

permit 200:1

!

return

[RTB]dis bgp su

Peer

State

version AS

Msg-Rx

Msg-Tx

Queued-Tx Up/Down

10.3.0.2

Established 4

200

22

33

0

00:21:03

10.4.0.1

Established 4

200

7

8

0

00:01:08

10.1.0.1

Established 4

100

27

36

0

00:24:55

[RTB]dis bgp

router ID: 10.3.0.1

Flags:

# - valid

^ - best

D - damped

H - history

I - internal

S - aggregate suppressed

Destination/Mask

Next Hop

Flags

Med

LocPref Origin

Path

6.6.6.0/24

10.1.0.1

#^

400

IGP

100

7.7.7.0/24

10.2.0.1

#^I

400

IGP

100

10.1.0.1

#

300

IGP

100

10.1.0.0/24

0.0.0.0

#^

IGP

10.2.0.0/24

10.4.0.1

#^I

100

IGP

[RTB]display ip routing-table

Routing Tables:

Destination/Mask

Proto

Pref

Metric

Nexthop

Interface

6.6.6.0/24

BGP

170

0

10.1.0.1 Serial1

7.7.7.0/24

BGP

170

0

10.2.0.1 Serial2

10.1.0.0/24

Direct

0

0

10.1.0.1 Serial1

10.1.0.1/32

Direct

0

0

10.1.0.1 Serial1

10.1.0.2/32

Direct

0

0

127.0.0.1 LoopBack0

10.2.0.0/24

BGP

170

0

10.4.0.1 Serial2

10.3.0.0/24

Direct

0

0

10.3.0.2 Serial2

10.3.0.1/32

Direct

0

0

127.0.0.1 LoopBack0

10.3.0.2/32

Direct

0

0

10.3.0.2 Serial2

10.4.0.0/24

OSPF

10

3124

10.3.0.2 Serial2

127.0.0.0/8

Direct

0

0

127.0.0.1 LoopBack0

127.0.0.1/32

Direct

0

0

127.0.0.1 LoopBack0

[RTB]

[RTC-bgp]

[RTC-bgp]qu

[RTC]

[RTC]display current-configuration

Now create configuration...

Current configuration

!

version 1.74

sysname RTC

firewall enable

aaa-enable

aaa accounting-scheme optional

!

interface Aux0

async mode flow

link-protocol ppp

!

interface Ethernet0

!

interface Serial0

clock DTECLK1

link-protocol ppp

ip address 10.4.0.1 255.255.255.0

ospf enable area 0.0.0.0

!

interface Serial1

clock DTECLK1

link-protocol ppp

ip address 10.2.0.2 255.255.255.0

!

quit

ospf enable

!

quit

!

bgp 200

undo synchronization

network 10.2.0.0 mask 255.255.255.0

peer 10.2.0.1 as-number 100

peer 10.2.0.1 route-policy for6_7 import

peer 10.4.0.2 as-number 200

peer 10.3.0.1 as-number 200

!

quit

!

quit

route-policy for6_7 permit 10

if-match community 1

apply local-preference 200

quit

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有