Routing

last person joined: 2 days ago 

Ask questions and share experiences about ACX Series, CTP Series, MX Series, PTX Series, SSR Series, JRR Series, and all things routing, including portfolios and protocols.
  • 1.  an interesting question about RT(community)

    Posted 10-27-2012 07:14

    tttt.png

     

    # show    
    r1 {
        interfaces {
            em1 {
                unit 12 {
                    vlan-id 12;
                    family inet {
                        address 192.168.12.1/24;
                    }
                    family mpls;
                }
                unit 13 {
                    vlan-id 13;
                    family inet {
                        address 192.168.13.1/24;
                    }
                    family mpls;
                }
            }
            lo0 {
                unit 1 {
                    family inet {
                        address 1.1.1.1/32;
                    }
                }
            }
        }
        protocols {
            rsvp {
                interface em1.12;
                interface em1.13;
            }
            mpls {
                interface em1.12;
                interface em1.13;
            }
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em1.12;
                    interface em1.13;
                    interface lo0.1 {
                        passive;
                    }
                }
            }
        }
        routing-options {
            autonomous-system 100;
        }
    }
    r2 {
        interfaces {
            em2 {
                unit 12 {
                    vlan-id 12;
                    family inet {
                        address 192.168.12.2/24;
                    }
                    family mpls;
                }
                unit 27 {
                    vlan-id 27;
                    family inet {
                        address 192.168.27.2/24;
                    }
                }
            }
            lo0 {
                unit 2 {
                    family inet {
                        address 2.2.2.2/32;
                    }
                }
            }
        }
        protocols {
            rsvp {
                interface em2.12;
            }
            mpls {
                label-switched-path r2-r3 {
                    to 3.3.3.3;
                }
                interface em2.12;
            }
            bgp {
                group ibgp {
                    type internal;
                    local-address 2.2.2.2;
                    neighbor 3.3.3.3 {
                        family inet-vpn {
                            unicast;
                        }
                    }
                }
            }
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em2.12;
                    interface lo0.2 {
                        passive;
                    }
                }
            }
        }
        policy-options {
            policy-statement vpn-a-export {
                term 1 {
                    from protocol bgp;
                    then {
                        community add vpn-a;
                        accept;
                    }
                }
                term 2 {
                    then reject;
                }
            }
            policy-statement vpn-a-import {
                term 1 {
                    from {
                        protocol bgp;
                        community vpn-a;
                    }
                    then accept;
                }
                term 2 {
                    then reject;
                }
            }
            community vpn-a members target:100:1;
        }
        routing-instances {
            vpn-a {
                instance-type vrf;
                interface em2.27;
                route-distinguisher 100:1;
                vrf-import vpn-a-import;
                vrf-export vpn-a-export;
                vrf-table-label;
                protocols {
                    bgp {
                        group vpn-a {
                            type external;
                            neighbor 192.168.27.7 {
                                peer-as 78;
                                as-override;
                            }
                        }
                    }
                }
            }
        }
        routing-options {
            autonomous-system 100;
        }
    }
    r3 {
        interfaces {
            em2 {
                unit 13 {
                    vlan-id 13;
                    family inet {
                        address 192.168.13.3/24;
                    }
                    family mpls;
                }
                unit 35 {
                    vlan-id 35;
                    family inet {
                        address 192.168.35.3/24;
                    }
                }
            }
            lo0 {
                unit 3 {
                    family inet {
                        address 3.3.3.3/32;
                    }
                }
            }
        }
        protocols {
            rsvp {      
                interface em2.13;
            }
            mpls {
                label-switched-path r3-r2 {
                    to 2.2.2.2;
                }
                interface em2.13;
            }
            bgp {
                group ibgp {
                    type internal;
                    local-address 3.3.3.3;
                    neighbor 2.2.2.2 {
                        family inet-vpn {
                            unicast;
                        }
                    }
                }
            }
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em2.13;
                    interface lo0.3 {
                        passive;
                    }
                }
            }
        }
        routing-instances {
            vpn-a {
                instance-type vrf;
                interface em2.35;
                route-distinguisher 100:1;
                vrf-target target:100:1;
                vrf-table-label;
                protocols {
                    bgp {
                        group ebgp {
                            type external;
                            neighbor 192.168.35.5 {
                                peer-as 200;
                            }
                        }
                    }
                }       
            }
        }
        routing-options {
            autonomous-system 100;
        }
    }
    r4 {
        interfaces {
            em2 {
                unit 46 {
                    vlan-id 46;
                    family inet {
                        address 192.168.46.4/24;
                    }
                    family mpls;
                }
                unit 48 {
                    vlan-id 48;
                    family inet {
                        address 192.168.48.4/24;
                    }
                }
            }
            lo0 {
                unit 4 {
                    family inet {
                        address 4.4.4.4/32;
                    }
                }
            }
        }
        protocols {
            rsvp {
                interface em2.46;
            }
            mpls {
                label-switched-path r4-r5 {
                    to 5.5.5.5;
                }
                interface em2.46;
            }
            bgp {
                group ibgp {
                    type internal;
                    local-address 4.4.4.4;
                    neighbor 5.5.5.5 {
                        family inet-vpn {
                            unicast;
                        }
                    }
                }
            }
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em2.46;
                    interface lo0.4 {
                        passive;
                    }
                }
            }
        }
        policy-options {
            policy-statement vpn-a-export {
                term 1 {
                    from protocol bgp;
                    then {
                        community add vpn-a;
                        accept;
                    }
                }
                term 2 {
                    then reject;
                }
            }
            policy-statement vpn-a-import {
                term 1 {
                    from {
                        protocol bgp;
                        community vpn-a;
                    }
                    then accept;
                }
                term 2 {
                    then reject;
                }
            }
            community vpn-a members target:100:1;
        }
        routing-instances {
            vpn-a {
                instance-type vrf;
                interface em2.48;
                route-distinguisher 100:1;
                vrf-import vpn-a-import;
                vrf-export vpn-a-export;
                vrf-table-label;
                protocols {
                    bgp {
                        group vpn-a {
                            type external;
                            neighbor 192.168.48.8 {
                                peer-as 78;
                                as-override;
                            }
                        }
                    }
                }
            }
        }
        routing-options {
            autonomous-system 200;
        }
    }
    r5 {
        interfaces {
            em1 {
                unit 35 {
                    vlan-id 35;
                    family inet {
                        address 192.168.35.5/24;
                    }
                }
                unit 56 {
                    vlan-id 56;
                    family inet {
                        address 192.168.56.5/24;
                    }
                    family mpls;
                }
            }
            lo0 {
                unit 5 {
                    family inet {
                        address 5.5.5.5/32;
                    }
                }
            }           
        }
        protocols {
            rsvp {
                interface em1.56;
            }
            mpls {
                label-switched-path r5-r4 {
                    to 4.4.4.4;
                }
                interface em1.56;
            }
            bgp {
                group ibgp {
                    type internal;
                    local-address 5.5.5.5;
                    neighbor 4.4.4.4 {
                        family inet-vpn {
                            unicast;
                        }
                    }
                }
            }
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em1.56;
                    interface lo0.5 {
                        passive;
                    }
                }
            }
        }
        routing-instances {
            vpn-a {
                instance-type vrf;
                interface em1.35;
                route-distinguisher 100:1;
                vrf-target target:100:1;
                vrf-table-label;
                protocols {
                    bgp {
                        group ebgp {
                            type external;
                            neighbor 192.168.35.3 {
                                peer-as 100;
                            }
                        }
                    }
                }
            }
        }
        routing-options {
            autonomous-system 200;
        }
    }
    r6 {
        interfaces {
            em1 {
                unit 46 {
                    vlan-id 46;
                    family inet {
                        address 192.168.46.6/24;
                    }
                    family mpls;
                }
            }
            em2 {
                unit 56 {
                    vlan-id 56;
                    family inet {
                        address 192.168.56.6/24;
                    }
                    family mpls;
                }
            }
            lo0 {
                unit 6 {
                    family inet {
                        address 6.6.6.6/32;
                    }
                }
            }
        }
        protocols {
            rsvp {
                interface em1.46;
                interface em2.56;
            }
            mpls {
                interface em1.46;
                interface em2.56;
            }           
            ospf {
                traffic-engineering;
                area 0.0.0.0 {
                    interface em1.46;
                    interface em2.56;
                    interface lo0.6 {
                        passive;
                    }
                }
            }
        }
    }
    r7 {
        interfaces {
            em1 {
                unit 27 {
                    vlan-id 27;
                    family inet {
                        address 192.168.27.7/24;
                    }
                }
            }
            lo0 {
                unit 7 {
                    family inet {
                        address 7.7.7.7/32;
                    }
                }
            }
        }
        protocols {
            bgp {
                group ebgp {
                    type external;
                    export direct;
                    neighbor 192.168.27.2 {
                        peer-as 100;
                    }
                }
            }
        }
        policy-options {
            policy-statement direct {
                term 1 {
                    from protocol direct;
                    then accept;
                }
            }
        }
        routing-options {
            autonomous-system 78;
        }
    }
    r8 {
        interfaces {
            em1 {
                unit 48 {
                    vlan-id 48;
                    family inet {
                        address 192.168.48.8/24;
                    }
                }
            }
            lo0 {
                unit 8 {
                    family inet {
                        address 8.8.8.8/32;
                    }
                }
            }
        }
        protocols {
            bgp {
                group ebgp {
                    type external;
                    export direct;
                    neighbor 192.168.48.4 {
                        peer-as 200;
                    }
                }
            }
        }
        policy-options {
            policy-statement direct {
                term 1 {
                    from protocol direct;
                    then accept;
                }
            }
        }
        routing-options {
            autonomous-system 78;
        }
    }

     

     



  • 2.  RE: an interesting question about RT(community)

    Posted 10-27-2012 07:14

    Hi,expert

    I met an interesting question

     

    let 's look into the route adverstised by r8 to r7

     

    r8-r4-r5-r3-r2-r7

     

    in r5 's route table

    bgp.l3vpn.0: 1 destinations, 1 routes (1 active, 0 holddown, 0 hidden)

    100:1:8.8.8.8/32 (1 entry, 0 announced)
            *BGP    Preference: 170/-101
                    Route Distinguisher: 100:1
                    Next hop type: Indirect
                    Next-hop reference count: 3
                    Source: 4.4.4.4
                    Next hop type: Router, Next hop index: 865
                    Next hop: 192.168.56.6 via em1.56 weight 0x1, selected
                    Label-switched-path r5-r4
                    Label operation: Push 16, Push 299776(top)
                    Protocol next hop: 4.4.4.4
                    Push 16
                    Indirect next hop: 8d630a8 131070
                    State: <Active Int Ext>
                    Local AS:   200 Peer AS:   200
                    Age: 31:53      Metric2: 2
                    Task: BGP_200.4.4.4.4+179
                    AS path: 78 I
                    Communities: target:100:1
                    Import Accepted
                    VPN Label: 16
                    Localpref: 100
                    Router ID: 4.4.4.4
                    Secondary Tables: vpn-a.inet.0

    vpn table

     

    8.8.8.8/32 (1 entry, 1 announced)
            *BGP    Preference: 170/-101
                    Route Distinguisher: 100:1
                    Next hop type: Indirect
                    Next-hop reference count: 3
                    Source: 4.4.4.4
                    Next hop type: Router, Next hop index: 865
                    Next hop: 192.168.56.6 via em1.56 weight 0x1, selected
                    Label-switched-path r5-r4
                    Label operation: Push 16, Push 299776(top)
                    Protocol next hop: 4.4.4.4
                    Push 16
                    Indirect next hop: 8d630a8 131070
                    State: <Secondary Active Int Ext>
                    Local AS:   200 Peer AS:   200
                    Age: 31:53      Metric2: 2
                    Task: BGP_200.4.4.4.4+179
                    Announcement bits (2): 0-BGP RT Background 1-KRT
                    AS path: 78 I
                    Communities: target:100:1
                    Import Accepted
                    VPN Label: 16
                    Localpref: 100
                    Router ID: 4.4.4.4
                    Primary Routing Table bgp.l3vpn.0

     

     

    in r3 's route table

     

    # run show route 8.8.8.8/32 logical-system r3 detail

    vpn-a.inet.0: 4 destinations, 4 routes (4 active, 0 holddown, 0 hidden)
    8.8.8.8/32 (1 entry, 1 announced)
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 895
                    Next-hop reference count: 2
                    Source: 192.168.35.5
                    Next hop: 192.168.35.5 via em2.35, selected
                    State: <Active Ext>
                    Peer AS:   200
                    Age: 34:59
                    Task: BGP_200.192.168.35.5+52468
                    Announcement bits (2): 0-BGP RT Background 1-KRT
                    AS path: 200 78 I
                    Communities: target:100:1
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.35.5

     

     

    here is the question,when r3 advertise this 8.8.8.8 to r2,whether it will add another target:100:1 because there is a config in vpn-a
    :

    routing-instances {
        vpn-a {
            instance-type vrf;
            interface em2.35;
            route-distinguisher 100:1;
            vrf-target target:100:1;

     

    in r2 's route table:

     

    # run show route 8.8.8.8/32 logical-system r2 detail   

    vpn-a.inet.0: 5 destinations, 6 routes (5 active, 0 holddown, 0 hidden)
    8.8.8.8/32 (1 entry, 1 announced)
            *BGP    Preference: 170/-101
                    Route Distinguisher: 100:1
                    Next hop type: Indirect
                    Next-hop reference count: 6
                    Source: 3.3.3.3
                    Next hop type: Router, Next hop index: 893
                    Next hop: 192.168.12.1 via em2.12 weight 0x1, selected
                    Label-switched-path r2-r3
                    Label operation: Push 16, Push 299808(top)
                    Protocol next hop: 3.3.3.3
                    Push 16
                    Indirect next hop: 8d1f0a8 131073
                    State: <Secondary Active Int Ext>
                    Local AS:   100 Peer AS:   100
                    Age: 37:15      Metric2: 2
                    Task: BGP_100.3.3.3.3+179
                    Announcement bits (2): 0-BGP RT Background 1-KRT
                    AS path: 200 78 I
                    Communities: target:100:1
                    Import Accepted
                    VPN Label: 16
                    Localpref: 100
                    Router ID: 3.3.3.3
                    Primary Routing Table bgp.l3vpn.0

    bgp.l3vpn.0: 2 destinations, 2 routes (2 active, 0 holddown, 0 hidden)

    100:1:8.8.8.8/32 (1 entry, 0 announced)
            *BGP    Preference: 170/-101
                    Route Distinguisher: 100:1
                    Next hop type: Indirect
                    Next-hop reference count: 6
                    Source: 3.3.3.3
                    Next hop type: Router, Next hop index: 893
                    Next hop: 192.168.12.1 via em2.12 weight 0x1, selected
                    Label-switched-path r2-r3
                    Label operation: Push 16, Push 299808(top)
                    Protocol next hop: 3.3.3.3
                    Push 16
                    Indirect next hop: 8d1f0a8 131073
                    State: <Active Int Ext>
                    Local AS:   100 Peer AS:   100
                    Age: 37:15      Metric2: 2
                    Task: BGP_100.3.3.3.3+179
                    AS path: 200 78 I
                    Communities: target:100:1
                    Import Accepted
                    VPN Label: 16
                    Localpref: 100
                    Router ID: 3.3.3.3
                    Secondary Tables: vpn-a.inet.0
    in r7:

    # run show route 8.8.8.8/32 logical-system r7 detail   

    inet.0: 5 destinations, 6 routes (5 active, 0 holddown, 1 hidden)
    8.8.8.8/32 (1 entry, 1 announced)
            *BGP    Preference: 170/-101
                    Next hop type: Router, Next hop index: 779
                    Next-hop reference count: 4
                    Source: 192.168.27.2
                    Next hop: 192.168.27.2 via em1.27, selected
                    State: <Active Ext>
                    Local AS:    78 Peer AS:   100
                    Age: 39:00
                    Task: BGP_100.192.168.27.2+59993
                    Announcement bits (1): 0-KRT
                    AS path: 100 200 100 I
                    Communities: target:100:1
                    Accepted
                    Localpref: 100
                    Router ID: 192.168.27.2

     

    1:why not r3 add another rt in this route?it seems rt community is always there,the whole path!

    2: I can see rd is removed when pe import vpn route to its CE,right?



  • 3.  RE: an interesting question about RT(community)
    Best Answer

     
    Posted 10-27-2012 13:09

    Hi Rob,

     

    I believe RT being a "transistive extended community" you will see it as part of the route along the entire path after its addition.

     

    I did a quick check on RFCs to find what has to be the behavior when route already has extended community. I couldn't find a conclusive answer.

     

    RFC1997:
    ========
       A BGP speaker receiving a route that doesn't have the Extended
       Communities attribute MAY append this attribute to the route when
       propagating it to its peers.

       A BGP speaker receiving a route with the Extended Communities
       attribute MAY modify this attribute according to the local policy.


    RFC436
    ======
    Section 7

                d) Use of BGP makes it easy for the CE to pass attributes of
                   the routes to the PE.  A complete specification of the
                   set of attributes and their use is outside the scope of
                   this document.  However, some examples of the way this
                   may be used are the following:

     

    Also I did a quick lab test and JUNOS don't add same extended community twice.
    In one of my test, I have policy to add community twice, but eventually the route had only one community unless I had these community as different.

     

     

    policy-statement expo {
        from {
            route-filter 200.1.0.0/24 exact;
        }
        then {
            community add rt-1;
            community add rt-2;
            accept;
        }
    }
    community rt-1 members target:100:100;
    community rt-2 members target:100:100;


    In another test, I had CE advertising the route with RT community, then PE doesn't add one more. It keeps as it.

     

    So looks like when the VPN route consists of intended RT community, then JUNOS don't modify it.

     

    Regards

    Surya



  • 4.  RE: an interesting question about RT(community)

    Posted 10-27-2012 18:59

    haha,Surya

    yes,it seems it is the behavior of junos