Configure md5 authentication key for bgp group/neighbor

Bug #1449793 reported by Nischal Sheth
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Juniper Openstack
Status tracked in Trunk
R2.20
Fix Committed
Medium
Suresh Balineni
Trunk
Fix Committed
Medium
Suresh Balineni

Bug Description

Contrail BGP implementation added support for MD5 authentication
via bug 1383393. This bug tracks the device-manager changes to set
the appropriate configuration via netconf on JUNOS/MX.

MD5 can be configured for a bgp-router in the schema. The auth-data
in BgpRouterParameters has the relevant information. In this case, the
device manager needs to configure the authentication key in the bgp
group stanza for the group(s) representing the control nodes and the
other MXs.

MD5 can also be configured for a bgp-peeering in the schema. The
auth-data in the BgpSessionAttributes has the relevant information.
In this case, the device manager needs to configure authentication
key under the bgp neighbor stanza corresponding to that peer.

Here's a link to the JUNOS configuration for authentication-key:

http://www.juniper.net/documentation/en_US/junos14.2/topics/reference/configuration-statement/authentication-key-edit-protocols-bgp.html

Revision history for this message
Suresh Balineni (sbalineni) wrote :

Hi Nischal,

Few comments on AuthData schema type, currently it is defined as as:

<xsd:complexType name='AuthenticationData'>
             <xsd:element name="key-type" type="AuthenticationKeyType"/>
      <xsd:sequence>
                     <xsd:element name='key-items' type='AuthenticationKeyItem' maxOccurs='2'/>
             </xsd:sequence>
</xsd:complexType>

this can be seen as:

 BgpRouterParameters {
      auth_data {
           enum key-type (md5)
           key-items[0..1] {
                   int(range 0..63) key_id;
                   string key;
          }
      }
 }

Questions:
1. Why do we need to have two(max) key items if "key-chain" is not implemented? I presume, control node implemented only authentication-key but not authentication-key-chains. Can I always assume that there is only one key present in auth data when it comes to programming MX?

2. XML Schema construct <sequence> is useless in this case since there is only only type of element present under the sequence.

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : master

Review in progress for https://review.opencontrail.org/9889
Submitter: Suresh Balineni (<email address hidden>)

Revision history for this message
Suresh Balineni (sbalineni) wrote :
Download full text (3.7 KiB)

When user configures BGP Router Md5 auth info in contrail config, device manager constructs MX config stanzas and push to MX Routers:

Generated MX config will be in this format:
    <configuration junos:changed-seconds="1430780427" junos:changed-localtime="2015-05-04 23:00:27 UTC">
            <protocols>
                <bgp>
                    <group>
                        <name>bgp1</name>
                        <authentication-key>$9$7w-dsg4Zji.8X</authentication-key>
                        <neighbor>
                            <name>20.0.0.0</name>
                            <authentication-key>$9$7O-dsaZj.fzs2qm5FAt1RhSlM-dsYgJ-V</authentication-key>
                        </neighbor>
                    </group>
                </bgp>
            </protocols>
    </configuration>

Generated MX Config for BGP Protocol will be something like this depending on the config parameters:

<?xml version="1.0"?>
<config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
    <configuration>
        <groups operation="replace">
            <name>__contrail__</name>
            <protocols>
                <bgp>
                    <group operation="replace">
                        <name>__contrail__</name>
                        <type>internal</type>
                        <multihop/>
                        <local-address>10.1.1.1</local-address>
                        <family>
                            <route-target/>
                            <inet-vpn>
                                <unicast/>
                            </inet-vpn>
                            <evpn>
                                <signaling/>
                            </evpn>
                            <inet6-vpn>
                                <unicast/>
                            </inet6-vpn>
                        </family>
                        <authentication-key>bgppswd</authentication-key>
                        <keep>all</keep>
                        <neighbor>
                            <name>20.2.2.2</name>
                            <family>
                                <route-target/>
                                <inet-vpn>
                                    <unicast/>
                                </inet-vpn>
                                <evpn>
                                    <signaling/>
                                </evpn>
                            </family>
                            <authentication-key>bgppswd-neigh</authentication-key>
                        </neighbor>
                    </group>
                    <group operation="replace">
                        <name>__contrail_external__</name>
                        <type>external</type>
                        <multihop/>
                        <local-address>10.1.1.1</local-address>
                        <family>
                            <route-target/>
                            <inet-vpn>
                                <unicast/>
                            </inet-vpn>
                            <evpn>
                                <signaling/>
                            </evpn>
                            <inet6-vpn>
      ...

Read more...

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote :

Review in progress for https://review.opencontrail.org/9889
Submitter: Suresh Balineni (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : R2.20

Review in progress for https://review.opencontrail.org/9966
Submitter: Suresh Balineni (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : master

Review in progress for https://review.opencontrail.org/9889
Submitter: Suresh Balineni (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/9966
Committed: http://github.org/Juniper/contrail-controller/commit/9354f1f64844ebcf6204332f9fb29e6d049ee900
Submitter: Zuul
Branch: R2.20

commit 9354f1f64844ebcf6204332f9fb29e6d049ee900
Author: sbalineni <email address hidden>
Date: Tue May 5 16:39:31 2015 -0700

Configure BGP MD5 authentication key on Physical Routers

Mapping:
BgpRouter.BgpRouterParameters.AuthData => bgp.group.authentication-key
BgpRouter.BgpSessionAttributes.AuthData => bgp.group.neighbour.authentication-key

Closes-Bug: #1449793

Change-Id: I3fb7d22c3d48be86972426e8436c7e9381b768cc

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : master

Review in progress for https://review.opencontrail.org/9889
Submitter: Suresh Balineni (<email address hidden>)

Revision history for this message
OpenContrail Admin (ci-admin-f) wrote : A change has been merged

Reviewed: https://review.opencontrail.org/9889
Committed: http://github.org/Juniper/contrail-controller/commit/e49f0669a02cba8218f29a4165f886c54c47e9ac
Submitter: Zuul
Branch: master

commit e49f0669a02cba8218f29a4165f886c54c47e9ac
Author: sbalineni <email address hidden>
Date: Mon May 4 15:56:19 2015 -0700

Configure BGP MD5 authentication key on Physical Routers

Mapping:
BgpRouter.BgpRouterParameters.AuthData => bgp.group.authentication-key
BgpRouter.BgpSessionAttributes.AuthData => bgp.group.neighbour.authentication-key

Closes-Bug: #1449793

Change-Id: I05aa73a307a03b82343bd4e962f720018d478d84

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.