huawei-bgp-common

Inter-AS routing protocol that exchanges Network Layer Reachability Information (NLRI) with other BGP systems.

  • Version: 2021-08-11

    huawei-bgp-common@2021-08-11


    
      submodule huawei-bgp-common {
    
        yang-version 1;
    
        belongs-to huawei-bgp {
            prefix bgp;
        }
    
        import ietf-inet-types {
          prefix inet;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-routing-policy {
          prefix rtp;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import huawei-acl {
          prefix acl;
        }
        import huawei-xpl {
          prefix xpl;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-ssl {
          prefix ssl;
        }
    
        include huawei-bgp-type;
    
        organization
          "Huawei Technologies Co., Ltd.";
    
        contact
          "Huawei Industrial Base
        Bantian, Longgang
        Shenzhen 518129
        People's Republic of China
        Website: http://www.huawei.com
        Email: support@huawei.com";
    
        description
          "Inter-AS routing protocol that exchanges Network Layer Reachability Information (NLRI) with other BGP systems.";
    
        revision "2021-08-11" {
          description
            "The YANG descriptions are modified according to new standards.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-03-22" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
    
        grouping peer-timer-para-type {
          description "BGP timer.";
          container timer {
            description
              "Configure BGP peer timer parameters.";
            leaf keep-alive-time {
              type uint32 {
                range "0..21845";
              }
              units "s";
              must
                "(../keep-alive-time != 0 and (../hold-time>=../keep-alive-time * 3) and ../hold-time != ../keep-alive-time ) or (../hold-time = 0 and ../keep-alive-time = 0)";
              default "60";
              description
                "If the value of a timer changes, the BGP peer relationship between the routers is disconnected. This is because the peers need to re-negotiate the Keepalive time and hold time. Therefore, confirm the action before you change the value of the timer. The Keepalive time should be at least three times of the hold time.";
            }
    
            leaf hold-time {
              type uint32 {
                range "0 | 3..65535";
              }
              units "s";
              must
                "(((../hold-time>=../keep-alive-time * 3) and ../hold-time != ../keep-alive-time ) or (../hold-time = 0 and ../keep-alive-time = 0)) and ../hold-time>=../min-hold-time";
              default "180";
              description
                "Hold time. When setting keepalive-time and hold-time, note the following:
              1. The values of keepalive-time and hold-time cannot both be 0. Otherwise, the BGP timer becomes invalid. That is, BGP does not detect link faults according to the timer.
              2. The value of hold-time is much greater than that of keepalive-time, such as, keepalive 1 and hold 65535. If the value of hold-time is too large, BGP cannot detect link faults timely.
              The priority of a timer is lower than that of a peer timer.
              After a connection is established between peers, the values of keepalive-time and hold-time are negotiated by the peers. The smaller value of hold-time contained in Open packets of both peers is taken as the value of hold-time. The smaller value of the locally set value of keepalive-time and one third of the value of hold-time is taken as the value of keepalive-time.";
            }
    
            leaf min-hold-time {
              type uint32 {
                range "0 | 20..65535";
              }
              units "s";
              must
                "../hold-time>=../min-hold-time";
              default "0";
              description
                "The default value of zero means that the minimum hold time check does not take effect. If the value is changed, the new value takes effect since the next peer relationship establishment. During the peer relationship establishment, the local device checks the hold time of the remote end. If the hold time is less than the minimum hold time, the local device sends an error packet with error code 02 and subcode 06, and the peer relationship fails to be established.";
            }
    
            leaf connect-retry-time {
              type uint16 {
                range "1..65535";
              }
              units "s";
              default "32";
              description
                "ConnectRetry interval.";
            }
          }  // container timer
        }  // grouping peer-timer-para-type
    
        grouping fake-as-type {
          description "BGP fake-as.";
          leaf fake-as {
            type as-number-validate;
            description
              "Fake AS number that is specified for a local peer. By default, a peer uses the actual AS number of the local end.
            An AS number can be in either two-byte format or four-byte format:
            The two-byte format is X. X is an integer ranging from 1 to 65535.
            The four-byte format is X.Y and X. When the format is X.Y, X and Y are both integers, with the value of X ranging from 1 to 65535, and the value of Y ranging from 0 to 65535; when the format is X, X is an interger, with the value of X ranging from 1 to 4294967295.";
          }
    
          leaf dual-as {
            when "../fake-as";
            type boolean;
            default "false";
            description
              "Enable/disable the function to the remote EBGP peer can use the actual or fake AS number when specifying the AS number for a local peer. The local peer uses the fake and actual AS numbers to establish a BGP peer relationship with the remote end and identifies the AS number configured by the remote end through the error code (OPEN Message Error) and sub-error code (Bad Peer AS) of the Notification message from the remote end.";
          }
    
          leaf prepend-global-as {
            when "../fake-as";
            type boolean;
            default "false";
            description
              "Enable/disable the function to add the global AS number to the update packets to be advertised.";
          }
    
          leaf prepend-fake-as {
            when "../fake-as";
            type boolean;
            default "false";
            description
              "Enable/disable the function to add the fake AS number to received update packets.";
          }
        }  // grouping fake-as-type
    
        grouping route-filter-type {
          description
            "The route filter configuration.";
          leaf filter-name {
            type leafref {
              path
                "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name";
            }
            description
              "Specify a route-filter name.";
          }
    
          leaf filter-parameter {
            when "../filter-name";
            type xpl:filter-parameter-type;
            description
              "Specify a route-filter parameter.";
          }
        }  // grouping route-filter-type
    
        grouping default-route-advertise-type {
          description
            "The default-route-advertise-type configuration.";
          leaf default-route-advertise {
            type boolean;
            default "false";
            description
              "Enable/disable a device to advertise the default route to its peers. This option enables a device to send a default route with the device as the next hop address to its peers, regardless of whether there is a default route in the local routing table.";
          }
    
          choice default-route-advertise-policy-type {
            description
              "Set default route advertise-policy.";
            case rtp-ref {
              description
                "The default-route-advertise-policy.";
              leaf default-route-advertise-policy {
                when
                  "../default-route-advertise='true'";
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the name of a used policy.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description
                "The default-route-advertise-filter.";
              container default-route-advertise-filter {
                when
                  "../default-route-advertise='true'";
                description
                  "Configure the route-filter for default route advertise.";
                uses route-filter-type;
              }  // container default-route-advertise-filter
            }  // case xpl-ref
          }  // choice default-route-advertise-policy-type
        }  // grouping default-route-advertise-type
    
        grouping ip-prefix-filter-type {
          description
            "IPv4 prefix filter type configuration.";
          leaf import-ip-prefix {
            type leafref {
              path
                "/rtp:routing-policy/rtp:ipv4-prefix-filters/rtp:ipv4-prefix-filter/rtp:name";
            }
            description
              "Specify the IPv4 filtering policy applied to the routes received from a specified peer. By default, no such policy is specified.";
          }
    
          leaf export-ip-prefix {
            type leafref {
              path
                "/rtp:routing-policy/rtp:ipv4-prefix-filters/rtp:ipv4-prefix-filter/rtp:name";
            }
            description
              "Specify the IPv4 filtering policy applied to the routes to be advertised to a specified peer. By default, no such policy is specified.";
          }
        }  // grouping ip-prefix-filter-type
    
        grouping ipv6-prefix-filter-type {
          description
            "IPv6 prefix filter type configuration.";
          leaf import-ipv6-prefix {
            type leafref {
              path
                "/rtp:routing-policy/rtp:ipv6-prefix-filters/rtp:ipv6-prefix-filter/rtp:name";
            }
            description
              "Specify the IPv6 filtering policy applied to the routes received from a specified peer. By default, no such policy is specified.";
          }
    
          leaf export-ipv6-prefix {
            type leafref {
              path
                "/rtp:routing-policy/rtp:ipv6-prefix-filters/rtp:ipv6-prefix-filter/rtp:name";
            }
            description
              "Specify the IPv6 filtering policy applied to the routes to be advertised to a specified peer. By default, no such policy is specified.";
          }
        }  // grouping ipv6-prefix-filter-type
    
        grouping route-limit-accept-type {
          description
            "BGP route limit configuration options.";
          container route-limit {
            description
              "Configure parameters of routes limited from this peer.";
            leaf number {
              type uint32 {
                range "1..4294967295";
              }
              description
                "Configure the maximum number of routes that can be accepted from a peer.";
            }
    
            leaf accept-prefix {
              when "../number";
              type boolean;
              default "false";
              description
                "Enable/disable the device to keep receiving routes and the routes are valid if the maximum number of routes allowed have been received and the alert-only parameter is specified.";
            }
    
            leaf percent {
              when "../number";
              type uint8 {
                range "1..100";
              }
              default "75";
              description
                "Specify the percentage of routes when a router starts to generate an alarm.";
            }
    
            leaf type {
              when "../number";
              type route-limit-type;
              must
                "(../type='idle-timeout' and ../idle-timeout) or (../type!='idle-timeout')";
              default "noparameter";
              description
                "Set the processing method as alert-only, idle-forever, or idle-timeout when the number of routes exceeds the set threshold. When alert-only is used, only an alarm is generated when the number of routes exceeds the threshold. In this case, new routes are no longer accepted. When idle-forever is used, connections are not automatically reestablished after being cut off until BGP connections are reset if the number of routes exceeds the set threshold. When idle-timeout is used and the idle-timeout timer is specified, the connections are automatically reestablished after being cut off if the number of routes exceeds the set threshold. You can reset BGP connections to reestablish the connections before the idle-timeout times expires.";
            }
    
            leaf idle-timeout {
              when "../type='idle-timeout'";
              type uint16 {
                range "1..1200";
              }
              units "min";
              description
                "Specify the value of the idle-timeout timer to automatically reestablish the connections after they are cut off when the number of routes exceeds the set threshold.";
            }
          }  // container route-limit
        }  // grouping route-limit-accept-type
    
        grouping public-as-only-type {
          description
            "BGP Remove private AS number from outbound updates configuration options.";
          container public-as-only {
            description
              "Configure BGP Remove private AS number from outbound updates parameters.";
            leaf enable {
              type boolean;
              default "false";
              description
                "Enable/disable BGP to send Update packets carrying only public AS numbers.";
            }
    
            choice remove-private-as {
              description
                "Remove AS numbers except peer AS number from outbound updates.";
              case all {
                description
                  "Remove all private AS numbers.";
                leaf force {
                  when "../enable='true'";
                  type empty;
                  description
                    "Configures BGP to carry only the public AS number instead of the private AS number when BGP sends Update packets. By default, BGP can carry the private AS number when BGP sends Update packets.";
                }
              }  // case all
    
              case left-most {
                description
                  "Remove the left-most private AS numbers.";
                leaf limited {
                  when "../enable='true'";
                  type empty;
                  description
                    "When the BGP sends update packets, the left ends of both the local AS and public AS do not carry the private AS. By default, BGP can carry the private AS number when BGP sends Update packets.";
                }
              }  // case left-most
            }  // choice remove-private-as
    
            leaf replace {
              when "../force or ../limited";
              type boolean;
              default "false";
              description
                "Enable/disable the function to the private AS is replaced by the local AS when the BGP sends update packets.";
            }
    
            leaf no-skip-as {
              when "../force or ../limited";
              type boolean;
              default "false";
              description
                "Enable/disable the function to the neighbour AS is not processed when the BGP sends update packets.";
            }
          }  // container public-as-only
        }  // grouping public-as-only-type
    
        grouping group-public-as-only-import-type {
          description
            "BGP remove private AS number in received BGP update messages configuration options.";
          container public-as-only-import {
            description
              "Configure BGP remove private AS number in received BGP update messages parameters.";
            leaf enable {
              type boolean;
              default "false";
              description
                "Enable/disable BGP to receive update packets carrying only public AS numbers.";
            }
    
            choice remove-private-as {
              description
                "Remove private AS numbers in received BGP update messages.";
              case all {
                description
                  "Forcibly delete all the private AS numbers in the AS_Path list.";
                leaf force {
                  when "../enable = 'true'";
                  type empty;
                  description
                    "Enable a device to forcibly remove all the private AS numbers in received BGP update messages in which the AS_Path list contains private AS numbers. By default, a device does not remove private AS numbers from the AS_Path list when receiving BGP update messages.";
                }
              }  // case all
            }  // choice remove-private-as
          }  // container public-as-only-import
        }  // grouping group-public-as-only-import-type
    
        grouping peer-public-as-only-import-type {
          description
            "BGP remove private AS number in received BGP update messages configuration options.";
          container public-as-only-import {
            description
              "Configure BGP remove private AS number in received BGP update messages parameters.";
            leaf enable {
              type peer-comm-config-type;
              default "default";
              description
                "Enable/disable BGP to receive update packets carrying only public AS numbers.";
            }
    
            choice remove-private-as {
              description
                "Remove private AS numbers in received BGP update messages.";
              case all {
                description
                  "Forcibly delete all the private AS numbers in the AS_Path list.";
                leaf force {
                  when "../enable = 'enable'";
                  type empty;
                  description
                    "Enable a device to forcibly remove all the private AS numbers in received BGP update messages in which the AS_Path list contains private AS numbers. By default, a device does not remove private AS numbers from the AS_Path list when receiving BGP update messages.";
                }
              }  // case all
            }  // choice remove-private-as
    
            leaf effect-enable {
              type boolean;
              config false;
              description
                "Flag indicating that the device is enabled to remove private AS numbers from the AS_Path list in received BGP update messages.";
            }
    
            leaf effect-force {
              type boolean;
              config false;
              description
                "Flag indicating that the device is enabled to forcibly remove all the private AS numbers from the AS_Path list in received BGP update messages.";
            }
          }  // container public-as-only-import
        }  // grouping peer-public-as-only-import-type
    
        grouping as-path-filter-type {
          description
            "AS-path-filter-type configuration.";
          leaf import-as-path-filter {
            type leafref {
              path
                "/rtp:routing-policy/rtp:as-path-filters/rtp:as-path-filter/rtp:name";
            }
            description
              "Apply an AS_Path-based filtering policy to the routes received from a specified peer. The policy can be identified with a name or number, and the number ranges from 1 to 256. By default, no such policy is specified. Therefore, all BGP routes can be accepted.";
          }
    
          leaf export-as-path-filter {
            type leafref {
              path
                "/rtp:routing-policy/rtp:as-path-filters/rtp:as-path-filter/rtp:name";
            }
            description
              "Apply an AS_Path-based filtering policy to the routes to be advertised to a specified peer. The policy can be identified with a name or number, and the number ranges from 1 to 256. By default, no such policy is specified. Therefore, all BGP routes can be advertised.";
          }
        }  // grouping as-path-filter-type
    
        grouping ipv4-default-route-match-conditions-type {
          description
            "IPv4 default route matching condition configuration.";
          container default-route-match-conditions {
            when
              "../default-route-match-mode and ../default-route-match-mode!='null'";
            description
              "List of condition matching to filter the default routes to be advertised. The value takes effect only when the default route matching mode is not null and more than one IPv4 default route matching condition lists are configured.";
            list default-route-match-condition {
              key "address mask";
              min-elements 1;
              max-elements 4;
              description
                "Configure the matching condition for default route advertisement.";
              leaf address {
                type inet:ipv4-address-no-zone;
                description
                  "Configure a prefix that is used to match default routes.";
              }
    
              leaf mask {
                type uint32 {
                  range "0..32";
                }
                description
                  "Configure a mask that is used to match default routes.";
              }
            }  // list default-route-match-condition
          }  // container default-route-match-conditions
        }  // grouping ipv4-default-route-match-conditions-type
    
        grouping ipv6-default-route-match-conditions-type {
          description
            "IPv6 default route matching condition configuration.";
          container default-route-match-conditions {
            when
              "../default-route-match-mode and ../default-route-match-mode!='null'";
            description
              "List of condition matching to filter the default routes to be advertised. The value takes effect only when the default route matching mode is not null and more than one IPv6 default route matching condition lists are configured.";
            list default-route-match-condition {
              key "address mask";
              min-elements 1;
              max-elements 4;
              description
                "Configure the matching condition for default route advertisement.";
              leaf address {
                type inet:ipv6-address-no-zone;
                description
                  "Configure a IPv6-prefix that is used to match default routes.";
              }
    
              leaf mask {
                type uint32 {
                  range "0..128";
                }
                description
                  "Configure a mask that is used to match default routes.";
              }
            }  // list default-route-match-condition
          }  // container default-route-match-conditions
        }  // grouping ipv6-default-route-match-conditions-type
    
        grouping path-attr-map-type {
          description
            "Config bit map of path attribute treat ID.";
          container path-attribute-treats {
            description
              "List of modes in which specified path attributes are processed.";
            list path-attribute-treat {
              must
                "discard-id-map or withdraw-id-map or unknown-id-map";
              key "treat-type";
              description
                "Configure mode in which specified path attributes are processed.";
              leaf treat-type {
                type path-attr-treat-type;
                description
                  "Mode in which specified path attributes are processed.";
              }
    
              leaf discard-id-map {
                type pub-type:id-range {
                  pattern
                    '((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])?(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?(,((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?))*)|((([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\)))?(,(([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\))))*)';
                }
                description
                  "Specify a discard attribute ID list. The attribute IDs which are not supported as follows: 1 (ORIGIN), 2 (AS_PATH), 3 (NEXT_HOP), 4 (MED), 5 (LOCAL_PREF), 6 (ATOMICAGGREGATE), 7 (AGGREGATOR), 8 (COMMUNITY), 9 (ORIGINATOR_ID), 10 (CLUSTER_LIST), 14 (MP_REACH_NLRI), 15 (MP_UNREACH_NLRI), 17 (AS4PATH), 18 (AS4AGGREGATOR).";
              }
    
              leaf withdraw-id-map {
                type pub-type:id-range {
                  pattern
                    '((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])?(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?(,((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?))*)|((([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\)))?(,(([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\))))*)';
                }
                description
                  "Specify a withdraw attribute ID list. The attribute IDs which are not supported as follows: 1 (ORIGIN), 2 (AS_PATH), 3 (NEXT_HOP), 4 (MED), 5 (LOCAL_PREF), 6 (ATOMICAGGREGATE), 7 (AGGREGATOR), 8 (COMMUNITY), 9 (ORIGINATOR_ID), 10 (CLUSTER_LIST), 14 (MP_REACH_NLRI), 15 (MP_UNREACH_NLRI), 17 (AS4PATH), 18 (AS4AGGREGATOR).";
              }
    
              leaf unknown-id-map {
                type pub-type:id-range {
                  pattern
                    '((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])?(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?(,((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))?))*)|((([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\)))?(,(([\+|\-](25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9]))|([\+|\-]\((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])-(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\))))*)';
                }
                description
                  "Specify an unknown attribute ID list. The attribute IDs which are not supported as follows: 1 (ORIGIN), 2 (AS_PATH), 3 (NEXT_HOP), 4 (MED), 5 (LOCAL_PREF), 6 (ATOMICAGGREGATE), 7 (AGGREGATOR), 8 (COMMUNITY), 9 (ORIGINATOR_ID), 10 (CLUSTER_LIST), 14 (MP_REACH_NLRI), 15 (MP_UNREACH_NLRI), 17 (AS4PATH), 18 (AS4AGGREGATOR).";
              }
            }  // list path-attribute-treat
          }  // container path-attribute-treats
        }  // grouping path-attr-map-type
    
        grouping authentication-attr-type {
          description
            "Authentication attribute type configuration.";
          leaf password-type {
            type password-type;
            must
              "not((../password-type and ../password-type!='null') and (../key-chain-name or ../tcp-ao-name))";
            must
              "(not(../password-type and ../password-type!='null') and not(../password-text)) or (../password-type and ../password-type!='null' and ../password-text)";
            default "null";
            description
              "Enable BGP peers to establish a TCP connection and perform the Message Digest 5 (MD5) authentication for BGP messages. Plaintexts and ciphertexts are supported.";
          }
    
          leaf password-text {
            when
              "../password-type and ../password-type!='null'";
            type pub-type:password-extend;
            mandatory true;
            description
              "Enable BGP peers to establish a TCP connection and perform the Message Digest 5 (MD5) authentication for BGP messages. The character string in a password identifies the contents of the password, spaces not supported. The TCP connection can be established only when the same MD5 authentication password is set on both ends. If a plaintext is used, the maximum password length is 255. If a ciphertext is used, the maximum password length is 432. If the length is set to 0, no password is set.";
          }
    
          leaf key-chain-name {
            ext:case-sensitivity "lower-only";
            type string {
              length "1..47";
              pattern '[^A-Z]+';
            }
            must
              "not(../password-type!='null' or ../tcp-ao-name)";
            description
              "Specify the Keychain authentication name used when BGP peers establish a TCP connection. The value is a string, spaces not supported. By default, the Keychain authentication is not configured. Keychain authentication mode and password authentication mode are mutually exclusive. Configuring Keychain authentication can enhance the security of the TCP connections between BGP peers. Keychain authentication using the same encryption algorithm and password must be configured on the two ends of BGP peers to establish a TCP connection and exchange BGP packets. Before configuring BGP Keychain authentication, you need to configure Keychain according to keychain name. Otherwise, the TCP connections between the BGP peers cannot be established.";
          }
        }  // grouping authentication-attr-type
    
        grouping choice-policy-set {
          description
            "Specify the route-policy or filter for imported RIBs.";
          choice policy-type {
            description "Set policy or filter.";
            case rtp-ref {
              description
                "Specify the route policy.";
              leaf policy-name {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the route policy.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice policy-type
        }  // grouping choice-policy-set
    
        grouping ingress-choice-policy-set {
          description
            "Specify the route-policy or filter for ingress LSPs.";
          choice ingress-trigger-policy {
            description
              "Specify the route-policy or filter for ingress LSPs.";
            case trigger-route-policy-ref {
              description "Route policy.";
              leaf trigger-route-policy {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the name of a routing policy.";
              }
            }  // case trigger-route-policy-ref
    
            case trigger-xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case trigger-xpl-ref
          }  // choice ingress-trigger-policy
        }  // grouping ingress-choice-policy-set
    
        grouping safi-lsp-options {
          description
            "Parameters relating to options for lsp.";
          leaf ingress-protect-mode-bgp-frr {
            type boolean;
            must
              "(../ingress-protect-mode-bgp-frr='false') or (../ingress-protect-mode-bgp-frr='true' and ../maximum-load-balancing-ingress=1)";
            default "false";
            description
              "Enable/disable ingress LSP protection mode to FRR.";
          }
    
          leaf maximum-load-balancing-ingress {
            type uint16 {
              range "1..65535";
            }
            default "1";
            description
              "Maximum number of ingress LSPs for load balancing. The default value is 1, indicating that this attribute is not configured. Configuring the number of ingress LSPs for load balancing and configuring BGP FRR of ingress LSPs are mutually exclusive.";
          }
        }  // grouping safi-lsp-options
    
        grouping global-timer-para-type {
          description "BGP timer.";
          leaf connect-retry-time {
            type uint16 {
              range "1..65535";
            }
            units "s";
            default "32";
            description "ConnectRetry interval.";
          }
    
          leaf keep-alive-time {
            type uint32 {
              range "0..21845";
            }
            units "s";
            must
              "(../keep-alive-time != 0 and (../hold-time>=../keep-alive-time * 3) and ../hold-time != ../keep-alive-time ) or (../hold-time = 0 and ../keep-alive-time = 0)";
            default "60";
            description
              "Specify the Keepalive time of a peer or peer group. The value is an integer. If the value of a timer changes, the peers need to re-negotiate the interval value for the keepalive-time and hold-time. This disconnects the BGP peer relationship between the routers. Therefore, you need to double check whether it is a must to change the value of the timer. Ensure that the hold time is at least three times longer than the keepalive time when you configure the BGP timer.";
          }
    
          leaf hold-time {
            type uint32 {
              range "0 | 3..65535";
            }
            units "s";
            must
              "(((../hold-time>=../keep-alive-time * 3) and ../hold-time != ../keep-alive-time ) or (../hold-time = 0 and ../keep-alive-time = 0)) and ../hold-time>=../min-hold-time";
            default "180";
            description
              "Specify the Hold time of a peer or peer group. When setting the timer values of keepalive-time and hold-time, avoid the following settings: 1.The interval values of keepalive-time and hold-time are both set to 0. This will cause BGP timer to become invalid, and BGP will not detect link faults based on the timer.
            2. The interval value of hold-time is much greater than that of keepalive-time. For example, the interval value of keepalive-time is 1, and that of hold-time is 65535. If the interval value of hold-time is too large, BGP will not be able to detect link faults in time. The priority of the timer configured here is lower than that of timer configured with interval values of keepalive-time and hold-time of a peer. After a connection is established between peers, the interval values of keepalive-time and hold-time are negotiated by the peers. The smaller interval value of hold-time contained in Open packets of both peers is taken as the interval value of hold-time. The smaller interval value of one third of the interval value of hold-time and the locally set interval value of keepalive-time is taken as the interval value of keepalive-time.";
          }
    
          leaf min-hold-time {
            type uint32 {
              range "0 | 20..65535";
            }
            units "s";
            must
              "../hold-time>=../min-hold-time";
            default "0";
            description
              "The default value of zero means that the minimum hold time check does not take effect. If the value is changed, the new value takes effect since the next peer relationship establishment. During the peer relationship establishment, the local device checks the hold time of the remote end. If the hold time is less than the minimum hold time, the local device sends an error packet with error code 02 and subcode 06, and the peer relationship fails to be established.";
          }
        }  // grouping global-timer-para-type
    
        grouping default-route-originate-type {
          description
            "The default-route-originate-type configuration.";
          list default-route-originate {
            key "vpn-name";
            description
              "Configure advertised default VPNv4 route.";
            leaf vpn-name {
              type leafref {
                path
                  "/ni:network-instance/ni:instances/ni:instance/ni:name";
              }
              must "../vpn-name!='_public_'";
              description
                "VPN instance name. It uniquely identifies a VPN instance. The name is a string of case-sensitive characters.";
            }
          }  // list default-route-originate
        }  // grouping default-route-originate-type
    
        grouping import-routes-type {
          description
            "Imported routes configuration.";
          leaf protocol {
            type ipv4-import-route-protocol-type;
            description
              "Routing protocol from which routes can be imported.";
          }
    
          leaf process-id {
            type uint32 {
              range "0..4294967295";
            }
            must
              "((../protocol='ospf' or ../protocol='isis' or ../protocol='rip') and ../process-id!=0) or (../protocol!='ospf' and ../protocol!='isis' and ../protocol!='rip' and ../process-id=0)";
            description
              "Process ID of an imported routing protocol. The process ID is 0, if the imported routing protocol is direct routes, static routes, UNRs, or OP-routes. The process ID must be specified range from 1 to 4294967295, if the imported routing protocol is RIP, OSPF, ISIS.";
          }
    
          leaf med {
            type uint32;
            description
              "Specifies the MED metric of the imported route.";
          }
    
          choice policy-type {
            description
              "Set route policy or filter.";
            case rtp-ref {
              description "Route policy.";
              leaf policy-name {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "When routes are imported from other routing protocols, the route-policy filter can be used to filter the routes and change route attributes.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice policy-type
        }  // grouping import-routes-type
    
        grouping rt-update-interval-type {
          description
            "Route update interval configuration.";
          leaf route-update-interval {
            ext:dynamic-default;
            type uint16 {
              range "0..600";
            }
            units "s";
            description
              "Specify the minimum interval at which Update packets are sent. By default, the interval at which Update packets are sent to IBGP peers is 15s, 
            and the interval at which Update packets are sent to EBGP peers is 30s. When routes change, a router will send Update packets to notify its peers. 
            If a route changes frequently, you can set an interval at which Update packets are sent to prevent the router from sending Update packets each time the route changes. 
            This configuration is valid only to the routes learned from peers.";
          }
        }  // grouping rt-update-interval-type
    
        grouping bgp-route-preference-options {
          description
            "Configuration parameters relating to the BGP routes preference.";
          container preference {
            description
              "Configure parameters relating to options for BGP routes preference.";
            choice set-value-or-policy {
              default "set-value";
              description
                "Set BGP routes preference by value or policy.";
              case set-value {
                description
                  "Set BGP routes preference by value.";
                leaf external {
                  type uint8 {
                    range "1..255";
                  }
                  default "255";
                  description
                    "Set the protocol priority of EBGP routes. The value is an integer. An EBGP route is the optimal route learned from a peer outside the local AS.";
                }
    
                leaf internal {
                  type uint8 {
                    range "1..255";
                  }
                  default "255";
                  description
                    "Set the protocol priority of IBGP routes. The value is an integer. An IBGP route is a route learned from a peer inside the local AS.";
                }
    
                leaf local {
                  type uint8 {
                    range "1..255";
                  }
                  default "255";
                  description
                    "Set the protocol priority of a local BGP route. A local route refers to an automatically or manually summarized route.";
                }
              }  // case set-value
    
              case rtp-ref {
                description
                  "Set BGP routes preference by route policy.";
                leaf route-policy {
                  type leafref {
                    path
                      "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                  }
                  description
                    "Specify a routing policy to filter routes so that a configured priority is applied to the routes that match the specified policy.";
                }
              }  // case rtp-ref
    
              case xpl-ref {
                description "Route filter.";
                uses route-filter-type;
              }  // case xpl-ref
            }  // choice set-value-or-policy
          }  // container preference
        }  // grouping bgp-route-preference-options
    
        grouping dampening-route-config {
          description
            "The dampening route type.";
          leaf half-life-time {
            type uint16 {
              range "1..45";
            }
            units "min";
            default "15";
            description
              "Configure a half-life for reachable routes.";
          }
    
          leaf reuse {
            type uint16 {
              range "1..20000";
            }
            default "750";
            description
              "Configure a threshold for a route to be unsuppressed. If the penalty value of the route falls below the threshold, the route is reused.";
          }
    
          leaf suppress {
            type uint16 {
              range "1..20000";
            }
            default "2000";
            description
              "Configure a threshold for a route to be suppressed. When the penalty value of the route exceeds the suppression threshold, the route is suppressed. The configured suppression threshold must be greater than the reuse threshold.";
          }
    
          leaf ceiling {
            type uint16 {
              range "1001..20000";
            }
            default "16000";
            description
              "Configure the penalty ceiling. The configured threshold must be greater than the suppression threshold.";
          }
    
          leaf update-standard {
            type boolean;
            default "false";
            description
              "Enable/disable update standard.";
          }
    
          choice policy-type {
            description
              "Set route-policy or route-filter.";
            case rtp-ref {
              description "Route policy.";
              leaf route-policy {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the name of a routing policy.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice policy-type
        }  // grouping dampening-route-config
    
        grouping vrf-af-dampening-routes-ext {
          description
            "Parameters related to the use of dampening routes.";
          container dampening-routes {
            description
              "List of route dampening.";
            list dampening-route {
              must
                "reuse < suppress and suppress < ceiling";
              key "peer-type";
              description
                "Configure BGP route dampening or modify various BGP route dampening parameters. If a suppression policy for route dampening is configured, routes are preferentially matched against the suppression parameters defined in the suppression policy. If no parameter is configured, the default value of each parameter is used. The four route dampening parameters are mutually dependent. If you configure one of the parameters, the other parameters also need to be configured. When you configure BGP route dampening, the values of reuse threshold, suppress threshold, and penalty ceiling must meet the inequality of reuse threshold < suppress threshold < penalty ceiling. If Maximum suppression time obtained by using the formula of Maximum suppression time = Half life (of reachable routes) x 60 x (ln (Penalty ceiling/Reuse threshold)/ln(2)) is smaller than 1, suppression cannot be performed. Ensure that the value of the maximum suppression time is equal to or greater than 1. This means that the value of the penalty ceiling/reuse threshold must be great enough.";
              leaf peer-type {
                type dampening-route-ext-peer-type;
                description
                  "Configure the peer type.";
              }
    
              uses dampening-route-config;
            }  // list dampening-route
          }  // container dampening-routes
        }  // grouping vrf-af-dampening-routes-ext
    
        grouping vrf-af-dampening-routes {
          description
            "Parameters related to the use of dampening routes.";
          container dampening-routes {
            description
              "List of route dampening.";
            list dampening-route {
              must
                "reuse < suppress and suppress < ceiling";
              key "peer-type";
              description
                "Configure BGP route dampening or modify various BGP route dampening parameters. If a suppression policy for route dampening is configured, routes are preferentially matched against the suppression parameters defined in the suppression policy. If no parameter is configured, the default value of each parameter is used. The four route dampening parameters are mutually dependent. If you configure one of the parameters, the other parameters also need to be configured. When you configure BGP route dampening, the values of reuse threshold, suppress threshold, and penalty ceiling must meet the inequality of reuse threshold < suppress threshold < penalty ceiling. If Maximum suppression time obtained by using the formula of Maximum suppression time = Half life (of reachable routes) x 60 x (ln (Penalty ceiling/Reuse threshold)/ln(2)) is smaller than 1, suppression cannot be performed. Ensure that the value of the maximum suppression time is equal to or greater than 1. This means that the value of the penalty ceiling/reuse threshold must be great enough.";
              leaf peer-type {
                type dampening-route-peer-type;
                description
                  "Configure the peer type.";
              }
    
              uses dampening-route-config;
            }  // list dampening-route
          }  // container dampening-routes
        }  // grouping vrf-af-dampening-routes
    
        grouping preferred-value-type {
          description
            "Route update interval configuration.";
          leaf preferred-value {
            type uint32 {
              range "0..65535";
            }
            default "0";
            description
              "Assign a preferred value for the routes learned from a specified peer. After a preferred value is configured for the routes learned from a specified peer,
            all the routes that learnt from this peer will use this preferred value. When multiple routes reach the same address prefix, the route with the largest preferred value will be selected.";
          }
        }  // grouping preferred-value-type
    
        grouping route-limit-type {
          description
            "BGP route limit configuration options.";
          container route-limit {
            description
              "Configure parameters of routes limited from this peer.";
            leaf number {
              type uint32 {
                range "1..4294967295";
              }
              description
                "Configure the maximum number of routes that can be accepted from a peer.";
            }
    
            leaf percent {
              when "../number";
              type uint8 {
                range "1..100";
              }
              default "75";
              description
                "Specify the percentage of routes when a router starts to generate an alarm.";
            }
    
            leaf type {
              when "../number";
              type route-limit-type;
              must
                "(../type='idle-timeout' and ../idle-timeout) or (../type!='idle-timeout')";
              default "noparameter";
              description
                "Set the processing method as alert-only, idle-forever, or idle-timeout when the number of routes exceeds the set threshold. When alert-only is used, only an alarm is generated when the number of routes exceeds the threshold. In this case, new routes are no longer accepted. When idle-forever is used, connections are not automatically reestablished after being cut off until BGP connections are reset if the number of routes exceeds the set threshold. When idle-timeout is used and the idle-timeout timer is specified, the connections are automatically reestablished after being cut off if the number of routes exceeds the set threshold. You can reset BGP connections to reestablish the connections before the idle-timeout times expires.";
            }
    
            leaf idle-timeout {
              when "../type='idle-timeout'";
              type uint16 {
                range "1..1200";
              }
              units "min";
              description
                "Specify the value of the idle-timeout timer to automatically reestablish the connections after they are cut off when the number of routes exceeds the set threshold.";
            }
          }  // container route-limit
        }  // grouping route-limit-type
    
        grouping vpn-brief-num-type {
          description
            "BGP vpn brief statistics information.";
          leaf peer-number {
            type uint32;
            description
              "Set the number of peers in a specified address family.";
          }
    
          leaf route-number {
            type uint32;
            description
              "Set the number of routes in a specified address family.";
          }
    
          leaf route-distinguisher-number {
            type uint32;
            description "Number of RDs.";
          }
        }  // grouping vpn-brief-num-type
    
        grouping bit-error-detection-type {
          description
            "BGP bit-error detection parameters.";
          container bit-error-detection {
            description
              "Configure BGP bit-error detection parameters.";
            leaf enable {
              type boolean;
              must
                "(../enable='false') or (../enable='true' and (../med or ../local-preference))";
              default "false";
              description
                "Enable/disable association between bit error events and the adjustment of route attributes.";
            }
    
            leaf med {
              when "../enable='true'";
              type uint32 {
                range "1..4294967295";
              }
              description
                "Specify the MED adjustment for BGP routes used when a bit error event occurs.";
            }
    
            leaf local-preference {
              when "../enable='true'";
              type uint32 {
                range "1..4294967295";
              }
              description
                "Specify the local preference adjustment for BGP routes used when a bit error event occurs.";
            }
    
            choice policy-type {
              when "enable='true'";
              description
                "Set route-policy or route-filter for bit-error-triggered protection switching.";
              case rtp-ref {
                description "Route policy.";
                leaf route-policy {
                  type leafref {
                    path
                      "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                  }
                  description
                    "Specify the name of route-policy for bit-error-triggered protection switching. The MED or local preference of only the routes that match the route-policy is adjusted.";
                }
              }  // case rtp-ref
    
              case xpl-ref {
                description "Route filter.";
                uses route-filter-type;
              }  // case xpl-ref
            }  // choice policy-type
          }  // container bit-error-detection
        }  // grouping bit-error-detection-type
    
        grouping nexthop-recursive-lookup-delay {
          description
            "Next hop change responding delay configuration.";
          container delay {
            description
              "Configure time of next hop change responding delay.";
            leaf time {
              type uint8 {
                range "1..100";
              }
              units "s";
              description
                "Specify the delay in responding to the next hop change.";
            }
    
            leaf no-critical-event-time {
              type uint8 {
                range "0..100";
              }
              units "s";
              default "10";
              description
                "Specify the delay in responding to the next hop change on non critical relay change event.";
            }
          }  // container delay
        }  // grouping nexthop-recursive-lookup-delay
    
        grouping nexthop-recursive-lookup-restrain {
          description
            "Next hop iteration restrain configuration.";
          leaf restrain {
            type boolean;
            default "true";
            description
              "Enable/disable the function to restrain next hop iteration in case of next hop flapping.";
          }
    
          choice policy-type {
            description
              "Set route-policy or route-filter.";
            case rtp-ref {
              description "Route policy.";
              leaf route-policy {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the name of a routing policy.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice policy-type
        }  // grouping nexthop-recursive-lookup-restrain
    
        grouping nexthop-recursive-lookup-default-route {
          description
            "Next hop iteration default route configuration.";
          leaf default-route {
            type boolean;
            default "false";
            description
              "Enable/disable default route.";
          }
        }  // grouping nexthop-recursive-lookup-default-route
    
        grouping ipv4-import-filter-protocol-policy-choice-type {
          description
            "IPv4 import filter protocol policy choice type configuration.";
          choice ipv4-import-filter-protocol-policy-type {
            description
              "Set IPv4 filter protocol policy.";
            case acl-ref {
              description "ACL Route Policy.";
              leaf acl-name-or-num {
                type leafref {
                  path
                    "/acl:acl/acl:groups/acl:group/acl:identity";
                }
                description
                  "Specify the name or number of an ACL Rule. The number value ranges from 2000 to 2999 and is used by basic ACL rules. The name must start with a letter, and the name is case-sensitive.";
              }
            }  // case acl-ref
    
            case ip-prefix-ref {
              description "IP prefix Policy.";
              leaf ipv4-prefix-filter {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:ipv4-prefix-filters/rtp:ipv4-prefix-filter/rtp:name";
                }
                description
                  "Specify the IPv4 prefix list name.";
              }
            }  // case ip-prefix-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice ipv4-import-filter-protocol-policy-type
        }  // grouping ipv4-import-filter-protocol-policy-choice-type
    
        grouping ipv6-filter-protocol-policy-choice-type {
          description
            "IPv6 filter protocol policy choice type configuration.";
          choice ipv6-filter-protocol-policy-type {
            mandatory true;
            description
              "Set IPv6 filter protocol policy.";
            case acl6-ref {
              description
                "The ACL Route Policy.";
              leaf acl6-name-or-num {
                type leafref {
                  path
                    "/acl:acl/acl:group6s/acl:group6/acl:identity";
                }
                description
                  "Specify the name or number of an ACL6 Rule. The number value ranges from 2000 to 2999 and is used by basic ACL6 rules. The name must start with a letter, and the name is case-sensitive.";
              }
            }  // case acl6-ref
    
            case ipv6-prefix-ref {
              description "IPv6 prefix Policy.";
              leaf ipv6-prefix-filter {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:ipv6-prefix-filters/rtp:ipv6-prefix-filter/rtp:name";
                }
                description
                  "Specify the IPv6 prefix list name.";
              }
            }  // case ipv6-prefix-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice ipv6-filter-protocol-policy-type
        }  // grouping ipv6-filter-protocol-policy-choice-type
    
        grouping ipv6-import-filter-protocol-policy-choice-type {
          description
            "IPv6 import filter protocol policy choice type configuration.";
          choice ipv6-import-filter-protocol-policy-type {
            description
              "Set IPv6 filter protocol policy.";
            case acl6-ref {
              description "ACL route policy.";
              leaf acl6-name-or-num {
                type leafref {
                  path
                    "/acl:acl/acl:group6s/acl:group6/acl:identity";
                }
                description
                  "Specify the name or number of an ACL6 Rule. The number value ranges from 2000 to 2999 and is used by basic ACL6 rules. The name must start with a letter, and the name is case-sensitive.";
              }
            }  // case acl6-ref
    
            case ipv6-prefix-ref {
              description "IPv6 prefix Policy.";
              leaf ipv6-prefix-filter {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:ipv6-prefix-filters/rtp:ipv6-prefix-filter/rtp:name";
                }
                description
                  "Specify the IPv6 prefix list name.";
              }
            }  // case ipv6-prefix-ref
    
            case xpl-ref {
              description "Route filter.";
              uses route-filter-type;
            }  // case xpl-ref
          }  // choice ipv6-import-filter-protocol-policy-type
        }  // grouping ipv6-import-filter-protocol-policy-choice-type
    
        grouping ipv4-import-filter-protocol-type {
          description
            "IPv4 import filter protocol type configuration.";
          container import-filter-policy {
            description
              "Configure a filtering policy. It is used to filter the routes received from a peer. By default, routes are not filtered.";
            uses ipv4-import-filter-protocol-policy-choice-type;
          }  // container import-filter-policy
        }  // grouping ipv4-import-filter-protocol-type
    
        grouping ipv6-import-filter-protocol-type {
          description
            "IPv6 import filter protocol type configuration.";
          container import-filter-policy {
            description
              "Configure a filtering policy. It is used to filter the routes received from a peer. By default, routes are not filtered.";
            uses ipv6-import-filter-protocol-policy-choice-type;
          }  // container import-filter-policy
        }  // grouping ipv6-import-filter-protocol-type
    
        grouping ipv6-export-filter-protocol-type {
          description
            "IPv6 export filter protocol type configuration.";
          container export-filter-policys {
            description
              "List of filtering policies.";
            list export-filter-policy {
              key "protocol process-id";
              description
                "Apply a filtering policy. It is used to filter the routes to be advertised to the peer. By default, routes are not filtered.";
              leaf protocol {
                type ipv6-export-filter-protocol-type;
                description
                  "Specify the name of a routing protocol. The routing protocol takes effect only on the routes to be advertised. The IPv4 address family supports the direct, IS-IS, OSPF, RIP, and static routing protocols. The IPv6 unicast address family of a public network instance supports the direct, IS-IS, OSPFv3, RIPng, and static routing protocols. The IPv6 address family of a VPNv6 instance supports the direct, IS-IS, RIPng, and static routing protocols.";
              }
    
              leaf process-id {
                type uint32 {
                  range "0..4294967295";
                }
                description
                  "Specify the process ID required to be matched. The value is an integer ranging from 0 to 4294967295. If direct or static routes need to be filtered, no process ID is required.";
              }
    
              uses ipv6-filter-protocol-policy-choice-type;
            }  // list export-filter-policy
          }  // container export-filter-policys
        }  // grouping ipv6-export-filter-protocol-type
    
        grouping ipv4vpn-export-filter-protocol-type {
          description
            "VPNv4 export filter protocol type configuration.";
          container export-filter-policy {
            description
              "Configure a filtering policy. It is used to filter the routes received from a peer. By default, routes are not filtered.";
            uses ipv4-import-filter-protocol-policy-choice-type;
          }  // container export-filter-policy
        }  // grouping ipv4vpn-export-filter-protocol-type
    
        grouping ipv6vpn-export-filter-protocol-type {
          description
            "VPNV6 export filter protocol type configuration.";
          container export-filter-policy {
            description
              "Configure a filtering policy. It is used to filter the routes received from a peer. By default, routes are not filtered.";
            uses ipv6-import-filter-protocol-policy-choice-type;
          }  // container export-filter-policy
        }  // grouping ipv6vpn-export-filter-protocol-type
    
        grouping advertise-large-community-type {
          description
            "The advertise-large-community-type configuration.";
          leaf advertise-large-community {
            type peer-comm-config-type;
            default "default";
            description
              "Enable large-community attribute advertisement. The Link-state address family and the RPD address family do not support this element.";
          }
    
          leaf advertise-large-community-state {
            type boolean;
            default "false";
            config false;
            description
              "Whether large-community attribute advertisement is enabled on a peer. The Link-state address family and the RPD address family do not support this element.";
          }
        }  // grouping advertise-large-community-type
    
        grouping advertise-large-community-group-type {
          description
            "The advertise-large-community-type configuration.";
          leaf advertise-large-community {
            type boolean;
            default "false";
            description
              "Enable/disable large-community attribute advertisement. The Link-state address family and the RPD address family do not support this element.";
          }
        }  // grouping advertise-large-community-group-type
    
        grouping slow-peer-type {
          description
            "Peer advertising routes slowly configuration.";
          container slow-peer {
            description
              "Configure peer advertising routes slowly.";
            leaf detection {
              type boolean;
              default "true";
              description
                "Enable/disable detect slow peers.";
            }
    
            leaf detection-threshold {
              type uint16 {
                range "120..3600";
              }
              units "s";
              default "300";
              description
                "Specify the time in seconds lagging behind average when a peer is determined to be a slow peer.";
            }
    
            leaf absolute-detection {
              type boolean;
              default "true";
              description
                "Enable/disable absolute-detect slow peers.";
            }
    
            leaf absolute-detection-threshold {
              type uint16 {
                range "3..3600";
              }
              units "s";
              default "9";
              description
                "Specify the packet send delay time in second when a peer is determined to be a slow peer.";
            }
          }  // container slow-peer
        }  // grouping slow-peer-type
    
        grouping bestroute-med-plus-igp-type {
          description
            "Use the sum of MED multiplied by a MED multiplier and IGP cost multiplied by an IGP cost multiplier to select routes.";
          leaf bestroute-med-plus-igp {
            type boolean;
            must
              "not(../bestroute-igp-metric-ignore='true' and ../bestroute-med-plus-igp='true')";
            default "false";
            description
              "Enable/disable the function to add the IGP cost to the next-hop destination to the MED before comparing MED values for path selection.";
          }
    
          leaf bestroute-med-multiplier {
            when
              "../bestroute-med-plus-igp='true'";
            type uint16 {
              range "1..1000";
            }
            default "1";
            description
              "Value of med product factor.";
          }
    
          leaf bestroute-igp-multiplier {
            when
              "../bestroute-med-plus-igp='true'";
            type uint16 {
              range "1..1000";
            }
            default "1";
            description
              "Value of IGP cost product factor.";
          }
    
          leaf bestroute-igp-metric-ignore {
            type boolean;
            default "false";
            description
              "Enable/disable BGP to ignore the IGP cost of each BGP route to the next hop in route selection. By default, a BGP route with a smaller IGP cost to the next hop is preferred.";
          }
        }  // grouping bestroute-med-plus-igp-type
    
        grouping bestroute-router-id-prior-clusterlist-type {
          description
            "Router ID prior CLUSTER_LIST during the best route selection.";
          leaf bestroute-router-id-prior-clusterlist {
            type boolean;
            default "false";
            description
              "Enable/disable BGP to compare originator before clusterlist in route selection.";
          }
        }  // grouping bestroute-router-id-prior-clusterlist-type
    
        grouping routing-table-rib-only-type {
          description
            "Disable Route Delivery to the IP Routing Table configuration.";
          container routing-table-rib-only {
            description
              "Configure disable route delivery to the IP routing table.";
            leaf enable {
              type boolean;
              default "false";
              description
                "Enable/disable prevent BGP routes from being added to the IP routing table.";
            }
    
            choice policy-type {
              description
                "Set route policy or filter.";
              case rtp-ref {
                description "Route policy.";
                leaf policy-name {
                  when "../enable = 'true'";
                  type leafref {
                    path
                      "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                  }
                  description
                    "When routes are imported from other routing protocols, the route-policy filter can be used to filter the routes and change route attributes.";
                }
              }  // case rtp-ref
    
              case xpl-ref {
                description "Route filter.";
                leaf filter-name {
                  when "../enable = 'true'";
                  type leafref {
                    path
                      "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name";
                  }
                  description
                    "Specify a route-filter name.";
                }
    
                leaf filter-parameter {
                  when "../filter-name";
                  type xpl:filter-parameter-type;
                  description
                    "Specify a route-filter parameter.";
                }
              }  // case xpl-ref
            }  // choice policy-type
          }  // container routing-table-rib-only
        }  // grouping routing-table-rib-only-type
    
        grouping group-graceful-restart-type {
          description
            "Configure graceful restart.";
          leaf enable {
            type boolean;
            default "false";
            description
              "Enable/disable graceful restart capability.";
          }
    
          leaf time-wait-for-rib {
            type uint32 {
              range "3..3000";
            }
            units "s";
            default "600";
            description
              "Period of waiting for the End-of-RIB flag. The value is an integer. When a BGP session is established or re-established, the router enabled with GR should receive the End-of-RIB flag in this period. If the router does not receive the End-of-RIB flag in this period, ensure that the router can exit from the GR process.";
          }
    
          leaf restart-time {
            type uint16 {
              range "3..3600";
            }
            units "s";
            default "150";
            description
              "Specifies the maximum time during which a peer waits for a BGP session reestablishment.";
          }
        }  // grouping group-graceful-restart-type
    
        grouping peer-graceful-restart-type {
          description
            "Configure graceful restart.";
          leaf enable {
            type peer-comm-config-type;
            default "default";
            description
              "Enable/disable graceful restart capability.";
          }
    
          leaf time-wait-for-rib {
            type uint32 {
              range "3..3000";
            }
            units "s";
            description
              "Period of waiting for the End-of-RIB flag. The value is an integer. When a BGP session is established or re-established, the router enabled with GR should receive the End-of-RIB flag in this period. If the router does not receive the End-of-RIB flag in this period, ensure that the router can exit from the GR process.";
          }
    
          leaf restart-time {
            type uint16 {
              range "3..3600";
            }
            units "s";
            description
              "Specifies the maximum time during which a peer waits for a BGP session reestablishment.";
          }
    
          leaf effect-restart-time {
            type uint16 {
              range "3..3600";
            }
            units "s";
            config false;
            description
              "The maximum time during which a peer waits for a BGP session reestablishment.";
          }
    
          leaf effect-time-wait-for-rib {
            type uint32 {
              range "3..3000";
            }
            units "s";
            config false;
            description
              "Period of waiting for the End-of-RIB flag.";
          }
    
          leaf effect-enable {
            type boolean;
            config false;
            description
              "Whether enable/disable graceful restart capability.";
          }
        }  // grouping peer-graceful-restart-type
    
        grouping peer-independent-peer-group-type {
          description
            "The independent-peer-group-type configuration.";
          leaf update-group-independent {
            type peer-comm-config-type;
            default "default";
            description
              "Enable/disable the peer which can reside in an independent peer group.";
          }
    
          leaf update-group-independent-state {
            type boolean;
            config false;
            description
              "Whether the peer can reside in an independent peer group.";
          }
        }  // grouping peer-independent-peer-group-type
    
        grouping group-independent-peer-group-type {
          description
            "The independent-peer-group-type configuration.";
          leaf update-group-independent {
            type boolean;
            default "false";
            description
              "Enable/disable the peer which can reside in an independent peer group.";
          }
        }  // grouping group-independent-peer-group-type
    
        grouping group-origin-as-validation-type {
          description
            "The BGP origin AS validation configuration.";
          leaf prefix-origin-as-validation {
            type boolean;
            default "false";
            description
              "Enable/disable the BGP prefix origin validation.";
          }
    
          leaf bestroute-origin-as-validation {
            when
              "../prefix-origin-as-validation='true'";
            type boolean;
            default "false";
            description
              "Enable/disable the BGP origin AS validation result.";
          }
    
          leaf bestroute-allow-invalid-as {
            when
              "../bestroute-origin-as-validation='true'";
            type boolean;
            default "false";
            description
              "Enable/disable routes with BGP origin AS validation result invalid to be selected.";
          }
        }  // grouping group-origin-as-validation-type
    
        grouping peer-group-acl-name-or-num-type {
          description "The ACL route policy.";
          leaf import-acl-name-or-num {
            type leafref {
              path
                "/acl:acl/acl:groups/acl:group/acl:identity";
            }
            description
              "Specifies the name of the import ACL policy.";
          }
    
          leaf export-acl-name-or-num {
            type leafref {
              path
                "/acl:acl/acl:groups/acl:group/acl:identity";
            }
            description
              "Specifies the name of the export ACL policy.";
          }
        }  // grouping peer-group-acl-name-or-num-type
    
        grouping peer-group-acl6-name-or-num-type {
          description "The ACL route policy.";
          leaf import-acl6-name-or-num {
            type leafref {
              path
                "/acl:acl/acl:group6s/acl:group6/acl:identity";
            }
            description
              "Specifies the name of the import ACL6 policy.";
          }
    
          leaf export-acl6-name-or-num {
            type leafref {
              path
                "/acl:acl/acl:group6s/acl:group6/acl:identity";
            }
            description
              "Specifies the name of the export ACL6 policy.";
          }
        }  // grouping peer-group-acl6-name-or-num-type
    
        grouping advertise-community-type {
          description
            "The community attribute advertisement configuration.";
          leaf advertise-community {
            type boolean;
            default "false";
            description
              "Enable/disable advertise the community attribute to a peer or a peer group.";
          }
        }  // grouping advertise-community-type
    
        grouping reflect-client-type {
          description
            "The route reflector configuration.";
          leaf reflect-client {
            type boolean;
            default "false";
            description
              "Enable/disable the local device as a route reflector (RR) and a peer or peer group as its client. This configuration is applicable between IBGP peers only. The configurations of RRs and its clients in an address family are valid only in this address family. Therefore, it is recommended to configure RRs and its clients in the specified address family that is required.";
          }
        }  // grouping reflect-client-type
    
        grouping peer-origin-as-validation-type {
          description
            "The BGP peer origin AS validation configuration.";
          leaf origin-as-validation {
            type boolean;
            default "false";
            description
              "Enable/disable the BGP peer origin validation.";
          }
        }  // grouping peer-origin-as-validation-type
    
        grouping route-reflector-ext-community-filter-type {
          description
            "The reflector route extended community filter configuration.";
          leaf route-reflector-ext-community-filter {
            type leafref {
              path
                "/rtp:routing-policy/rtp:ext-community-filters/rtp:ext-community-filter/rtp:name";
            }
            description
              "Set the name of the extended community filter supported by an RR group. For the purpose of load balancing, only the IBGP route whose route-target extended community attribute meets the matching rules can be reflected.";
          }
        }  // grouping route-reflector-ext-community-filter-type
    
        grouping qos-local-id-type {
          description "The QoS configuration.";
          container qos {
            description "Configure QoS.";
            uses qos-local-id-policy-choice-type;
          }  // container qos
        }  // grouping qos-local-id-type
    
        grouping ipv6-qos-local-id-type {
          description "The QoS configuration.";
          container qos {
            description "Configure QoS.";
            uses qos-local-id-policy-choice-type;
    
            leaf ipv6-qppb {
              type boolean;
              default 'false';
              description
                "Enable/disable IPv6 QPPB for BGP.";
            }
          }  // container qos
        }  // grouping ipv6-qos-local-id-type
    
        grouping qos-local-id-policy-choice-type {
          description
            "QoS local ID policy choice type configuration.";
          choice local-id-policy {
            description
              "Configure QoS local ID.";
            case value {
              description
                "Specify the QoS local ID value.";
              leaf local-id {
                type uint8 {
                  range "1..255";
                }
                description
                  "Specify the QoS local ID value.";
              }
            }  // case value
    
            case rtp-ref {
              description "Route policy.";
              leaf local-id-policy-name {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Set a routing policy to filter routes so that a configured QoS ID is applied to the routes that match the specified policy.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              leaf local-id-filter-name {
                type leafref {
                  path
                    "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name";
                }
                description
                  "Specify a route-filter name.";
              }
    
              leaf local-id-filter-parameter {
                when "../local-id-filter-name";
                type xpl:filter-parameter-type;
                description
                  "Specify a route-filter parameter.";
              }
            }  // case xpl-ref
          }  // choice local-id-policy
        }  // grouping qos-local-id-policy-choice-type
    
        grouping graceful-restart-type {
          description
            "Configure the graceful-restart.";
          leaf enable {
            type boolean;
            default "false";
            description
              "Enable/disable GR of the BGP speaker in the specified address family, peer address, or peer group. When GR is enabled, the BGP speaker enabled with GR keeps the forwarding state and sends the End-Of-RIB flag during the restart. In this case, however, the BGP speaker may not maintain the forwarding table. Enabling or disabling GR may delete and re-establish all sessions and instances.";
          }
    
          leaf time-wait-for-rib {
            type uint32 {
              range "3..3000";
            }
            units "s";
            default "600";
            description
              "Period of waiting for the End-Of-RIB flag. The value is an integer. When a BGP session is established or re-established, the router enabled with GR should receive the End-Of-RIB flag in this period. If the router does not receive the End-Of-RIB flag in this period, ensure that the router can exit from the GR process.";
          }
    
          leaf restart-time {
            type uint16 {
              range "3..3600";
            }
            units "s";
            default "150";
            description
              "Specifies the maximum time during which a peer waits for a BGP session reestablishment.";
          }
    
          leaf peer-reset {
            type boolean;
            default "false";
            description
              "Enable/disable peer disconnection through GR.";
          }
        }  // grouping graceful-restart-type
    
        grouping reference-period-type {
          description
            "Configure the reference period.";
          leaf suppress-interval {
            type uint32 {
              range "1..65535";
            }
            units "s";
            default "60";
            description
              "Specifies the reference period used to add penalty in case of next hop flapping.";
          }
    
          leaf hold-interval {
            type uint32 {
              range "1..65535";
            }
            units "s";
            default "120";
            description
              "Specifies the reference period used to hold penalty in case of next hop flapping.";
          }
    
          leaf clear-interval {
            type uint32 {
              range "1..65535";
            }
            units "s";
            default "600";
            description
              "Specifies the reference period used to clear penalty in case of next hop flapping.";
          }
        }  // grouping reference-period-type
    
        grouping remote-prefix-sid-states-type {
          description
            "List of remote prefix SID.";
          container remote-prefix-sid-states {
            config false;
            description
              "List of remote prefix SID.";
            list remote-prefix-sid-state {
              key "prefix-sid";
              description
                "Operational state of the remote BGP prefix SID.";
              leaf prefix-sid {
                type inet:ipv6-address-no-zone;
                description "Prefix SID value.";
              }
    
              leaf locator-sid {
                type inet:ipv6-address-no-zone;
                description
                  "Prefix SID value of the mirrored locator.";
              }
    
              leaf locator-mask-length {
                type uint8 {
                  range "0..128";
                }
                description
                  "Mask length of the SID of the mirrored locator.";
              }
    
              leaf vpn-name {
                type string {
                  length "1..31";
                }
                description
                  "Name of the VPN instance that contains the prefix SID.";
              }
            }  // list remote-prefix-sid-state
          }  // container remote-prefix-sid-states
        }  // grouping remote-prefix-sid-states-type
    
        grouping graceful-restart-status-type {
          description
            "Statistics of the GR status of a BGP speaker.";
          container graceful-restart-status {
            config false;
            description
              "Statistics of the GR status of a BGP speaker.";
            leaf enable {
              type boolean;
              description
                "The GR capability of a BGP speaker.";
            }
    
            leaf restart-timer {
              type uint32;
              units "s";
              description
                "Period during which a BGP speaker waits for the peer relationship reestablishment.";
            }
    
            leaf eor-timer {
              type uint32;
              units "s";
              description
                "Period during which a BGP speaker waits for the End-Of-RIB flag.";
            }
    
            container peers {
              description
                "List of display the GR statistics for a BGP peer.";
              list peer {
                key "vpn-name af address";
                description
                  "Statistics of the GR status of a BGP peer.";
                leaf vpn-name {
                  type string {
                    length "1..31";
                  }
                  description
                    "VPN name of a BGP instance.";
                }
    
                leaf af {
                  type string {
                    length "1..300";
                  }
                  description
                    "BGP address-family type.";
                }
    
                leaf address {
                  type inet:ip-address-no-zone;
                  description
                    "Address of a peer.";
                }
    
                leaf peer-capability {
                  type string {
                    length "1..300";
                  }
                  description
                    "GR capability of a neighbor.";
                }
    
                leaf gr-capability-enable {
                  type boolean;
                  description
                    "Whether GR capability is negotiated.";
                }
    
                leaf bgp-peer-state {
                  type peer-state-type;
                  description
                    "Status of the peer.";
                }
    
                leaf gr-state {
                  type boolean;
                  description
                    "GR status of a neighbor.";
                }
    
                leaf restart-left-timer {
                  type uint32;
                  units "s";
                  description
                    "Restart left timer.";
                }
    
                leaf eor-sent {
                  type boolean;
                  description
                    "Whether error is sent.";
                }
    
                leaf stale-route-num {
                  type uint32;
                  description
                    "Stale route number.";
                }
              }  // list peer
            }  // container peers
          }  // container graceful-restart-status
        }  // grouping graceful-restart-status-type
    
        grouping error-discard-info-type {
          description
            "Statistics of BGP error message.";
          container error-discard-info {
            config false;
            description
              "Statistics of BGP error message.";
            leaf cluster-id-loop-count {
              type uint32;
              description
                "Count of routes discarded because cluster IDs are the same.";
            }
    
            leaf receive-as-over-limit-count {
              type uint32;
              description
                "Count of received routes discarded because the number of AS numbers in the AS_Path exceeds the upper limit.";
            }
    
            leaf advertise-as-over-limit-count {
              type uint32;
              description
                "Count of advertised routes discarded because the number of AS numbers in the AS_Path exceeds the upper limit.";
            }
    
            leaf as-loop-count {
              type uint32;
              description
                "Count of routes discarded because AS numbers are the same.";
            }
    
            leaf zero-rd-count {
              type uint32;
              description
                "Count of routes discarded because of the RD 0:0.";
            }
    
            leaf no-prefix-count {
              type uint32;
              description
                "Count of routes discarded because no prefix exists.";
            }
    
            leaf path-attribute-error-count {
              type uint32;
              description
                "Count of routes with error path attributes.";
            }
    
            leaf originator-id-loop-count {
              type uint32;
              description
                "Count of routes with an Originator ID conflict.";
            }
    
            leaf md5-count {
              type uint32;
              description "MD5 count.";
            }
    
            container afs {
              description
                "List of BGP routes discarded in the address family.";
              list af {
                key "address-family";
                description
                  "Statistics of BGP route discarded in the address family.";
                leaf address-family {
                  type af-type;
                  description
                    "Address family type.";
                }
    
                leaf cluster-id-loop-count {
                  type uint32;
                  description
                    "Count of routes discarded because cluster IDs are the same.";
                }
    
                leaf receive-as-over-limit-count {
                  type uint32;
                  description
                    "Count of received routes discarded because the number of AS numbers in the AS_Path exceeds the upper limit.";
                }
    
                leaf advertise-as-over-limit-count {
                  type uint32;
                  description
                    "Count of advertised routes discarded because the number of AS numbers in the AS_Path exceeds the upper limit.";
                }
    
                leaf as-loop-count {
                  type uint32;
                  description
                    "Count of routes discarded because AS numbers are the same.";
                }
    
                leaf zero-rd-count {
                  type uint32;
                  description
                    "Count of routes discarded because of the RD 0:0.";
                }
    
                leaf path-attribute-error-count {
                  type uint32;
                  description
                    "Count of routes discarded because no prefix exists.";
                }
    
                leaf originator-id-loop-count {
                  type uint32;
                  description
                    "Count of routes with an Originator ID conflict.";
                }
    
                leaf peer-record-count {
                  type uint32;
                  description
                    "Peer record count.";
                }
    
                container peers {
                  description
                    "List of BGP peer error information.";
                  list peer {
                    key "vpn-name address";
                    description
                      "Statistics of BGP peer error information. The display error discard command displays statistics about all address families and packets discarded by peers. The NMS supports query based on the following filtering modes: 
                    (1) Statistics query about the specified address family and statistics about the packets discarded by peers. Such query is not supported by the preceding command.
                    (2) Query of the information about the discarded packets filtered based on the specified peer or VPN instance. The query result is different from that in the command output. The command displays the statistics of the address family in which packet loss occurs and the information about the packets discarded by the peer.";
                    leaf vpn-name {
                      type string {
                        length "1..31";
                      }
                      description "VPN name.";
                    }
    
                    leaf address {
                      type inet:ip-address-no-zone;
                      description
                        "Peer address.";
                    }
    
                    leaf record-time {
                      type yang:date-and-time;
                      description "Record time.";
                    }
    
                    leaf reason {
                      type string {
                        length "1..300";
                      }
                      description
                        "Packet loss reason.";
                    }
    
                    leaf error-data {
                      type string {
                        length "1..300";
                      }
                      description "Error data.";
                    }
    
                    leaf vpn-id {
                      type uint32;
                      description "VPN index.";
                    }
                  }  // list peer
                }  // container peers
              }  // list af
            }  // container afs
          }  // container error-discard-info
        }  // grouping error-discard-info-type
    
        grouping vpn-brief-infos-type {
          description
            "List of BGP VPN brief informations.";
          container vpn-brief-infos {
            config false;
            description
              "List of BGP VPN brief informations.";
            list vpn-brief-info {
              key "vpn-name address-family";
              description
                "Statistics of VPN brief information.";
              leaf vpn-name {
                type leafref {
                  path
                    "/ni:network-instance/ni:instances/ni:instance/ni:name";
                }
                description
                  "VPN name of a BGP instance.";
              }
    
              leaf address-family {
                type af-type;
                description
                  "Address family type.";
              }
    
              uses vpn-brief-num-type;
            }  // list vpn-brief-info
          }  // container vpn-brief-infos
        }  // grouping vpn-brief-infos-type
    
        grouping bfd-detect-parameter-type {
          description
            "BFD detect parameter configuration.";
          leaf multiplier {
            type uint32 {
              range "3..50";
            }
            default "3";
            description
              "Specify the detection multiplier.";
          }
    
          leaf min-rx-interval {
            type uint32 {
              range "3..20000";
            }
            units "ms";
            description
              "Specify the minimum interval at which BFD packets are received. The value range and default value are controlled by the PAF.";
          }
    
          leaf min-tx-interval {
            type uint32 {
              range "3..20000";
            }
            units "ms";
            description
              "Specify the minimum interval at which BFD packets are sent. The value range and default value are controlled by the PAF.";
          }
        }  // grouping bfd-detect-parameter-type
    
        grouping peer-local-if-type {
          description "Configure peer tracking.";
          leaf local-if-name {
            type leafref {
              path
                "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
            }
            description
              "Name of a source interface that sends BGP packets. By default, the outbound interface of a BGP packet serves as the source interface of a BGP packet. To ensure that a router can send BGP packets when a physical interface fails, you can configure the source interface that sends BGP packets as a loopback interface. When using the loopback interface as the source interface, note the following points: 1. The address of the loopback interface of the BGP peer must be reachable. 2. For an EBGP connection, configure the maximum number of hops and allow EBGP peer relationships to be established in indirect mode.";
          }
    
          leaf local-if-address {
            type inet:ip-address-no-zone;
            description
              "Name of a source interface that sends BGP packets. By default, the outbound interface of a BGP packet serves as the source interface of a BGP packet. To ensure that a router can send BGP packets when a physical interface fails, you can configure the source interface that sends BGP packets as a loopback interface. When using the loopback interface as the source interface, note the following points:
            1. The address of the loopback interface of the BGP peer must be reachable.
            2. For an EBGP connection, configure the maximum number of hops and allow EBGP peer relationships to be established in indirect mode.";
          }
        }  // grouping peer-local-if-type
    
        grouping peer-tracking-type {
          description "Configure peer tracking.";
          leaf tracking-enable {
            type boolean;
            default "false";
            description
              "Enable/disable peer tracking, After peer tracking is enabled, the device can fast detect the unreachability of a peer and reset the session.";
          }
    
          leaf tracking-delay-time {
            when "../tracking-enable='true'";
            type uint16;
            units "s";
            default "0";
            description
              "Specify the delay to reset the session.";
          }
        }  // grouping peer-tracking-type
    
        grouping community-attribute {
          description
            "Configure community attribute for peer or peer group.";
          leaf advertise-community {
            type boolean;
            default "false";
            description
              "Enable/disable advertise the community attribute to a peer or a peer group.";
          }
    
          leaf advertise-ext-community {
            type boolean;
            default "false";
            description
              "Enable/disable advertise the extended community attribute to a peer or peer group.";
          }
    
          leaf discard-ext-community {
            type boolean;
            default "false";
            description
              "Enable/disable discard the extended community attribute in the routing information about a specified peer.";
          }
        }  // grouping community-attribute
    
        grouping load-balancing-type {
          description
            "Configure load balancing for peer or peer group.";
          leaf load-balancing-enable {
            type boolean;
            default "false";
            description
              "Enable/disable a neighbour to participate in load balancing.";
          }
    
          choice load-balancing-ignore-as-type {
            description
              "Set load balancing as path type.";
            case as-attribute {
              description
                "Ignore the as-path attribute.";
              leaf load-balancing-as-path-ignore {
                when
                  "../load-balancing-enable='true'";
                type empty;
                description
                  "Configure BGP to ignore the AS_Path attribute when selecting the equal route. After as-path-neglect is selected, BGP does not compare the AS_Path length.";
              }
            }  // case as-attribute
    
            case same-length-as-attribute {
              description
                "Ignore comparison of as-path attributes with the same length.";
              leaf load-balancing-as-path-relax {
                when
                  "../load-balancing-enable='true'";
                type empty;
                description
                  "Configure BGP to ignore comparison of AS_Path attributes with the same length when selecting the equal route. After as-path-neglect is selected, BGP does not compare the AS_Path length.";
              }
            }  // case same-length-as-attribute
          }  // choice load-balancing-ignore-as-type
        }  // grouping load-balancing-type
    
        grouping group-bfd-parameter-type {
          description
            "Configure BFD for peer group.";
          container bfd-parameter {
            description "Configure BFD.";
            leaf enable {
              type boolean;
              default "false";
              description "Enable/disable BFD.";
            }
    
            choice mode-type {
              description "Set bfd mode.";
              case single {
                description "Single hop mode.";
                leaf single-hop {
                  when "../enable='true'";
                  type empty;
                  description
                    "The single hop mode is preferred during the BFD session establishment between IBGP peers.";
                }
    
                leaf compatible {
                  when "../enable='true'";
                  type empty;
                  description "Compatible.";
                }
              }  // case single
    
              case link {
                description
                  "Per-link-echo mode.";
                leaf per-link-echo {
                  when "../enable='true'";
                  type empty;
                  description
                    "The per-link one-arm-echo mode is preferred during the BFD session establishment between IBGP peers.";
                }
              }  // case link
    
              case one-arm-echo {
                description "One-arm-echo mode.";
                leaf one-arm-echo {
                  when "../enable='true'";
                  type empty;
                  description
                    "The one arm echo mode is preferred during the BFD session establishment between BGP peers.";
                }
              }  // case one-arm-echo
            }  // choice mode-type
    
            uses bfd-detect-parameter-type;
    
            leaf valid-ttl-hops {
              type uint8 {
                range "1..255";
              }
              description
                "Specify the valid TTL hops value.";
            }
          }  // container bfd-parameter
        }  // grouping group-bfd-parameter-type
    
        grouping peer-policy-filter-type {
          description
            "Configure route policy or filter for peer group.";
          choice import-policy-type {
            description
              "Set route policy or filter.";
            case rtp-ref {
              description "Route policy.";
              leaf import-policy {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the filtering policy applied to the routes learned from a peer. By default, no such policy is specified.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              container import-filter {
                description
                  "Configure an import route-filter to filter the routes received from a peer group. By default, no route-filter is specified to filter the routes imported from a peer group.";
                leaf name {
                  type leafref {
                    path
                      "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name";
                  }
                  description
                    "Specify an import route-filter name.";
                }
    
                leaf parameter {
                  when "../name";
                  type xpl:filter-parameter-type;
                  description
                    "Specify an import route-filter parameter.";
                }
              }  // container import-filter
            }  // case xpl-ref
          }  // choice import-policy-type
    
          choice export-policy-type {
            description
              "Set route policy or filter.";
            case rtp-ref {
              description "Route policy.";
              leaf export-policy {
                type leafref {
                  path
                    "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name";
                }
                description
                  "Specify the filtering policy applied to the routes to be advertised to a peer. By default, no such policy is specified.";
              }
            }  // case rtp-ref
    
            case xpl-ref {
              description "Route filter.";
              container export-filter {
                description
                  "Configure an export route-filter to filter the routes to be advertised to a peer group. By default, no route-filter is specified to filter the routes to be advertised to a peer group.";
                leaf name {
                  type leafref {
                    path
                      "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name";
                  }
                  description
                    "Specify an export route-filter name.";
                }
    
                leaf parameter {
                  when "../name";
                  type xpl:filter-parameter-type;
                  description
                    "Specify an export route-filter parameter.";
                }
              }  // container export-filter
            }  // case xpl-ref
          }  // choice export-policy-type
        }  // grouping peer-policy-filter-type
    
        grouping peer-ipv4-reoriginate-type {
          description
            "Configure IPv4 regeneration for peer or group.";
          leaf reoriginate-route-enable {
            type boolean;
            default "false";
            description
              "Enable/disable route regeneration.";
          }
    
          leaf reoriginate-ip-enable {
            type boolean;
            default "false";
            description
              "Enable/disable IP route regeneration and advertisement.";
          }
    
          leaf reoriginate-mac-ip-enable {
            type boolean;
            default "false";
            description
              "Enable/disable MAC-IP route regeneration and advertisement.";
          }
    
          leaf reoriginate-vpnv4-route-enable {
            type boolean;
            default "false";
            description
              "Enable/disable VPNv4 route regeneration and advertisement.";
          }
        }  // grouping peer-ipv4-reoriginate-type
    
        grouping peer-bfd-parameter-type {
          description "Configure BFD for peer.";
          container bfd-parameter {
            description "Configure BFD.";
            leaf block {
              type boolean;
              must
                "not(../block='true' and ../enable='true')";
              default "false";
              description
                "Enable/disable preventing a BGP peer from inheriting the BFD configuration of the BGP peer group.";
            }
    
            leaf enable {
              type boolean;
              must
                "not(../block='true' and ../enable='true')";
              default "false";
              description "Enable/disable BFD.";
            }
    
            choice mode-type {
              description "Set bfd mode.";
              case single {
                description "Single hop mode.";
                leaf single-hop {
                  when "../enable='true'";
                  type empty;
                  description
                    "The single hop mode is preferred during the BFD session establishment between IBGP peers.";
                }
    
                leaf compatible {
                  when "../enable='true'";
                  type empty;
                  description "Compatible.";
                }
              }  // case single
    
              case link {
                description
                  "The per-link-echo mode.";
                leaf per-link-echo {
                  when "../enable='true'";
                  type empty;
                  description
                    "The per-link one-arm-echo mode is preferred during the BFD session establishment between IBGP peers.";
                }
              }  // case link
    
              case one-arm-echo {
                description "One-arm-echo mode.";
                leaf one-arm-echo {
                  when "../enable='true'";
                  type empty;
                  description
                    "The one arm echo mode is preferred during the BFD session establishment between BGP peers.";
                }
              }  // case one-arm-echo
            }  // choice mode-type
    
            uses bfd-detect-parameter-type;
    
            leaf valid-ttl-hops-operation {
              type enumeration {
                enum "enable" {
                  value 1;
                  description "Enable:";
                }
                enum "disable" {
                  value 2;
                  description "Disable:";
                }
              }
              description
                "Control specify the valid TTL hops value operation.";
            }
    
            leaf valid-ttl-hops {
              when
                "../valid-ttl-hops-operation='enable'";
              type uint8 {
                range "1..255";
              }
              mandatory true;
              description
                "Specify the valid TTL hops value.";
            }
          }  // container bfd-parameter
        }  // grouping peer-bfd-parameter-type
    
        grouping peer-bfd-parameter-state-grouping {
          description
            "Statistics of BFD Parameter State.";
          container bfd-parameter-state {
            config false;
            description
              "Statistics of BFD Parameter State.";
            leaf valid-ttl-hops {
              type uint8 {
                range "1..255";
              }
              description
                "The valid TTL hops value.";
            }
          }  // container bfd-parameter-state
        }  // grouping peer-bfd-parameter-state-grouping
    
        grouping peer-add-path-type {
          description
            "Add-Path route advertisement to a peer.";
          leaf add-path-mode {
            type add-path-cap-type;
            default "null";
            description
              "Enable Add-Path route advertisement to a peer.";
          }
    
          leaf add-path-number {
            type uint8 {
              range "2..64";
            }
            description
              "Number of Add-Path routes that can be advertised to a peer.";
          }
        }  // grouping peer-add-path-type
    
        grouping group-ssl-policy-grouping {
          description
            "Configure SSL policy for BGP group.";
          leaf name {
            type leafref {
              path
                "/ssl:ssl/ssl:ssl-policys/ssl:ssl-policy/ssl:policy-name";
            }
            description "SSL policy name.";
          }
    
          leaf role {
            ext:operation-exclude "update" {
              description "The node cannot be modified. You need to disable or delete the node first.";
            }
            type ssl-role-type;
            description
              "Configure a peer as an SSL client or server.";
          }
    
          leaf server-certificate {
            type empty;
            must "../role != 'client'";
            description
              "Enable/disable SSL/TLS authentication on an SSL server.";
          }
        }  // grouping group-ssl-policy-grouping
      }  // submodule huawei-bgp-common
    

© 2023 YumaWorks, Inc. All rights reserved.