Routing

last person joined: 3 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.  Cisco BGP Conversion

    Posted 12-14-2016 09:29

    I have a good working BGP configuration on our Cisco routers (multiple sites) which each site has two MPLS providers. The config below prefers one carrier over the other and prevents a sitte from becoming a transient site.  I now need to convert the BGP config to our Juniper SRX units. I appreciate any assistance to convert the Cisco config below into a Juniper equivalent.

    Thanks again.

    Jeff

     

    router bgp 30
    no synchronization
    bgp log-neighbor-changes
    network 10.3.3.0 mask 255.255.255.0
    neighbor 172.16.3.2 remote-as 4321
    neighbor 172.16.3.2 route-map NO-TRANSIT-AS out
    neighbor 192.168.3.2 remote-as 1234
    neighbor 192.168.3.2 route-map PREFER-Comcast in
    neighbor 192.168.3.2 route-map NO-TRANSIT-AS out
    no auto-summary
    !
    ip as-path access-list 10 permit ^$
    !
    route-map NO-TRANSIT-AS permit 10
    match as-path 10
    !
    route-map PREFER-Comcast permit 10
    set local-preference 200
    !
    route-map PREFER-Comcast permit 20



  • 2.  RE: Cisco BGP Conversion

     
    Posted 12-15-2016 02:27

    Hi, 

     

    You could try using the ios-to-junos conversion tool:

    https://kb.juniper.net/InfoCenter/index?page=content&id=KB15482&smlogin=true&actp=search

     

    It would generate a junos equivalent config. Although there could different ways of writing the policies.

     

    Cheers,

    Ashvin



  • 3.  RE: Cisco BGP Conversion

    Posted 12-15-2016 07:07

    Ashvin:

    I tried but it only partially (at best) converted the config. Appreciate the reply.

    Jeff



  • 4.  RE: Cisco BGP Conversion
    Best Answer

     
    Posted 12-16-2016 08:04

    Hi,

     

    Config from I2J is complete:

     

    Spoiler
    routing-options {
    autonomous-system 30;
    }
    protocols {
    bgp {
    path-selection cisco-non-deterministic;
    log-updown;
    group group-1 {
    type external;
    neighbor 172.16.3.2 {
    export [ bgp-redistributes bgp-policies-group-1-1-export ];
    peer-as 4321;
    }
    }
    group group-2 {
    type external;
    neighbor 192.168.3.2 {
    export [ bgp-redistributes bgp-policies-group-2-1-export ];
    import bgp-policies-group-2-1-import;
    peer-as 1234;
    }
    }
    }
    }
    policy-options {
    as-path path-10-accept "()";
    community all members "*:*";
    policy-statement ap-10 {
    term accept-term {
    from as-path path-10-accept;
    then accept;
    }
    term ios-implicit-deny {
    then reject;
    }
    }
    policy-statement bgp-policies-group-1-1-export {
    term term-1 {
    from policy ( ! rm-NO-TRANSIT-AS );
    then reject;
    }
    term strip-communities {
    then {
    community delete all;
    next term;
    }
    }
    term explicit-default-action {
    then next policy;
    }
    }
    policy-statement bgp-policies-group-2-1-export {
    term term-1 {
    from policy ( ! rm-NO-TRANSIT-AS );
    then reject;
    }
    term strip-communities {
    then {
    community delete all;
    next term;
    }
    }
    term explicit-default-action {
    then next policy;
    }
    }
    policy-statement bgp-policies-group-2-1-import {
    term term-1 {
    from policy ( ! rm-PREFER-Comcast );
    then reject;
    }
    term explicit-default-action {
    then next policy;
    }
    }
    policy-statement bgp-redistributes {
    term sourced-bgp-network {
    from route-filter 10.3.3.0/24 exact;
    then accept;
    }
    term from-bgp {
    from protocol bgp;
    then next policy;
    }
    term ios-implicit-deny {
    then reject;
    }
    }
    policy-statement rm-NO-TRANSIT-AS {
    term term-1 {
    from policy ap-10;
    then accept;
    }
    term ios-implicit-deny {
    then reject;
    }
    }
    policy-statement rm-PREFER-Comcast {
    term term-1 {
    then {
    local-preference 200;
    accept;
    }
    }
    term term-2 {
    then accept;
    }
    }
    }

    It can be simplified into below using a single policy for import/export:

    Spoiler
    routing-options {
    autonomous-system 30;
    }
    protocols {
    bgp {
    path-selection cisco-non-deterministic;
    log-updown;
    group group-1 {
    type external;
    neighbor 172.16.3.2 {
    export bgp-export;
    peer-as 4321;
    }
    }
    group group-2 {
    type external;
    neighbor 192.168.3.2 {
    export bgp-export;
    import bgp-import;
    peer-as 1234;
    }
    }
    }
    }
    policy-options {
    as-path NO-TRANSIT-AS "()";
    community all members "*:*";
    policy-statement bgp-export {
    term sourced-bgp-network {
    from route-filter 10.3.3.0/24 exact;
    then accept;
    }
    term from-bgp {
    from {
    protocol bgp;
    as-path NO-TRANSIT-AS;
    }
    then {
    community delete all;
    accept;
    }
    }
    term ios-implicit-deny {
    then reject;
    }
    }
    policy-statement bgp-import {
    term PREFER-Comcast {
    then {
    local-preference 200;
    accept;
    }
    }
    }
    }

    Cheers,

    Ashvin

     



  • 5.  RE: Cisco BGP Conversion

    Posted 12-16-2016 10:00

    Ashvin:

    Thank you for the output as when I did it there were many line in red indicating it could not interpret.

    Jeff