BGP綜合實驗

最近在網上看到這個拓撲感覺不錯,就拿來做了,做了些小修改
配置:
<RT1>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT1
#
 router id 1.1.1.1
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Ethernet0/1/0
 port link-mode route
#
interface Serial0/2/0
 link-protocol ppp
 ip address 17.17.17.1 255.255.255.0
#
interface Serial0/2/1
 link-protocol ppp
 ip address 14.14.14.1 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 1.1.1.1 255.255.255.255
#
bgp 100
 undo synchronization
 peer 17.17.17.7 as-number 700
 peer 14.14.14.4 as-number 100
 peer 14.14.14.4 next-hop-local//強制本地爲下一跳
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return



<RT2>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT2
#
 router id 2.2.2.2
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
acl number 2000
 rule 0 permit source 4.4.4.4 0/用acl匹配數據流,用於策略
#
interface Ethernet0/1/0
 port link-mode route
#
interface Serial0/2/0
 link-protocol ppp
 ip address 24.24.24.2 255.255.255.0
#
interface Serial0/2/1
 link-protocol ppp
 ip address 23.23.23.2 255.255.255.0
#
interface Serial0/2/2
 link-protocol ppp
 ip address 25.25.25.2 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 2.2.2.2 255.255.255.255
#
bgp 100
 import-route ospf 1
 undo synchronization
 peer 4.4.4.4 as-number 100
 peer 25.25.25.5 as-number 500
 peer 3.3.3.3 as-number 100
 peer 4.4.4.4 next-hop-local
 peer 4.4.4.4 connect-interface LoopBack0/用換回口做bgp的建立
 peer 25.25.25.5 route-policy xuanlu export//應用策略在出方向
 peer 3.3.3.3 connect-interface LoopBack0
#
ospf 1
 area 0.0.0.0
  network 2.2.2.2 0.0.0.0
  network 24.24.24.0 0.0.0.255
  network 23.23.23.0 0.0.0.255
#
route-policy xuanlu permit node 10
 if-match acl 2000
 apply cost 22222//修改med值
#              
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return


<RT3>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT3
#
 router id 3.3.3.3
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
acl number 2000
 rule 0 permit source 50.1.1.1 0
#
interface Ethernet0/1/0
 port link-mode route
#
interface Serial0/2/0
 link-protocol ppp
 ip address 23.23.23.3 255.255.255.0
#
interface Serial0/2/1
 link-protocol ppp
 ip address 35.35.35.3 255.255.255.0
#
interface Serial0/2/2
 link-protocol ppp
 ip address 34.34.34.3 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 3.3.3.3 255.255.255.255
#
bgp 100
 import-route ospf 1//引入ospf
 undo synchronization
 peer 4.4.4.4 as-number 100
 peer 2.2.2.2 as-number 100
 peer 35.35.35.5 as-number 500
 peer 4.4.4.4 route-policy xuanlu export
 peer 4.4.4.4 next-hop-local
 peer 4.4.4.4 connect-interface LoopBack0
 peer 2.2.2.2 connect-interface LoopBack0
#
ospf 1
 area 0.0.0.0
  network 23.23.23.0 0.0.0.255
  network 34.34.34.0 0.0.0.255
  network 3.3.3.3 0.0.0.0
#
route-policy xuanlu permit node 10
 if-match acl 2000
 apply local-preference 333
#              
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return


<RT4>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT4
#
 router id 4.4.4.4
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Ethernet0/1/0
 port link-mode route
#
interface Serial0/2/0
 link-protocol ppp
 ip address 14.14.14.4 255.255.255.0
#
interface Serial0/2/1
 link-protocol ppp
 ip address 24.24.24.4 255.255.255.0
#
interface Serial0/2/2
 link-protocol ppp
 ip address 34.34.34.4 255.255.255.0
#
interface Serial0/2/3
 link-protocol ppp
 ip address 46.46.46.4 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 4.4.4.4 255.255.255.255
#
bgp 100
 import-route ospf 1
 undo synchronization
 peer 14.14.14.1 as-number 100
 peer 2.2.2.2 as-number 100
 peer 46.46.46.6 as-number 600
 peer 3.3.3.3 as-number 100
 peer 14.14.14.1 reflect-client/反射器
 peer 2.2.2.2 connect-interface LoopBack0
 peer 3.3.3.3 connect-interface LoopBack0
#
ospf 1
 area 0.0.0.0
  network 24.24.24.0 0.0.0.255
  network 34.34.34.0 0.0.0.255
  network 4.4.4.4 0.0.0.0
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return



<RT5>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT5
#
 router id 5.5.5.5
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Ethernet0/1/0
 port link-mode route
 ip address 50.50.50.50 255.255.255.0
#
interface Serial0/2/0
 link-protocol ppp
 ip address 25.25.25.5 255.255.255.0
#
interface Serial0/2/1
 link-protocol ppp
 ip address 35.35.35.5 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 5.5.5.5 255.255.255.255
#
interface LoopBack1
 ip address 50.1.1.1 255.255.255.255
#
interface LoopBack2
 ip address 50.2.2.2 255.255.255.255
#
interface LoopBack3
 ip address 50.3.3.3 255.255.255.255
#
bgp 500
 network 50.50.50.0 255.255.255.0
 import-route direct route-policy 501
 undo synchronization
 peer 25.25.25.2 as-number 100
 peer 35.35.35.3 as-number 100
#
route-policy 501 permit node 10
 if-match ip-prefix 501
#
 ip ip-prefix 501 index 10 permit 50.1.1.1 32//ip前綴列表
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return



<RT6>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT6
#
 router id 6.6.6.6
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Ethernet0/1/0
 port link-mode route
 ip address 60.60.60.60 255.255.255.0
#
interface Serial0/2/0
 link-protocol ppp
 ip address 46.46.46.6 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 6.6.6.6 255.255.255.255
#
bgp 600
 network 60.60.60.0 255.255.255.0
 undo synchronization
 peer 46.46.46.4 as-number 100
 peer 46.46.46.4 route-policy tuanti export
 peer 46.46.46.4 advertise-community//團體屬性
#
route-policy tuanti permit node 10
 apply community no-export//具有此屬性的路由在收到後,不能被髮布到本地AS之外
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return


<RT7>dis cu
#
 version 5.20, Alpha 1011
#
 sysname RT7
#
 router id 7.7.7.7
#
vlan 1
#
domain system
 access-limit disable
 state active
 idle-cut disable
 self-service-url disable
#
interface Ethernet0/1/0
 port link-mode route
 ip address 70.70.70.70 255.255.255.0
#
interface Serial0/2/0
 link-protocol ppp
 ip address 17.17.17.7 255.255.255.0
#
interface NULL0
#
interface LoopBack0
 ip address 7.7.7.7 255.255.255.255
#
bgp 700
 network 70.70.70.0 255.255.255.0
 undo synchronization
 peer 17.17.17.1 as-number 100
 peer 17.17.17.1 route-policy jieshou import
#
route-policy jieshou permit node 10
 if-match as-path 111
#
 ip as-path 111 deny 100$//正則表達式,拒絕as100
 ip as-path 111 permit .*//允許所有
#
 load xml-configuration
#
user-interface con 0
user-interface vty 0 4
#
return
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章