سلام به شما دوستان عزیز...
امروز یک سناریو آماده کردم که تقریبا تمام مباحث قبلی که توی وبلاگم گذاشته بودم رو در گیر میکنه...
متن سناریو به شرح زیر میباشد...
R1 has an EBGP peer to R5 and an IBGP peer to R2.
R2 has an EBGP peer to R4 and IBGP peer to R1.
Ensure that the 15 loopbacks on R1 (131.108.2.0–131.108.16.0/24) are advertised to R5 and that R5 modifies all even networks with a local weight to 1000 and metric (MED) to 100. For all odd networks, set the weight to 2000 and the metric (MED) to 200.
Ensure that R1 advertises a default route to R5 and that R2 advertises a default route to R4. Use a prefix list to accomplish this task.
Ensure that R4 does not accept any networks in the range 131.108.0.0 but does accept a default route only. All other networks must be denied on R4.
Ensure that R3 can reach all BGP-advertised networks using OSPF as the only routing protocol. (That is, redistribution is required on R1/R2).
all configs :
R1
router ospf 1
redistribute connected metric 100 subnets
redistribute bgp 100 metric 100 subnets
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
no synchronization
network 131.108.1.0 mask 255.255.255.0
network 131.108.2.0 mask 255.255.255.0
network 131.108.3.0 mask 255.255.255.0
network 131.108.4.0 mask 255.255.255.0
network 131.108.5.0 mask 255.255.255.0
network 131.108.6.0 mask 255.255.255.0
network 131.108.7.0 mask 255.255.255.0
network 131.108.8.0 mask 255.255.255.0
network 131.108.9.0 mask 255.255.255.0
network 131.108.10.0 mask 255.255.255.0
network 131.108.11.0 mask 255.255.255.0
network 131.108.12.0 mask 255.255.255.0
network 131.108.13.0 mask 255.255.255.0
network 131.108.14.0 mask 255.255.255.0
network 131.108.15.0 mask 255.255.255.0
network 131.108.16.0 mask 255.255.255.0
neighbor 131.108.1.2 remote-as 100
neighbor 171.108.1.2 remote-as 200
neighbor 171.108.1.2 next-hop-self
neighbor 171.108.1.2 default-originate
توضیح خط بولد شده : یعنی تمام loopback های R1 با Ospf تبلیغ شوند البته با متریک 100.
R2
router ospf 1
redistribute connected metric 100 subnets
redistribute bgp 100 metric 100 subnets
network 0.0.0.0 255.255.255.255 area 0
!
router bgp 100
no synchronization
network 131.108.1.0 mask 255.255.255.0
redistribute ospf 1 metric 100
neighbor 131.108.1.1 remote-as 100
neighbor 171.108.1.6 remote-as 300
neighbor 171.108.1.6 next-hop-self
neighbor 171.108.1.6 default-originate
R3
router ospf 1
network 0.0.0.0 255.255.255.255 area 0
R4
[router bgp 300
network 141.108.1.0 mask 255.255.255.0
neighbor 171.108.1.5 remote-as 100
neighbor 171.108.1.5 prefix-list default in
ip prefix-list default seq 5 permit 0.0.0.0/0
R5
router bgp 200
network 151.108.1.0 mask 255.255.255.0
neighbor 171.108.1.1 remote-as 100
neighbor 171.108.1.1 route-map changeattributes in
no auto-summary
!
!This ACL permits all even networks
access-list 1 permit 131.108.0.0 0.0.254.255
route-map changeattributes permit 10
match ip address 1
set metric 100
set weight 1000
! all odd networks
networks
route-map changeattributes permit 20
set metric 200
set weight 2000
در نهایت در شکل زیر تمام روتر ها با دستور show ip route مشخص شده اند.