Macro 32 Ramblings

Mind Archive

[Juniper] Step by Step Injecting Default Route via BGP in JunOS


[Juniper] Step by Step Injecting Default Route via BGP in JunOS

Posted by admin on 4th August 2009

admin@junOS# run show route advertising-protocol bgp 192.168.188.169

inet.0: 302188 destinations, 1452821 routes (301467 active, 0 holddown, 1146073 hidden)
Prefix                  Nexthop              MED     Lclpref    AS path
* 0.0.0.0/0               Self                                    I

Sometimes customers are running their layer 3 processing on a lack resources hardware.
And multihoming is also a good choise.
Therefor they need only an injected default via BGP connection as a primary outgoing with one their upstream and have a higher metric static default route with others.

Here what I have simply done :

1. Ensure that you have 0.0.0.0/0 in your routing table
admin@junOS#show route 0.0.0.0/0

2. Set Prefix List named [whatever] default-route 0.0.0.0/0
3. Set as-path ALL .*
4. Set your bgp export policy to customer with the first term allow this prefix only
5. Set your bgp export policy to customer with the second term deny all.

The command :

admin@junOS#edit policy-options
admin@junOS#set prefix-list default-route 0.0.0.0/0
admin@junOS#set as-path ALL .*
admin@junOS#set policy-statement EXPORT-USER term 1 from prefix-list default-route
admin@junOS#set policy-statement EXPORT-USER term 1 then accept
admin@junOS#set policy-statement EXPORT-USER term 2 from as-path ALL
admin@junOS#set policy-statement EXPORT-USER term 1 then reject
admin@junOS#commit

admin@junOS# run show route advertising-protocol bgp 192.168.188.169

inet.0: 302188 destinations, 1452821 routes (301467 active, 0 holddown, 1146073 hidden)
Prefix                  Nexthop              MED     Lclpref    AS path
* 0.0.0.0/0               Self

a. rahman isnaini r.sutan / ervin a. taufik
also thanks to Rommy Kuntoro [CBN People] for different successful solution.

term 2
{ from
{ route-filter 0.0.0.0/0 exact; }
then accept; }

Posted in BGP, Juniper | No Comments »
[JunOS] How to manipulate best routing path if Originating AS Number followed by ? [Incomplete].

Posted by admin on 9th July 2009

Bit weird to do.
I have to manipulate one of prefix which originated by AS 4668 and followed by ? [which is incomplete].
Doing set as-path AS4668 .*4668 doesn’t give any change either clearing the BGP Peering session softly or just commit command.

Then the idea is : this “set as-path .*4668.*”
Seems to work now :)

Before
======

run show route 165.243.115.69

inet.0: 298807 destinations, 1435892 routes (298020 active, 0 holddown, 1135356 hidden)
+ = Active Route, - = Last Active, * = Both

165.243.0.0/16 *[BGP/170] 00:07:05, localpref 1000
AS path: 4761 2687 3786 4668 ?
> to 118.91.224.109 via fe-1/1/1.0

After
=====

run show route 165.243.115.69

inet.0: 298817 destinations, 1435684 routes (298033 active, 0 holddown, 1134772 hidden)
+ = Active Route, - = Last Active, * = Both

165.243.0.0/16 *[BGP/170] 5d 07:38:53, localpref 5000
AS path: 45147 7473 3786 4668 ?
> to 119.110.121.233 via ge-1/3/0.34
[BGP/170] 5d 07:38:59, localpref 5000
AS path: 45147 7473 3786 4668 ?
> to 119.110.126.233 via ge-1/3/0.34

a. rahman isnaini r.sutan

Leave a Reply