国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 學(xué)院 > 網(wǎng)絡(luò)通信 > 正文

用bgpcommunity屬性實(shí)現(xiàn)路由的雙路備份

2019-11-05 00:41:23
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  用戶有兩個(gè)網(wǎng)絡(luò)6.6.6.0和7.7.7.0,
  要求:所有訪問(wèn)6網(wǎng)絡(luò)的數(shù)據(jù)都通過(guò)RTB到RTA,所有訪問(wèn)7.7.7.0的數(shù)據(jù)都走RTC到RTA,并且互相備份;
  實(shí)現(xiàn):通過(guò)路由策略在RTA向RTB和RTC通告這兩個(gè)路由的時(shí)候分別賦予不同的community屬性,然后在RTB和RTC上通過(guò)community屬性設(shè)置路由的本地優(yōu)先屬性從而達(dá)到客戶的要求;
  
  [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
  route-policy for6_7 permit 20
  if-match community 2
  apply local-preference 400
  !
  quit
  ip community-list 1 permit 200:1
  ip community-list 2 permit 100:1
  !
  return
  [RTC]dis bgp
  router ID: 10.2.0.2
  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     #^I     400  IGP    100
  10.2.0.1     #      200  IGP    100
  7.7.7.0/24  10.2.0.1     #^      400  IGP    100
  10.1.0.0/24  10.3.0.1     #^I     100  IGP
  10.2.0.0/24  0.0.0.0     #^         IGP
  [RTC]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 Serial0
  7.7.7.0/24   BGP 170     0     10.2.0.1 Serial1
  10.1.0.0/24   BGP 170     0     10.3.0.1 Serial0
  10.2.0.0/24 Direct  0     0     10.2.0.1 Serial1
  10.2.0.1/32 Direct  0     0     10.2.0.1 Serial1
  10.2.0.2/32 Direct  0     0    127.0.0.1 LoopBack0
  10.3.0.0/24  OSPF  10   3124     10.4.0.2 Serial0
  10.4.0.0/24 Direct  0     0     10.4.0.2 Serial0
  10.4.0.1/32 Direct  0     0    127.0.0.1 LoopBack0
  10.4.0.2/32 Direct  0     0     10.4.0.2 Serial0
  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
  [RTC]
  [RTC]
  
  //路由器D沒(méi)有任何非凡配置,只是bgp的
  基本配置,所以配置省略:
  
  [RTD]
  [RTD]dis bgp
  ^
  % Incomplete command found at '^' position.
  [RTD]dis bgp r
  [RTD]dis bgp routing-table
  Flags:  # - valid    ^ - active   I - internal
  D - damped   H - history   S - aggregate suppressed
  Dest/Mask     Next-hop    Med    Local-pref Origin As-path
  ---------------------------------------------------------------------------
  #^I 6.6.6.0/24     10.1.0.1    0     400     IGP  100
  #^I 7.7.7.0/24     10.2.0.1    0     400     IGP  100
  #^I 10.1.0.0/24    10.3.0.1    0     100     IGP
  #^I 10.2.0.0/24    10.4.0.1    0     100     IGP
  Routes total: 4
  [RTD]
  [RTD]dis ip rou
  Routing Table: public net
  Destination/Mask  Protocol Pre Cost    Nexthop     Interface
  6.6.6.0/24     BGP   256 0      10.1.0.1    Serial3/1
  7.7.7.0/24     BGP   256 0      10.2.0.1    Serial3/0
  10.1.0.0/24    BGP   256 0      10.3.0.1    Serial3/1
  10.2.0.0/24    BGP   256 0      10.4.0.1    Serial3/0
  10.3.0.0/24    DIRECT  0  0      10.3.0.2    Serial3/1
  10.3.0.1/32    DIRECT  0  0      10.3.0.1    Serial3/1
  10.3.0.2/32    DIRECT  0  0      127.0.0.1    InLoopBack0
  10.4.0.0/24    DIRECT  0  0      10.4.0.2    Serial3/0
  10.4.0.1/32    DIRECT  0  0      10.4.0.1    Serial3/0
  10.4.0.2/32    DIRECT  0  0      127.0.0.1    InLoopBack0
  127.0.0.0/8    DIRECT  0  0      127.0.0.1    InLoopBack0
  127.0.0.1/32    DIRECT  0  0      127.0.0.1    InLoopBack0
  [RTD]
  [RTD]
  [RTD]dis bgp pe
  [RTD]dis bgp peer
  Peer    AS-num Ver Queued-Tx  Msg-Rx  Msg-Tx  Up/Down State
  --------------------------------------------------------------------------------
  10.3.0.1     200 4     0     31     24  00:21:42 Established
  10.4.0.1     200 4     0     35     25  00:22:07 Established
  [RTD]


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 收藏| 泸水县| 菏泽市| 绩溪县| 根河市| 宁南县| 大城县| 灵山县| 富川| 高安市| 澄江县| 八宿县| 临武县| 石嘴山市| 明光市| 上饶市| 红桥区| 南丹县| 通道| 凤庆县| 澎湖县| 宁德市| 乐山市| 佳木斯市| 若羌县| 永宁县| 德惠市| 淅川县| 罗定市| 德钦县| 高唐县| 慈利县| 闸北区| 黑水县| 宜州市| 金平| 岳普湖县| 永善县| 丹凤县| 化隆| 扎囊县|