Передача BGP-префиксов на Cisco

Дано: два апстрима, от одного из которых я принимаю full-view (World), от второго только украинские префиксы (UA).
Задача: отдать default route и, отдельно, украинские префиксы пиру Target и принять и проанонсить его префиксы аплинкам. Украинский трафик, естественно, должен ходить через UA, остальной через World.

Решение:

interface GigabitEthernet1/1
 switchport
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 10
 switchport mode trunk
 switchport nonegotiate
!
interface GigabitEthernet1/2
 switchport
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 20
 switchport mode trunk
 switchport nonegotiate
!
interface GigabitEthernet1/3
 switchport
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 30,40
 switchport mode trunk
 switchport nonegotiate
!
interface Vlan10
 ip address 1.1.1.2 255.255.255.252
 ip policy route-map World-map
!
interface Vlan20
 ip address 2.2.2.2 255.255.255.252
 ip policy route-map UA-map
!
interface Vlan30
 ip address 3.3.3.1 255.255.255.252
!
interface Vlan40
 ip address 4.4.4.1 255.255.255.252
!
router bgp 1234
 no synchronization
 bgp router-id 1.1.1.2
 bgp log-neighbor-changes
 neighbor 1.1.1.1 remote-as 1111
 neighbor 1.1.1.1 send-community
 neighbor 1.1.1.1 soft-reconfiguration inbound
 neighbor 1.1.1.1 route-map World-in in
 neighbor 1.1.1.1 route-map World-out out
 neighbor 2.2.2.2 remote-as 2222
 neighbor 2.2.2.2 send-community
 neighbor 2.2.2.2 soft-reconfiguration inbound
 neighbor 2.2.2.2 route-map UA-in in
 neighbor 2.2.2.2 route-map UA-out out
 neighbor 3.3.3.3 remote-as 3333
 neighbor 3.3.3.3 send-community
 neighbor 3.3.3.3 default-originate
 neighbor 3.3.3.3 soft-reconfiguration inbound
 neighbor 3.3.3.3 route-map Customer-in in
 neighbor 3.3.3.3 route-map Customer-World-out out
 neighbor 4.4.4.4 remote-as 3333
 neighbor 4.4.4.4 send-community
 neighbor 4.4.4.4 soft-reconfiguration inbound
 neighbor 4.4.4.4 route-map Customer-in in
 neighbor 4.4.4.4 route-map Customer-UA-out out
 no auto-summary
!
ip community-list expanded UA permit 1234:3
!
ip prefix-list Customer-prefs seq 1 permit 30.30.30.0/19
ip prefix-list Customer-prefs seq 2 permit 31.31.31.0/21
ip prefix-list Customer-prefs seq 3 permit 32.32.32.0/24
!
ip access-list expanded Customer
 permit ip any 30.30.30.0 0.0.31.255
 permit ip any 31.31.31.0 0.0.7.255
 permit ip any 32.32.32.0 0.0.0.255
!
ip prefix-list default seq 1 permit 0.0.0.0/0
!
route-map World-map permit 1
 match ip address Customer
 set ip next-hop 3.3.3.3
!
route-map UA-map permit 1
 match ip address Customer
 set ip next-hop 4.4.4.4
!
route-map World-in permit 1
!
route-map World-out permit 1
 match ip address prefix-list Customer-prefs
!
route-map UA-in permit 1
 set community 1234:3
!
route-map UA-out permit 1
 match ip address prefix-list Customer-prefs
!
route-map Customer-in permit 1
 match ip address prefix-list Customer-prefs
!
route-map Customer-in deny 2
!
route-map Customer-World-out permit 1
 match ip address prefix-list default
!
route-map Customer-World-out deny 2
!
route-map Customer-UA-out deny 1
 match ip address prefix-list default
!
route-map Customer-UA-out permit 2
 match community UA
!
route-map Customer-UA-out deny 3
!

Добавить комментарий

Ваш адрес email не будет опубликован.