You are on page 1of 4

R1:

conf t
interface Loopback0
ip address 1.1.1.1 255.255.255.0
!
interface s1/0
Desc conn to ebgp neig R2 in AS 2345
ip address 192.168.12.1 255.255.255.0
no shut
!
router bgp 100
network 1.1.1.0 mask 255.255.255.0
neighbor 192.168.12.2 remote-as 2345
!
end

R2:
conf t
interface Loopback0
Desc used in ibgp neig
ip address 2.2.2.2 255.255.255.255
!
interface s1/0
Desc conn to R1 in AS 100
ip address 192.168.12.2 255.255.255.0
no sh
!
interface e0/2
Desc conn to R3 in same sub-AS 23
ip address 192.168.23.2 255.255.255.0
no sh

!
interface e0/1
Desc to Sub-AS 45
ip address 192.168.24.2 255.255.255.0
no sh
int lo 1
ip add 22.22.22.22 255.255.255.0

!
router ospf 1
network 2.2.2.2 0.0.0.0 area 0
network 192.168.12.0 0.0.0.255 area 0
network 192.168.23.0 0.0.0.255 area 0
network 192.168.24.0 0.0.0.255 area 0
!
router bgp 64523
bgp confederation identifier 2345
bgp confederation peers 64545
neighbor 3.3.3.3 remote-as 64523
neighbor 3.3.3.3 update-source Loopback0
neighbor 3.3.3.3 next-hop-self
neighbor 4.4.4.4 remote-as 64545
neighbor 4.4.4.4 ebgp-multihop 2
neighbor 4.4.4.4 update-source Loopback0
neighbor 4.4.4.4 next-hop-self
neighbor 192.168.12.1 remote-as 100
neighbor 192.168.12.1 default-originate
net 22.22.22.0 mask 255.255.255.0
!
end

R3:
conf t
interface Loopback0
ip address 3.3.3.3 255.255.255.255
!
interface e0/0
ip address 192.168.23.3 255.255.255.0
no sh

router ospf 1
network 3.3.3.3 0.0.0.0 area 0
network 192.168.23.0 0.0.0.255 area 0

router bgp 64523


bgp confederation identifier 2345
bgp confederation peers 64545
neighbor 2.2.2.2 remote-as 64523
neighbor 2.2.2.2 update-source Loopback0
!
end

R4:
conf t
interface Loopback0
ip address 4.4.4.4 255.255.255.255
!
interface e0/1
Desc conn to R2 in diff sub-AS
ip address 192.168.24.4 255.255.255.0
no sh
!
interface e0/0
Desc conn to R5 in same Sub-as
ip address 192.168.45.4 255.255.255.0
no sh

router ospf 1
network 4.4.4.4 0.0.0.0 area 0
network 192.168.24.0 0.0.0.255 area 0
network 192.168.45.0 0.0.0.255 area 0
!
router bgp 64545
bgp confederation identifier 2345
bgp confederation peers 64523
neighbor 2.2.2.2 remote-as 64523
neighbor 2.2.2.2 ebgp-multihop 2
neighbor 2.2.2.2 update-source Loopback0
neighbor 5.5.5.5 remote-as 64545
neighbor 5.5.5.5 update-source Loopback0
!
end

R5:
conf t
interface Loopback0
ip address 5.5.5.5 255.255.255.255
!
interface e0/0
Desc conn to R4
ip address 192.168.45.5 255.255.255.0
no sh

router ospf 1
network 5.5.5.5 0.0.0.0 area 0
network 192.168.45.0 0.0.0.255 area 0
!
router bgp 64545
bgp confederation identifier 2345
bgp confederation peers 64523
neighbor 4.4.4.4 remote-as 64545
neighbor 4.4.4.4 update-source Loopback0
!
end

Note: When a bgp router learn a route from ibgp neig ,it will not propogate it to
other
ibp neig,however when confedrations are used it considers the other peer like ebgp
and propogates the route.

Community Attribute: Local-AS


-------------------------

R1:
conf t
access-list 1 permit 1.1.1.0 0.0.0.255
route-map RM permit 10
match ip address 1
set community local-AS
exi
route-map RM permit 20
exi

router bgp 100


neig 192.168.12.2 send-community
neig 192.168.12.2 route-map RM out
exi
R3: local AS
>i 1.1.1.0/24 2.2.2.2 0 100 0 100 i
R4/R5 diff sub-AS
==============================================================
Task 3:
Configure R2 such that it doesn’t advertise the prefixes that originated in it’s
own AS to
any of its neighbors.
^$ | Locally originated routes |

R2:
ip as-path access-list 1 deny ^$
ip as-path access-list 1 permit .*

router bgp 64523


neighbor 131.1.23.3 filter-list 1 out
-------------------------------------
ip as-path access-list 1 deny _2345_
ip as-path access-list 1 permit .*
router bgp 1
neighbor 192.168.12.2 filter-list 1 in

You might also like