CiscoTik

Networking Administration

CiscoTik

Networking Administration

CiscoTik

آموزش شبکه های مبتنی بر سیسکو و میکروتیک و ...

طبقه بندی موضوعی
محبوب ترین مطالب
نویسندگان
  • ۲
  • ۰

BGP community

سلام

شرح سناریو

..........................................................................

R1 is configured for EBGP and IBGP. The EBGP connection to the remote peer address, 141.199.2.2, is the Internet gateway. Therefore, you must send the
community to the remote peer and apply an outbound route map, so the Internetrouters do not use R1 as a transit path. You have yet to apply the route map named setcommunity (arbitrary name).  Apply the well-known community no-export, which informs the neighboring router not to use R1 for any traffic not destined for the network 131.108.0.0/16.

configure the four routers, R1–R4, for IBGP, and set the same policies on all four routers.



comunity






ensure that R1 does not receive any default routes from R2, R3, or R4 (sets the next-hop-self attribut. Ensure that R1 sets the community to the value 2000.


R1(config)#route-map setcommunity
R1(config-route-map)#set community no-export
R1(config-router)#neighbor 141.199.2.2 route-map setcommunity out
یعنی مسیرهایی که با این مقدار دریافت میشوند،دیگر به همسایه های eBGP تبلیغ نشوند.یعنی به روتر 5 هیچ مسیری از AS1 تبلیغ نشود.


Take advantage of peer groups and configure one policy, and apply that policy on R1 to all three remote routers (R2, R3, and R4).

configures R1 for IBGP to R2 only, sets the next-hop-self attribute (no defaults routes permitted), sends the community value of 2000, and sets the
weight to 1000.

R1(config)#route-map setattributes
R1(config-route-map)#set community 2000
R1(config)#access-list 1 deny 0.0.0.0
R1(config)#access-list permit any
R1(config-router)#neighbor 131.108.1.2 route-map setattributes in
R1(config-router)#neighbor 131.108.1.2 next-hop-self
R1(config-router)#neighbor 131.108.1.2 distribute-list 1 in
R1(config-router)#neighbor 131.108.1.2 send-community
R1(config-router)#neighbor 131.108.1.2 weight 1000
در اینجا weight 1000 یعنی ،مسیر  R1به interface FE 0/0 R1) R2 )دارای وزن 1000 باشد.
و دستور send-community یعنی به همسایه صفت community ارسال کن.


To configure R1 to set the same attributes and conditions to R3 and R4, you need to complete the same set of IOS commands , and have different route maps and access lists. Clearly with a large network, this is not scalable.



To create a BGP peer group, use the neighbor peer-group command:m


R1(config)#router bgp 1
R1(config-router)#neighbor internal peer-group


در شکل زیر خروجی ؟ دستور مربوط به bgp community را مشاهده میکنیم ومتوجه می شویم که بجای نوشتن کل دستورات که زیادهستند(برای یک یک روترها در R1)،میشود آنهارا یکبار و در community نوشت و استفاده کرد



خروجی ؟ درbgp community

.......................................................................................................

R1(config-router)#neighbor internal distribute-list 1 in
R1(config-router)#neighbor internal next-hop-self
R1(config-router)#neighbor internal remote-as 1
R1(config-router)#neighbor internal route-map setattributes in

Finally, apply these settings to all the remote peers.

router bgp 1
neighbor 131.108.1.2 peer-group internal
neighbor 131.108.255.6 peer-group internal
neighbor 131.108.255.14 peer-group internal




all configs:

...........................................

R1:

router bgp 1
no synchronization
network 131.108.255.4 mask 255.255.255.252
network 131.108.255.12 mask 255.255.255.252
neighbor internal peer-group
neighbor internal remote-as 1
neighbor internal distribute-list 1 in
neighbor internal route-map setattributes in
neighbor 131.108.1.2 peer-group internal
neighbor 131.108.255.6 peer-group internal
neighbor 131.108.255.14 peer-group internal
neighbor 141.199.1.1 remote-as 1001
neighbor 141.199.1.1 send-community
neighbor 141.199.1.1 route-map setcommunity out
access-list 1 deny 0.0.0.0
access-list 1 permit any
route-map setcommuntiy permit 10
set community no-export
!
route-map setattributes permit 10
match ip address 2
set weight 1000
set community 1000





R2:

router bgp 1
no synchronization
284
network 131.108.255.0 mask 255.255.255.252
network 131.108.255.8 mask 255.255.255.252
neighbor 131.108.1.1 remote-as 1
neighbor 131.108.255.2 remote-as 1
neighbor 131.108.255.10 remote-as 1


R3:

router bgp 1
no synchronization
network 141.108.1.0 mask 255.255.255.0
network 131.108.255.4 mask 255.255.255.252
network 131.108.255.8 mask 255.255.255.252
neighbor 131.108.255.5 remote-as 1
neighbor 131.108.255.9 remote-as 1
!
no ip classless
route-map setweight permit 10
match ip address 1
set weight 1
!
route-map setweight permit 20
match ip address 2



R4:

router bgp 1
no synchronization
network 131.108.255.0 mask 255.255.255.252
network 131.108.255.12 mask 255.255.255.252
network 151.108.1.0 mask 255.255.255.0
neighbor 131.108.255.1 remote-as 1
neighbor 131.108.255.13 remote-as 1

نظرات (۱)

مطالبت مطالب خوب و کاربردی هست....

ارسال نظر

ارسال نظر آزاد است، اما اگر قبلا در بیان ثبت نام کرده اید می توانید ابتدا وارد شوید.
شما میتوانید از این تگهای html استفاده کنید:
<b> یا <strong>، <em> یا <i>، <u>، <strike> یا <s>، <sup>، <sub>، <blockquote>، <code>، <pre>، <hr>، <br>، <p>، <a href="" title="">، <span style="">، <div align="">
تجدید کد امنیتی