Routing

 View Only

IMPORTANT MODERATION NOTICE

This community is currently under full moderation, meaning  all posts will be reviewed before appearing in the community. Please expect a brief delay—there is no need to post multiple times. If your post is rejected, you'll receive an email outlining the reason(s). We've implemented full moderation to control spam. Thank you for your patience and participation.



  • 1.  routing-options instance-export

    Posted 01-15-2013 15:42

    hi all

     

    I am trying to setup the following scenario:

     

    routing-instace type virtual-router running ospf against a remote CE.

    I have managed to use the instance-import to pluck the BGP default route and stick in the VRFs inet.0 table.

    I then made another policy to grab it from the VRFs inet.0 and send it via ospf to the remote ce.

     

    what am now need to do is grab the routes advertised to me from the CE and send them to the main instance as BGP routes.

     

    I have something like this to test it:

     

    > show configuration routing-instances Internet-OSPF 
    instance-type virtual-router;
    interface ge-2/0/8.0;
    routing-options {
        static {
            route 0.0.0.0/0 next-table inet.0;
            route 10.16.1.0/24 discard;
        }
        instance-export CustA-Internet-Routes;
    }
    protocols {
        ospf {
            export Default-Into-OSPF;
            area 0.0.0.0 {
                interface ge-2/0/8.0;
            }
        }
    }
    
    policy-statement CustA-Internet-Routes {
        term Allow-CustA-Routes {
            from {
                protocol static;
                route-filter 10.16.1.0/24 exact;
            }
            to {
                instance master;
                protocol bgp;
            }
            then accept;
        }
        then reject;
    }

     I guess there is something wrong with my policy.  Can I even export the routes to the main inet.0 and change their type before they land?  or am I thinking about it the wrong way?

     

    Comments please.

     

    thanks


    #instance-export
    #routing-instance


  • 2.  RE: routing-options instance-export
    Best Answer

    Posted 01-16-2013 07:49

    Hello,

    "instance-export" is for restricting route export from particular instance/table (by default, all routes are exported), not for directing specific routes into specific destination instances/tables and/or protocols.

    OTOH, "instance-import" is for directing specific routes into specific destination instances/tables.

    And routing protocol export policy is for inserting specific routes into routing protocol database (i.e. OSPF LSDB) or inclusion into protocol updates (i.e. RIP or BGP).

    Therefore you need 2 policies:

    1/ instance-import for master instance (yes, master instance/inet.0 can also have "instance-import" statement under [edit routing-options[), and

    2/ BGP export policy for BGP peering configured under [edit protocols].

    Here is an example of "instance-import" policy for master instance:

     

    [edit]
    aarseniev@mx80# show policy-options policy-statement From-VR-to-GRT 
    term 1 {
        from {
            instance Internet-OSPF;
            protocol ospf;
        }
        then accept;
    }
    
    [edit]
    aarseniev@mx80# show routing-options 
    router-id 198.18.0.3;
    autonomous-system 65018;
    instance-import From-VR-to-GRT;

     Here is the verification:

    aarseniev@mx80# show routing-instances Internet-OSPF 
    instance-type virtual-router;
    interface ge-1/1/8.2511;
    protocols {
        ospf {
            area 0.0.0.5 {
                interface ge-1/1/8.2511 {
                    interface-type p2p;
                    metric 10000;
                }
            }
        }
    }
    [edit]
    aarseniev@mx80# run show route protocol ospf table Internet-OSPF.inet.0    
    
    Internet-OSPF.inet.0: 16 destinations, 16 routes (16 active, 0 holddown, 0 hidden)
    + = Active Route, - = Last Active, * = Both
    
    198.18.0.3/32      *[OSPF/10] 00:11:07, metric 12000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.0.11/32     *[OSPF/10] 00:11:07, metric 11000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.0.32/32     *[OSPF/10] 00:11:07, metric 10000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.2.0/30      *[OSPF/10] 00:11:07, metric 12000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.3.0/30      *[OSPF/10] 00:11:07, metric 11000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.10.0/24     *[OSPF/10] 00:11:07, metric 12000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.11.0/30     *[OSPF/10] 00:11:07, metric 20000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.12.0/24     *[OSPF/10] 00:11:07, metric 11000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.12.0/30     *[OSPF/10] 00:11:07, metric 13000
                        > to 198.18.251.2 via ge-1/1/8.2511
    <skipped for brevity>
    
    [edit]
    aarseniev@mx80# run show route protocol ospf 
    
    inet.0: 27 destinations, 42 routes (24 active, 0 holddown, 3 hidden)
    + = Active Route, - = Last Active, * = Both
    
    198.18.0.3/32       [OSPF/10] 6d 21:05:07, metric 0
                        > via lo0.0
                        [OSPF/10] 00:09:23, metric 12000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.0.11/32     *[OSPF/10] 6d 21:04:13, metric 1000
                        > to 198.18.10.11 via ge-1/1/6.10
                        [OSPF/10] 00:09:23, metric 11000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.0.32/32     *[OSPF/10] 6d 21:04:13, metric 2000
                        > to 198.18.10.11 via ge-1/1/6.10
                        [OSPF/10] 00:09:23, metric 10000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.2.0/30      *[OSPF/10] 6d 21:04:41, metric 3000
                        > to 198.18.22.2 via ge-1/1/8.22
                        [OSPF/10] 00:09:23, metric 12000
                        > to 198.18.251.2 via ge-1/1/8.2511
    198.18.3.0/30      *[OSPF/10] 6d 21:04:41, metric 4000
                        > to 198.18.22.2 via ge-1/1/8.22
                        [OSPF/10] 00:09:23, metric 11000
                        > to 198.18.251.2 via ge-1/1/8.2511

     

    And BGP export policy in master instance should look like below:

     

    [edit]
    aarseniev@mx80# show policy-options policy-statement bgp-export 
    term 1 {
        from {
            protocol ospf;
            route-filter 198.18.0.0/16 orlonger;
        }
        then accept;
    }
    

     Of course, you can enhance policy From-VR-to-GRT to i.e tag/assign community to imported OSPF routes and then match on this community in "bgp-export" policy, but I'll leave it for yourself to try.

    HTH

    Thanks

    Alex 

     



  • 3.  RE: routing-options instance-export

    Posted 01-16-2013 08:27

    Hi

     

    many thanks for your input.  Thats exactly what I ended up doing, using a multiple term instance-import under the master routing-options.  So I set one term per VRF I want to pull routes from.  it does the job Smiley Happy

     

    still not completely clear on the instance-export, if you cant specifiy which is the destination table, then what is the destination table?  How does the system know into which VRF/main table you want to send the routes?

     

    again, many thanks

     



  • 4.  RE: routing-options instance-export

    Posted 01-16-2013 08:54

    Hello,

    "To" clause in instance-export policies does not have any effect. 

     


    @wjonline1975 wrote:

     

    still not completely clear on the instance-export, if you cant specifiy which is the destination table, then what is the destination table?  How does the system know into which VRF/main table you want to send the routes?

     

     


    The stanza where "instance-import" is configured specifies the detsination instance/table.

    E.g. if you configure "instance-import" under [edit routing-options] then the destination instance is "master"/table is inet.0

    If you configure "instance-import" under [edit routing-instances VR100 routing-options] then destination instance is "VR100"/table is VR100.inet.0

    HTH

    Thanks
    Alex



  • 5.  RE: routing-options instance-export

    Posted 01-16-2013 13:58

    seems like instance-export is about as useful as /dev/null then.

     

    I did like you mentioned and had imports from both sides. rather than an import/export in the same VRF.

     

    cheers