huawei-bgp

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

  • Version: 2021-08-11

    huawei-bgp@2021-08-11


    
      module huawei-bgp {
    
        yang-version 1;
    
        namespace "urn:huawei:yang:huawei-bgp";
    
        prefix bgp;
    
        import huawei-extension {
          prefix ext;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import ietf-yang-types {
          prefix yang;
        }
        import huawei-network-instance {
          prefix ni;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import huawei-routing-policy {
          prefix rtp;
        }
        import huawei-routing {
          prefix rt;
        }
        import huawei-ssl {
          prefix ssl;
        }
        import huawei-tunnel-management {
          prefix tnlm;
        }
        import huawei-l3vpn {
          prefix l3vpn;
        }
        import huawei-ifm {
          prefix ifm;
        }
        import huawei-socket {
          prefix socket;
        }
    
        include huawei-bgp-type;
        include huawei-bgp-common;
        include huawei-bgp-common-multiprotocol;
    
        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 "2021-02-03" {
          description
            "Add bgp common multiprotocol submodule.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-02-25" {
          description
            "The YANG descriptions are modified according to new standards.";
          reference
            "Huawei private.";
    
        }
    
        revision "2019-03-22" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
        ext:task-name "bgp";
    
        grouping network-route-ipv4 {
          description "BGP network routes.";
          leaf address {
            type inet:ipv4-address-no-zone;
            description
              "Specify the IP address advertised by BGP. An IPv4 address can be configured in the IPv4 address family. Note: During the configuration of a network route, the IP address is adjusted based on the mask. It is recommended that you click Synchronize All after creating a network route.";
          }
    
          leaf mask-length {
            type uint8 {
              range "0..32";
            }
            description
              "Specify the mask length of an IP address.";
          }
    
          choice policy-type {
            description
              "Specify the route-policy or filter for route advertisement.";
            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 network-route-ipv4
    
        grouping network-route-ipv6 {
          description "BGP network routes.";
          leaf address {
            type inet:ipv6-address-no-zone;
            description
              "Specify the IP address advertised by BGP. An IPv6 routes can be configured in the IPv6 address family. Note: During the configuration of a network route, the IP address is adjusted based on the mask. It is recommended that you click Synchronize All after creating a network route.";
          }
    
          leaf mask-length {
            type uint8 {
              range "0..128";
            }
            description
              "Specify the mask length of an IP address.";
          }
    
          choice policy-type {
            description
              "Specify the route-policy or filter for route advertisement.";
            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 network-route-ipv6
    
        grouping advertise-route-to-evpn-type {
          description
            "Advertise-routes-type configuration.";
          list advertise-route-to-evpn {
            key "protocol";
            description
              "Configure the advertise route protocol.";
            leaf protocol {
              type enumeration {
                enum "all" {
                  value 0;
                  description
                    "Advertise all the types of route protocol.";
                }
              }
              description "Route protocol.";
            }
    
            leaf import-multipath {
              type boolean;
              default "false";
              description
                "Enable/disable route import from multiple paths.";
            }
    
            leaf include-local-cross {
              type boolean;
              default "false";
              description
                "Enable/disable local cross route to advertise l2vpn evpn.";
            }
    
            leaf advertise-route-mode {
              type enumeration {
                enum "all" {
                  value 0;
                  description "All:";
                }
                enum "best" {
                  value 1;
                  description "Best:";
                }
                enum "valid" {
                  value 2;
                  description "Valid:";
                }
              }
              default "all";
              description
                "VPN advertise route mode to evrf.";
            }
          }  // list advertise-route-to-evpn
        }  // grouping advertise-route-to-evpn-type
    
        grouping vpn-target-type {
          description
            "BGP IPv4/IPv6 VPN target.";
          leaf policy-vpntarget {
            type boolean;
            default "true";
            description
              "Enable/disable VPN target-based filtering for the received VPN routes. Only the VPN route whose Export RT attribute matches the local Import RT attribute can be added to the routing table. This option can be used in the inter-AS VPN Option B solution and the ASBR MP-EBGP inter-AS L2VPN solution in Kompella mode.";
          }
        }  // grouping vpn-target-type
    
        grouping group-entropy-label-type {
          description
            "Entropy label parameter configuration in a peer group.";
          leaf advertise-entropy-label {
            type boolean;
            default "false";
            description
              "Enable/disable the capability of advertising entropy labels.";
          }
    
          leaf padding {
            when
              "../advertise-entropy-label='true'";
            type string {
              length "1..32";
              pattern '(([0-9A-F])*)';
            }
            description
              "Padding format. The value is a hexadecimal string containing 1 to 32 characters (16 hexadecimal numbers). It cannot contain spaces, and can only contain uppercase letters (A to F) and digits (0 to 9), and the length must be an even number.";
          }
    
          leaf attribute-type {
            when
              "../advertise-entropy-label='true'";
            type entropy-label-attribute-type;
            mandatory true;
            description
              "The attribute-type of advertising entropy labels.";
          }
    
          leaf entropy-label {
            type boolean;
            default "false";
            description
              "Enable/disable the function of delivering the entropy label capability to the forwarding plane.";
          }
        }  // grouping group-entropy-label-type
    
        grouping peer-entropy-label-type {
          description
            "Entropy label parameter configuration in a peer.";
          leaf advertise-entropy-label {
            type peer-comm-config-type;
            default "default";
            description
              "Enable the capability of advertising entropy labels.";
          }
    
          leaf padding {
            when
              "../advertise-entropy-label='enable'";
            type string {
              length "1..32";
              pattern '(([0-9A-F])*)';
            }
            description
              "Padding format. The value is a hexadecimal string containing 1 to 32 characters (16 hexadecimal numbers). It cannot contain spaces, and can only contain uppercase letters (A to F) and digits (0 to 9), and the length must be an even number.";
          }
    
          leaf attribute-type {
            when
              "../advertise-entropy-label='enable'";
            type entropy-label-attribute-type;
            mandatory true;
            description
              "The attribute-type of advertising entropy labels.";
          }
    
          leaf entropy-label {
            type peer-comm-config-type;
            default "default";
            description
              "Enable the function of delivering the entropy label capability to the forwarding plane.";
          }
    
          leaf effect-advertise-entropy-label {
            type boolean;
            default "false";
            config false;
            description
              "Whether the capability of advertising entropy labels is enabled on the BGP peer.";
          }
    
          leaf effect-padding {
            when
              "../effect-advertise-entropy-label='true'";
            type string {
              length "1..32";
              pattern '(([0-9A-F])*)';
            }
            config false;
            description "Padding format.";
          }
    
          leaf effect-attribute-type {
            when
              "../effect-advertise-entropy-label='true'";
            type entropy-label-attribute-type;
            config false;
            description
              "The attribute-type of advertising entropy labels.";
          }
    
          leaf effect-entropy-label {
            type boolean;
            default "false";
            config false;
            description
              "Whether the function of delivering the entropy label capability to the forwarding plane is enabled on the BGP peer.";
          }
        }  // grouping peer-entropy-label-type
    
        container bgp {
          description
            "Inter-AS routing protocol that exchanges Network Layer Reachability Information (NLRI) with other BGP systems,
          Universal BGP configurations that contain the basic BGP configurations and the query information.";
          container global {
            description
              "Configure the router for BGP globally.";
            leaf yang-enable {
              type boolean;
              default "false";
              description
                "Enable/disable BGP yang mode. To use NETCONF YANG to manage BGP VPN instances in huawei-bgp.yang, enable YANG management for the BGP VPN instances on the device or enable the leaf node globally in the huawei-bgp.yang file.";
            }
    
            leaf memory-overload-exception-discard-route {
              type boolean;
              default "false";
              description
                "Enable/disable BGP to discard routes received from all peers if the memory usage of a device is abnormal.";
            }
          }  // container global
    
          container paf-controls {
            description
              "List of PAF-based limiting disabled for some features.";
            list paf-control {
              key "feature-name";
              description
                "Configure PAF-based limiting disabled for some features.";
              leaf feature-name {
                type paf-control-feature-type;
                description "Feature name.";
              }
            }  // list paf-control
          }  // container paf-controls
    
          container session-car {
            must
              "pir-value >= cir-value and pbs-value >= cbs-value";
            description "Configure session CAR.";
            leaf enable {
              type boolean;
              default "true";
              description
                "Enable/disable session CAR.";
            }
    
            leaf cir-value {
              type uint32 {
                range "12..1200";
              }
              units "kbit/s";
              default "24";
              description
                "Specify the session CAR CIR value.";
            }
    
            leaf cbs-value {
              type uint32 {
                range "15000..1500000";
              }
              units "Byte";
              default "15000";
              description
                "Specify the session CAR CBS value.";
            }
    
            leaf pir-value {
              type uint32 {
                range "12000..60000";
              }
              units "kbit/s";
              default "48000";
              description
                "Specify the session CAR PIR value.";
            }
    
            leaf pbs-value {
              type uint32 {
                range "1500000..7500000";
              }
              units "Byte";
              default "6000000";
              description
                "Specify the session CAR PBS value.";
            }
          }  // container session-car
    
          container micro-car {
            must
              "pir-value >= cir-value and pbs-value >= cbs-value";
            description "Configure micro CAR.";
            leaf enable {
              type boolean;
              default "true";
              description
                "Enable/disable micro CAR.";
            }
    
            leaf cir-value {
              type uint32 {
                range "12..1200";
              }
              units "kbit/s";
              default "24";
              description
                "Specify the micro CAR CIR value.";
            }
    
            leaf cbs-value {
              type uint32 {
                range "15000..1500000";
              }
              units "Byte";
              default "15000";
              description
                "Specify the micro CAR CBS value.";
            }
    
            leaf pir-value {
              type uint32 {
                range "12000..60000";
              }
              units "kbit/s";
              default "48000";
              description
                "Specify the micro CAR PIR value.";
            }
    
            leaf pbs-value {
              type uint32 {
                range "1500000..7500000";
              }
              units "Byte";
              default "6000000";
              description
                "Specify the micro CAR PBS value.";
            }
          }  // container micro-car
    
          container base-process {
            description
              "Configure the global BGP information, such as the protocol version, AS number, and system identifier.";
            leaf enable {
              type boolean;
              must
                "(../enable='true' and ../as) or (../enable='false' and not(../as))";
              default "false";
              description
                "Enable/disable BGP function.";
            }
    
            leaf as {
              ext:operation-exclude "update" {
                description "The node cannot be modified when BGP is enabled.";
              }
              when "../enable='true'";
              type as-number-validate;
              description
                "Local AS number, which can be in either of the two formats:
               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 ranging from 1 to 4294967295.
               An AS consists of multiple routers managed based on the same techniques. Interior Gateway Protocol (IGP) and universal routing metric packets are used inside an AS, and Exterior Gateway Protocol (EGP) is used outside to send packets to other ASs. With the development of this definition, one AS usually uses multiple IGPs and metrics. Even though multiple IGPs and metrics are used, the routing plan and destination reachability of an AS are consistent with those of another AS. The local AS number cannot be configured same as the confederation sub-ASs. The object cannot be deleted or modified.";
            }
    
            leaf keep-all-routes {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable saving all the updated information about BGP routes from a peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. Save all the updated information about BGP routes from a peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, only the updated information about BGP routes from a specified peer is saved on condition that the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
            }
    
            leaf check-first-as {
              when "../enable='true'";
              type boolean;
              default "true";
              description
                "Enable/disable checking the first AS in the AS_Path of the update messages from EBGP peers.";
            }
    
            leaf router-id-auto-select {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable router ID auto select. If a BGP VPN instance is not enabled to select a router ID, a router ID can be configured for the BGP VPN instance. If no router ID is configured for the BGP VPN instance, the BGP VPN instance inherits the router ID of the public network instance. If a BGP VPN instance is enabled to select a router ID, it uses the address of an interface bound to a VPN as the router ID based on the following rules: 
              1. If Loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the Loopback interfaces is selected as the router ID. 
              2. If there is no Loopback interface configured with an IP address, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.";
            }
    
            leaf shutdown {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable interrupting BGP all neighbour.";
            }
    
            leaf local-ifnet-mtu {
              when "../enable='true'";
              type uint16 {
                range "46..65535";
              }
              default "1500";
              description "BGP LOCALIFNET MTU.";
            }
    
            leaf private-4byte-as {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable BGP private 4 byte AS. With BGP private-4-byte-as, BGP private as is from 64512 to 65535 and from 4200000000 to 4294967294.";
            }
    
            leaf local-cross-no-med {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable local cross routing non-med.";
            }
    
            leaf as-path-limit {
              when "../enable='true'";
              type uint16 {
                range "1..2000";
              }
              description
                "Maximum number of AS numbers in the AS_Path attribute.";
            }
    
            leaf dynamic-session-limit {
              ext:dynamic-default;
              when "../enable='true'";
              type uint32 {
                range "1..4294967295";
              }
              description
                "Upper limit on the number of dynamic peer sessions.";
            }
    
            leaf peer-up-route-lowest-priority {
              when "../enable='true'";
              type boolean;
              default "false";
              description
                "Enable/disable reducing route priority to lowest.";
            }
    
            leaf delay-time {
              when
                "../peer-up-route-lowest-priority='true'";
              type uint32 {
                range "1..864000";
              }
              units "s";
              description
                "Specifies the delay time.";
            }
    
            leaf route-loop-detect-enable {
              type boolean;
              default "false";
              description
                "Enable/disable BGP route loop-detect control.";
            }
    
            container confederation {
              when "../enable='true'";
              description
                "Configure confederation.";
              leaf id {
                type as-number-validate;
                description
                  "Configure the confederation ID.";
              }
    
              leaf nonstanded {
                type boolean;
                default "false";
                description
                  "Enable/disable nonstanded. Configure the device to be compatible with devices in a nonstandard confederation.";
              }
    
              leaf-list as {
                when "../id";
                type as-number-validate;
                max-elements 32;
                description
                  "Configure the confederation AS number. The confederation AS number can be in either of the two formats:
                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. The confederation sub-ASs cannot be configured same as the local AS number.";
              }
            }  // container confederation
    
            container graceful-restart {
              when "../enable='true'";
              description
                "Configure the graceful-restart.";
              uses graceful-restart-type;
            }  // container graceful-restart
    
            uses remote-prefix-sid-states-type;
    
            container reference-period {
              when "../enable='true'";
              must
                "hold-interval>suppress-interval";
              must
                "clear-interval>hold-interval";
              description
                "Configure the reference period.";
              uses reference-period-type;
            }  // container reference-period
    
            container timer {
              when "../enable='true'";
              description
                "Configure BGP global timer parameters.";
              uses global-timer-para-type;
            }  // container timer
    
            uses graceful-restart-status-type;
    
            uses error-discard-info-type;
    
            uses vpn-brief-infos-type;
    
            container default-parameter {
              config false;
              description
                "Statistics of default parameter of BGP.";
              leaf version {
                type uint8;
                description
                  "BGP protocol version.";
              }
    
              leaf connect-retry-time {
                type uint16;
                units "s";
                description
                  "Value of connect retry timer.";
              }
    
              leaf hold-time {
                type uint32;
                units "s";
                description
                  "The holdtime interval.";
              }
    
              leaf keepalive-time {
                type uint32;
                units "s";
                description
                  "The keepalive interval.";
              }
            }  // container default-parameter
    
            container srgbs {
              description
                "List of segment routing global block.";
              list srgb {
                must "lower-bound < upper-bound";
                key "lower-bound";
                max-elements 1;
                description
                  "Configure segment routing global block.";
                leaf lower-bound {
                  type uint32 {
                    range "16..1048575";
                  }
                  description
                    "SRGB begin value. The range of specific values is dynamic and is also affected by paf.";
                }
    
                leaf upper-bound {
                  type uint32 {
                    range "16..1048575";
                  }
                  mandatory true;
                  description
                    "SRGB end value. The range of specific values is dynamic and is also affected by paf. The ending value of SRGB must be greater than the configured value.";
                }
              }  // list srgb
            }  // container srgbs
          }  // container base-process
    
          container instance-processs {
            description
              "List of the global BGP information for the list of all BGP instances, such as the protocol version, AS number, and system identifier.";
            list instance-process {
              key "name";
              max-elements 1;
              description
                "Configure the global BGP information for the BGP instances, such as the protocol version, AS number, and system identifier.";
              leaf name {
                type string {
                  length "1..31";
                }
                must "../name != 'default'";
                description "Name of BGP Site.";
              }
    
              leaf as-number {
                ext:operation-exclude "update" {
                  description "The node cannot be modified when BGP is enabled.";
                }
                type as-number-validate;
                mandatory true;
                description
                  "Local AS number, which can be in either of the two formats:
                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 ranging from 1 to 4294967295.
                An AS consists of instance routers managed based on the same techniques. Interior Gateway Protocol (IGP) and universal routing metric packets are used inside an AS, and Exterior Gateway Protocol (EGP) is used outside to send packets to other ASs. With the development of this definition, one AS usually uses instance IGPs and metrics. Even though instance IGPs and metrics are used, the routing plan and destination reachability of an AS are consistent with those of another AS. The local AS number cannot be configured same as the confederation sub-ASs.";
              }
    
              leaf check-first-as {
                type boolean;
                default "true";
                description
                  "Enable/disable checking the first AS in the AS_Path of the update messages from EBGP peers.";
              }
    
              leaf shutdown {
                type boolean;
                default "false";
                description
                  "Enable/disable interrupting BGP all neighbour.";
              }
    
              leaf private-4byte-as {
                type boolean;
                default "false";
                description
                  "Enable/disable BGP private 4 byte AS. With BGP private-4-byte-as, BGP private as is from 64512 to 65535 and from 4200000000 to 4294967294.";
              }
    
              leaf peer-up-route-lowest-priority {
                type boolean;
                default "false";
                description
                  "Enable/disable reducing route priority to lowest.";
              }
    
              leaf delay-time {
                when
                  "../peer-up-route-lowest-priority='true'";
                type uint32 {
                  range "1..864000";
                }
                units "s";
                description
                  "Specifies the delay time.";
              }
    
              leaf memory-limit {
                type boolean;
                default "false";
                description
                  "Enable/disable using the prefix memory-limit command, you can configure the capability of BGP about memory limit when the system memory usage exceeded.";
              }
    
              container graceful-restart {
                description
                  "Configure the graceful-restart.";
                uses graceful-restart-type;
              }  // container graceful-restart
    
              container reference-period {
                must
                  "hold-interval>suppress-interval";
                must
                  "clear-interval>hold-interval";
                description
                  "Configure the reference period.";
                uses reference-period-type;
              }  // container reference-period
    
              container timer {
                description
                  "Configure BGP global timer parameters.";
                uses global-timer-para-type;
              }  // container timer
            }  // list instance-process
          }  // container instance-processs
        }  // container bgp
    
        augment /ni:network-instance/ni:instances/ni:instance {
          description
            "BGP network instance configuration.";
          container bgp {
            description
              "Configure BGP network instance. All nodes of private VPN Instance in this container can be used only when the value of the global BGP enabling node (/bgp:bgp/bgp:global/bgp:yang-enable) is set to true.";
            container base-process {
              ext:generated-by "system" {
                when "../../ni:name = '_public_'";
                description "The BGP public instance is generated automatically when BGP is enabled.";
              }
              when
                "/bgp:bgp/bgp:base-process/bgp:enable='true'";
              presence "Create vrf session.";
              description
                "Enable/disable BGP instances.";
              leaf router-id-auto-select {
                when
                  "../../../ni:name!='_public_'";
                type boolean;
                default "false";
                description
                  "Enable/disable router ID auto select. If a BGP VPN instance is not enabled to select a router ID, a router ID can be configured for the BGP VPN instance. If no router ID is configured for the BGP VPN instance, the BGP VPN instance inherits the router ID of the public network instance. If a BGP VPN instance is enabled to select a router ID, it uses the address of an interface bound to a VPN as the router ID based on the following rules:
    
                1. If Loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the Loopback interfaces is selected as the router ID.
    
                2. If there is no Loopback interface configured with an IP address, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.";
              }
    
              leaf router-id {
                when
                  "not(../router-id-auto-select) or ../router-id-auto-select = 'false'";
                type inet:ipv4-address-no-zone;
                description
                  "ID of a router that is in IPv4 address format. Certain dynamic routing protocols require a router ID. If no router ID is specified for a router when these protocols are enabled, the router ID in the RM module is used by default. The default router ID in the RM module is 0.0.0.0 when the router is not configured with any interface. 
                 The rules for selecting a router ID are as follows:
                 1. If a router ID is set through this configuration, the set router ID is used. If the router ID is not set, a router ID is selected according to the following rules:
                 (1) If loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the loopback interfaces is selected as the router ID.
                 (2) If no loopback interface configured with an IP address exists, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.
                 The router ID is reselected only when the interface address that is selected as the router ID is deleted or changed. The router ID is not reselected in any of the following cases:
                 a. The interface is Down.
                 b. A loopback interface is configured when the IP address of a non-loopback interface is selected as the router ID.
                 c. A larger IP address of an interface is configured.
                 2. Each VPN instance selects the router ID from the addresses of the interfaces of the VPN instance according to the preceding rules.
                 3. When both the AMB and SMB exist on the router, the system backs up the router ID set through the related command and the router ID that is selected from IP addresses of the interfaces. After the active/standby switchover is performed, the system checks the validity of the router ID selected from the interface addresses. If the router ID is invalid, the system reselects a router ID.";
              }
    
              leaf effect-router-id {
                type inet:ipv4-address-no-zone;
                default "0.0.0.0";
                config false;
                description
                  "Router ID that takes effect.";
              }
    
              container afs {
                description
                  "List of BGP address family instances.";
                list af {
                  ext:generated-by "system" {
                    when "../../../../ni:name = '_public_'";
                    ext:filter "type = 'ipv4uni'";
                    description "The IPv4 unicast of the BGP public instance is generated automatically when BGP is enabled.";
                  }
                  key "type";
                  description
                    "Configure BGP address family instance. In public network instances, all types of address families can be configured. In IPv4 VPN instances, the IPv4 unicast, IPv4 flow, and IPv4 labeled unicast address families can be configured. In IPv6 VPN instances, the IPv6 unicast and IPv6 flow address families can be configured. The IPv4 address family in the BGP _public_ VPN instance cannot be deleted.";
                  leaf type {
                    type af-type;
                    description
                      "Address family type of a BGP instance.";
                  }
    
                  container ipv4-unicast {
                    when "../type = 'ipv4uni'";
                    must
                      "../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                    description
                      "Configure IPv4 unicast options.";
                    container common {
                      description
                        "Configure IPv4 unicast common options.";
                      leaf auto-frr {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP Auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                      }
    
                      leaf tunnel-selector-name {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Configure a tunnel selector and apply it to the BGP IPv4 unicast, BGP VPNv4 address families and BGP VPNv6 address families so that IPv4,VPNv4 and VPNv6 labeled routes can be iterated to tunnels based on the tunnel selector. By default, no tunnel selector is configured.";
                      }
    
                      leaf tunnel-selector-all {
                        when
                          "../tunnel-selector-name";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable tunnel selector for labeled, imported, and network segment routes.";
                      }
    
                      leaf maximum-load-balancing-ibgp {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing>1 or ../maximum-load-balancing-eibgp or ../load-balancing-eibgp-enable='true') or ../maximum-load-balancing-ibgp=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost IBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf maximum-load-balancing-ebgp {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing>1 or ../maximum-load-balancing-eibgp or ../load-balancing-eibgp-enable='true') or ../maximum-load-balancing-ebgp=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost EBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf nexthop-select-depend-type {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type select-depend-type;
                        default "depend-ip";
                        description
                          "Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                        mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                        if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                        networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                        advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                        service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                      }
    
                      leaf nexthop-inherit-ip-cost {
                        when
                          "../nexthop-select-depend-type='depend-tunnel'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop iteration mode to IP. Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP.";
                      }
    
                      leaf nexthop-resolve-aigp {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable route with AIGP attribute for route selection.";
                      }
    
                      leaf summary-automatic {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable automatic summarization for imported routes. Manual summarization takes precedence over automatic summarization. After automatic summarization is enabled, BGP summarizes routes based on the natural network segment (for example, 10.1.1.1/24 and 10.2.1.1/24 are summarized into 10.0.0.0/8, a Class A address), and sends only the summarized route to peers. This reduces the number of routes.";
                      }
    
                      leaf best-route-bit-error-detection {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to reroute traffic when a bit error event occurs.";
                      }
    
                      leaf supernet-unicast-advertise {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to advertise supernet unicast routes.";
                      }
    
                      leaf supernet-label-advertise {
                        type boolean;
                        default "true";
                        description
                          "Enable/disable the function to advertise supernet labeled routes.";
                      }
    
                      leaf lsp-mtu {
                        type uint16 {
                          range "46..65535";
                        }
                        default "1500";
                        description
                          "BGP LSP MTU.";
                      }
    
                      leaf label-free-delay {
                        type uint8 {
                          range "0..180";
                        }
                        units "s";
                        default "0";
                        description
                          "Label Free Delay.";
                      }
    
                      leaf bestroute-med-confederation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare MED value only within the federation.";
                      }
    
                      leaf bestroute-as-path-ignore {
                        type boolean;
                        must
                          "../bestroute-as-path-ignore = 'false' or ../load-balanc-as-path-ignore ='false' or not(../load-balanc-as-path-ignore)";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path attribute when selecting the optimal route. By default, BGP uses the AS_Path attribute as one of route selection rules, and a route with a shorter AS_Path is preferred. After bestroute-as-path-ignore is selected, BGP does not compare the AS_Path length.";
                      }
    
                      leaf determin-med {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable deterministic MED so that the route selection result is relevant to the sequence in which routes are received.";
                      }
    
                      leaf best-external {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "../best-external ='false' or ../determin-med ='false'";
                        default "false";
                        description
                          "Enable/disable best external route selection.";
                      }
    
                      leaf attribute-set-enable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the capability of processing attribute set.";
                      }
    
                      leaf attribute-set-mode {
                        when
                          "../attribute-set-enable='true'";
                        type attribute-set-type;
                        default "both";
                        description
                          "The processing mode of attribute set.";
                      }
    
                      leaf add-path-select-num {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type uint8 {
                          range "2..64";
                        }
                        must
                          "../determin-med ='false'";
                        description
                          "Number of Add-Path routes.";
                      }
    
                      leaf load-balanc-igp-metric-ignore {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore the IGP cost of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same IGP cost can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-ignore {
                        type boolean;
                        must
                          "../load-balanc-as-path-ignore ='false' or (../load-balanc-as-path-relax ='false' and ../bestroute-as-path-ignore ='false')";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-relax {
                        type boolean;
                        must
                          "../load-balanc-as-path-relax ='false' or ../load-balanc-as-path-ignore ='false'";
                        default "false";
                        description
                          "Enable/disable BGP to ignore comparison of AS_Path attributes with the same length. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf maximum-load-balancing {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing-ibgp>1 or ../maximum-load-balancing-ebgp>1 or ../maximum-load-balancing-eibgp) or ../maximum-load-balancing=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost routes in the BGP routing table. The value can be 1 or an integer greater than 1. The value depends on the associated license. Equal-cost BGP routes can be generated for load balancing only when the BGP routes meet the first nine rules of the route-selection policy and have the same AS-Path attribute. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf import-rib-nexthop-invariable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to advertise the route without modifying the next-hop.";
                      }
    
                      leaf route-relay-tunnel {
                        type boolean;
                        must
                          "not(../route-relay-tunnel='true' and /rt:routing/rt:routing-manage/rt:relay-tunnel/rt:enable='true')";
                        default "false";
                        description
                          "Enable/disable unicast route recursive-lookup tunnel.";
                      }
    
                      leaf route-relay-tunnel-selector {
                        when
                          "../route-relay-tunnel='true'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Unicast route tunnel selector name.";
                      }
    
                      leaf route-relay-tunnel-v6-selector {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Enable/disable unicast route recursive-lookup IPv6 tunnel by tunnel selector name.";
                      }
    
                      uses bestroute-med-plus-igp-type;
    
                      uses bestroute-router-id-prior-clusterlist-type;
    
                      leaf bestroute-med-none-as-maximum {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP considers its MED as the largest MED value (4294967295). If a route does not carry MED, BGP considers its MED as the default value (0) during route selection.";
                      }
    
                      leaf bestroute-rd-large-first {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable a BGP device to select the route with the largest route distinguisher (RD) during route selection.";
                      }
    
                      leaf ebgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-ebgp and ../maximum-load-balancing-ebgp>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost EBGP routes is changed. When equal-cost EBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost EBGP routes is greater than 1.";
                      }
    
                      leaf ibgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-ibgp and ../maximum-load-balancing-ibgp>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost IBGP routes is changed. When equal-cost IBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost IBGP routes is greater than 1.";
                      }
    
                      leaf ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing and ../maximum-load-balancing>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost routes is changed. When equal-cost BGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost BGP routes is greater than 1.";
                      }
    
                      leaf maximum-load-balancing-eibgp {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "../maximum-load-balancing-ibgp=1 and ../maximum-load-balancing-ebgp=1 and ../maximum-load-balancing=1 and ../load-balancing-eibgp-enable='false'";
                        description
                          "Specify the maximum number of equal-cost EBGP routes and IBGP routes. After the attribute is set, load balancing is performed among equal-cost BGP VPN routes, regardless of the route type, EBGP or IBGP. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf eibgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-eibgp";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost EBGP and IBGP routes is changed. When equal-cost EBGP and IBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised.";
                      }
    
                      leaf load-balancing-eibgp-enable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        must
                          "not (../maximum-load-balancing-ibgp>1 or ../maximum-load-balancing-ebgp>1 or ../maximum-load-balancing-eibgp) or ../load-balancing-eibgp-enable='false'";
                        default "false";
                        description
                          "Enable/disable EIBGP route load balancing.";
                      }
    
                      leaf nexthop-priority {
                        type nexthop-priority-address-type;
                        description
                          "Routes with next-hop IPv4 addresses and routes with next-hop IPv6 addresses coexist. If the next-hop address type is set to IPv4, routes with next-hop IPv4 addresses have a higher priority. If the next-hop address type is set to IPv6, routes with next-hop IPv6 addresses have a higher priority.";
                      }
    
                      uses group-origin-as-validation-type;
    
                      leaf advertise-route-mode {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type bgp-advertise-route-mode;
                        default "all";
                        description
                          "VPN advertise route mode.";
                      }
    
                      leaf reoriginate-route {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable route reorigination.";
                      }
    
                      leaf rpd-policy-change-delay {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type uint16 {
                          range "0..180";
                        }
                        default "30";
                        description
                          "Specify the delay time of RPD policy's change.";
                      }
    
                      uses common-configure;
    
                      leaf load-balancing-ucmp {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function of BGP UCMP.";
                      }
                    }  // container common
    
                    uses bgp-route-preference-options;
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        uses nexthop-recursive-lookup-restrain;
    
                        uses nexthop-recursive-lookup-default-route;
                      }  // container common
    
                      uses nexthop-recursive-lookup-delay;
                    }  // container nexthop-recursive-lookup
    
                    container import-routes {
                      description
                        "List of imported routes.";
                      list import-route {
                        key "protocol process-id";
                        description
                          "Configure route import. Routes of other protocol types can be imported by BGP. By default, BGP does not import routes of other protocol types.";
                        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";
                          }
                          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
    
                        leaf non-relay-tunnel {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported route relay a tunnel.";
                        }
                      }  // list import-route
                    }  // container import-routes
    
                    container aggregate-routes {
                      description
                        "List of summarized routes.";
                      list aggregate-route {
                        key "address mask-length";
                        description
                          "Configure a summarized route in the BGP routing table. The local outbound interface of the summarized route is Null0. When another router receives the route, the route adds an outbound interface to the route. If the Origin attributes of the specific routes for the route summarization are different, the Origin attribute of the summarized route is that with the highest priority. Origin attributes are arranged in the priority order of complete > egp > igp. A summarized route carries the community attribute of each specific route.";
                        uses unicast-aggregate-routes-type {
                          refine address {
                            must
                              "not(contains(../address,':'))";
                          }
    
                          refine mask-length {
                            must
                              "../mask-length<=32";
                          }
                        }
                      }  // list aggregate-route
                    }  // container aggregate-routes
    
                    uses ipv4-aggregate-default-route;
    
                    container network-routes {
                      description
                        "List of network routes.";
                      list network-route {
                        key "address mask-length";
                        description
                          "Configure a network route in the BGP routing table.";
                        uses network-route-ipv4;
    
                        leaf non-relay-tunnel {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported route relay a tunnel.";
                        }
    
                        leaf label-index {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type uint32 {
                            range
                              "0..4294967294";
                          }
                          description
                            "Management label value assigned for imported routes.";
                        }
                      }  // list network-route
                    }  // container network-routes
    
                    container advertise-route-to-evpns {
                      when
                        "../../../../../../ni:name!='_public_'";
                      description
                        "Configure advertise route protocol.";
                      uses advertise-route-to-evpn-type;
                    }  // container advertise-route-to-evpns
    
                    container import-ribs {
                      description
                        "List of imported RIBs configuration.";
                      list import-rib {
                        key "source-vpn source-address-family";
                        description
                          "Configure imported RIBs.";
                        leaf source-vpn {
                          type leafref {
                            path
                              "/ni:network-instance/ni:instances/ni:instance/ni:name";
                          }
                          must
                            "not(../../../../../../../../ni:name = current() and ../source-address-family = 'ipv4uni')";
                          description
                            "Source VPN name.";
                        }
    
                        leaf source-address-family {
                          type import-rib-ipv4-safi-type;
                          description
                            "Source address family type.";
                        }
    
                        leaf valid-route {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported valid route.";
                        }
    
                        leaf include-label-route {
                          when
                            "../source-address-family='ipv4uni'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported include label route.";
                        }
    
                        uses choice-policy-set;
                      }  // list import-rib
                    }  // container import-ribs
    
                    uses ipv4-import-filter-protocol-type;
    
                    uses ipv4-export-filter-policys;
    
                    container lsp-options {
                      description
                        "Configure parameters for lsp.";
                      uses safi-lsp-options;
    
                      leaf maximum-load-balancing-transit {
                        type uint16 {
                          range "1..65535";
                        }
                        default "1";
                        description
                          "Maximum number of transit LSPs for load balancing.";
                      }
    
                      leaf unicast-rt-label-advertise {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default 'false';
                        description
                          "Enable/disable a device to convert received IPv4 public network unicast routes to labeled routes by allocating one BGP label to each route and advertise the labeled routes to peers with the labeled route exchange capability.";
                      }
    
                      leaf unicast-rt-label-advertise-popgo {
                        when
                          "../unicast-rt-label-advertise = 'true'";
                        type boolean;
                        default 'false';
                        description
                          "Enable/disable a device to convert received IPv4 public network unicast routes to labeled routes by adding a BGP label to each route and advertise the labeled routes to peers with the labeled route exchange capability. If the IP address of an outbound interface is reachable but no LSP is reachable, traffic is forwarded through the outbound interface and a specific next hop, during which the label POPGO action is performed.";
                      }
    
                      leaf lsp-operation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type lsp-operation-type;
                        default "pop";
                        description
                          "Label operation type.";
                      }
    
                      uses ingress-choice-policy-set;
                    }  // container lsp-options
    
                    container segment-routing-ipv6 {
                      description
                        "Configure BGP segment-routing IPv6.";
                      leaf srv6-best-effort-enable {
                        type empty;
                        description
                          "Enable SRv6 BE iteration.";
                      }
    
                      leaf srv6-traffic-engineer-enable {
                        type empty;
                        description
                          "Enable SRv6 TE iteration.";
                      }
                    }  // container segment-routing-ipv6
    
                    container hierarchy-convergence {
                      when
                        "../../../../../../ni:name='_public_'";
                      description
                        "Configure unicast route hierarchy convergence.";
                      uses ipv4-hierarchy-convergence;
                    }  // container hierarchy-convergence
    
                    uses vrf-af-dampening-routes;
    
                    uses bgp:slow-peer-type;
    
                    uses routing-table-rib-only-type {
                      refine routing-table-rib-only/enable {
                        must
                          "not (../../common/active-route-advertise = 'true' and ../enable = 'true')";
                      }
                    }
    
                    uses qos-local-id-type;
    
                    container instance-import-ribs {
                      description
                        "List of imported RIBs from multi BGP instances configuration.";
                      list instance-import-rib {
                        key "source-instance source-vpn source-address-family";
                        description
                          "Configure imported RIBs.";
                        leaf source-instance {
                          type leafref {
                            path
                              "/bgp:bgp/bgp:instance-processs/bgp:instance-process/bgp:name";
                          }
                          description
                            "Configure source BGP instance.";
                        }
    
                        leaf source-vpn {
                          type leafref {
                            path
                              "/ni:network-instance/ni:instances/ni:instance/ni:name";
                          }
                          must
                            "../../../../../../../../ni:name != current() and ../../../../../../../../ni:name != '_public_'";
                          description
                            "Source VPN name.";
                        }
    
                        leaf source-address-family {
                          type vrf-import-rib-ipv4-safi-type;
                          description
                            "Source address family type.";
                        }
    
                        leaf valid-route {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported valid route.";
                        }
    
                        leaf include-label-route {
                          when
                            "../source-address-family='ipv4uni'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported include label route.";
                        }
    
                        uses choice-policy-set;
                      }  // list instance-import-rib
                    }  // container instance-import-ribs
    
                    uses region-validation-grp;
                  }  // container ipv4-unicast
    
                  container ipv6-unicast {
                    when "../type = 'ipv6uni'";
                    must
                      "../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                    description
                      "Configure IPv6 unicast options.";
                    container common {
                      description
                        "Configure IPv6 unicast common options.";
                      leaf router-id-auto-select {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable router ID auto select. If a BGP VPN instance is not enabled to select a router ID, a router ID can be configured for the BGP VPN instance. If no router ID is configured for the BGP VPN instance, the BGP VPN instance inherits the router ID of the public network instance. If a BGP VPN instance is enabled to select a router ID, it uses the address of an interface bound to a VPN as the router ID based on the following rules:
    
                        1. If Loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the Loopback interfaces is selected as the router ID.
    
                        2. If there is no Loopback interface configured with an IP address, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.";
                      }
    
                      leaf router-id {
                        when
                          "../../../../../../../ni:name!='_public_' and ../router-id-auto-select = 'false'";
                        type inet:ipv4-address-no-zone;
                        description
                          "ID of a router that is in IPv4 address format. Certain dynamic routing protocols require a router ID. If no router ID is specified for a router when these protocols are enabled, the router ID in the RM module is used by default. The default router ID in the RM module is 0.0.0.0 when the router is not configured with any interface. 
                         The rules for selecting a router ID are as follows:
                         1. If a router ID is set through this configuration, the set router ID is used. If the router ID is not set, a router ID is selected according to the following rules:
                         (1) If loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the loopback interfaces is selected as the router ID.
                         (2) If no loopback interface configured with an IP address exists, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.
                         The router ID is reselected only when the interface address that is selected as the router ID is deleted or changed. The router ID is not reselected in any of the following cases:
                         a. The interface is Down.
                         b. A loopback interface is configured when the IP address of a non-loopback interface is selected as the router ID.
                         c. A larger IP address of an interface is configured.
                         2. Each VPN instance selects the router ID from the addresses of the interfaces of the VPN instance according to the preceding rules.
                         3. When both the AMB and SMB exist on the router, the system backs up the router ID set through the related command and the router ID that is selected from IP addresses of the interfaces. After the active/standby switchover is performed, the system checks the validity of the router ID selected from the interface addresses. If the router ID is invalid, the system reselects a router ID.";
                      }
    
                      leaf auto-frr {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                      }
    
                      leaf maximum-load-balancing-ibgp {
                        type uint16 {
                          range "1..65535";
                        }
                        default "1";
                        description
                          "Specify the maximum number of equal-cost IBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf maximum-load-balancing-ebgp {
                        type uint16 {
                          range "1..65535";
                        }
                        default "1";
                        description
                          "Specify the maximum number of equal-cost EBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf explicit-null {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "not(../lsp-operation='pop-go' and ../explicit-null='true')";
                        default "false";
                        description
                          "Enable/disable the function to explicit null. After 6PE routes are enabled to share a single label, all routes share the explicit-null label 2 when the 6PE sends IPv6 routes to its 6PE peer. This can save label resources on the 6PE. Therefore, when there are a large number of IPv6 routes that need to be sent, the problem that the IPv6 routes cannot be forwarded due to the shortage of labels can be avoided.";
                      }
    
                      leaf lsp-operation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type lsp-operation-type;
                        must
                          "not(../lsp-operation='pop-go' and ../explicit-null='true')";
                        default "pop";
                        description
                          "Label operation mode.";
                      }
    
                      leaf nexthop-select-depend-type {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type select-depend-type;
                        default "depend-tunnel";
                        description
                          "Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                        mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                        if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                        networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                        advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                        service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                      }
    
                      leaf nexthop-inherit-ip-cost {
                        when
                          "../nexthop-select-depend-type='depend-tunnel'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop iteration mode to IP. Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP.";
                      }
    
                      leaf nexthop-resolve-aigp {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable route with AIGP attribute for route selection.";
                      }
    
                      leaf supernet-unicast-advertise {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable advertise supernet unicast routes.";
                      }
    
                      leaf bestroute-med-confederation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare Med value only within the federation.";
                      }
    
                      leaf bestroute-as-path-ignore {
                        type boolean;
                        must
                          "../bestroute-as-path-ignore = 'false' or ../load-balanc-as-path-ignore ='false' or not(../load-balanc-as-path-ignore)";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path attribute when selecting the optimal route. By default, BGP uses the AS_Path attribute as one of route selection rules, and a route with a shorter AS_Path is preferred. After bestroute-as-path-ignore is selected, BGP does not compare the AS_Path length.";
                      }
    
                      leaf determin-med {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable deterministic MED so that the route selection result is relevant to the sequence in which routes are received.";
                      }
    
                      leaf best-external {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "../best-external ='false' or ../determin-med ='false'";
                        default "false";
                        description
                          "Enable/disable best external route selection.";
                      }
    
                      leaf attribute-set-enable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the capability of processing attribute set.";
                      }
    
                      leaf attribute-set-mode {
                        when
                          "../attribute-set-enable='true'";
                        type attribute-set-type;
                        default "both";
                        description
                          "The processing mode of attribute set.";
                      }
    
                      leaf add-path-select-num {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type uint8 {
                          range "2..64";
                        }
                        must
                          "../determin-med ='false'";
                        description
                          "Number of add-path routes.";
                      }
    
                      leaf load-balanc-igp-metric-ignore {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore the IGP cost of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same IGP cost can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-ignore {
                        type boolean;
                        must
                          "../load-balanc-as-path-ignore ='false' or (../load-balanc-as-path-relax ='false' and ../bestroute-as-path-ignore ='false')";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-relax {
                        type boolean;
                        must
                          "../load-balanc-as-path-relax ='false' or ../load-balanc-as-path-ignore ='false'";
                        default "false";
                        description
                          "Enable/disable BGP to ignore comparison of AS_Path attributes with the same length. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf maximum-load-balancing {
                        type uint16 {
                          range "1..65535";
                        }
                        default "1";
                        description
                          "Specify the maximum number of equal-cost routes in the BGP routing table. The value depends on the associated license. Equal-cost BGP routes can be generated for load balancing only when the BGP routes meet the first nine rules of the route-selection policy and have the same AS-Path attribute. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf best-route-bit-error-detection {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to reroute traffic when a bit error event occurs.";
                      }
    
                      leaf import-rib-nexthop-invariable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable advertise the route without modifying the next-hop.";
                      }
    
                      leaf route-relay-tunnel-v4 {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable unicast-route recursive-lookup tunnel.";
                      }
    
                      leaf route-relay-tunnel-v4-selector {
                        when
                          "../route-relay-tunnel-v4='true'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Unicast route tunnel selector name.";
                      }
    
                      leaf route-relay-tunnel-v6-selector {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Enable/disable unicast route recursive-lookup IPv6 tunnel by tunnel selector name.";
                      }
    
                      uses bestroute-med-plus-igp-type;
    
                      uses bestroute-router-id-prior-clusterlist-type;
    
                      leaf bestroute-med-none-as-maximum {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP considers its MED as the largest MED value (4294967295). If a route does not carry MED, BGP considers its MED as the default value (0) during route selection.";
                      }
    
                      leaf bestroute-rd-large-first {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable a BGP device to select the route with the largest route distinguisher (RD) during route selection.";
                      }
    
                      leaf nexthop-priority {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type nexthop-priority-address-type;
                        description
                          "In the VRF instance, routes with next-hop IPv4 addresses and routes with next-hop IPv6 addresses coexist. If the next-hop address type is set to IPv4, routes with next-hop IPv4 addresses have a higher priority. If the next-hop address type is set to IPv6, routes with next-hop IPv6 addresses have a higher priority.";
                      }
    
                      leaf ebgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-ebgp and ../maximum-load-balancing-ebgp>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost EBGP routes is changed. Enable/disable next hop of equal-cost EBGP routes is changed. When equal-cost EBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost EBGP routes is greater than 1.";
                      }
    
                      leaf ibgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-ibgp and ../maximum-load-balancing-ibgp>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost IBGP routes is changed. When equal-cost IBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost IBGP routes is greater than 1.";
                      }
    
                      leaf ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing and ../maximum-load-balancing>1";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost routes is changed. When equal-cost BGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised. This function can be enabled only when the maximum number of equal-cost BGP routes is greater than 1.";
                      }
    
                      leaf maximum-load-balancing-eibgp {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "../maximum-load-balancing-ibgp=1 and ../maximum-load-balancing-ebgp=1 and ../maximum-load-balancing=1 and ../load-balancing-eibgp-enable='false'";
                        description
                          "Specify the maximum number of equal-cost EBGP routes and IBGP routes. After the attribute is set, load balancing is performed among equal-cost BGP VPN routes, regardless of the route type, EBGP or IBGP. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf eibgp-ecmp-nexthop-changed {
                        when
                          "../maximum-load-balancing-eibgp";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop of equal-cost EBGP and IBGP routes is changed. When equal-cost EBGP and IBGP routes are load-balancing traffic, the next hop of these routes is changed to a local interface before these routes are advertised.";
                      }
    
                      leaf load-balancing-eibgp-enable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        must
                          "not (../maximum-load-balancing-ibgp>1 or ../maximum-load-balancing-ebgp>1 or ../maximum-load-balancing-eibgp) or ../load-balancing-eibgp-enable='false'";
                        default "false";
                        description
                          "Enable/disable EIBGP route load balancing.";
                      }
    
                      uses group-origin-as-validation-type;
    
                      leaf advertise-route-mode {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type bgp-advertise-route-mode;
                        default "all";
                        description
                          "VPN advertise route mode.";
                      }
    
                      uses common-configure;
    
                      leaf load-balancing-ucmp {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function of BGP UCMP.";
                      }
                    }  // container common
    
                    uses bgp-route-preference-options;
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        uses nexthop-recursive-lookup-restrain;
    
                        uses nexthop-recursive-lookup-default-route;
                      }  // container common
    
                      uses nexthop-recursive-lookup-delay;
                    }  // container nexthop-recursive-lookup
    
                    uses ipv6-import-route;
    
                    uses ipv6-aggregate-routes;
    
                    uses ipv6-aggregate-default-route;
    
                    container network-routes {
                      description
                        "List of network routes.";
                      list network-route {
                        key "address mask-length";
                        description
                          "Configure a network route in the BGP routing table.";
                        uses network-route-ipv6;
                      }  // list network-route
                    }  // container network-routes
    
                    container advertise-route-to-evpns {
                      when
                        "../../../../../../ni:name!='_public_'";
                      description
                        "Configure advertise route protocol.";
                      uses advertise-route-to-evpn-type;
                    }  // container advertise-route-to-evpns
    
                    container import-ribs {
                      description
                        "List of imported RIBs configuration.";
                      list import-rib {
                        key "source-vpn source-address-family";
                        description
                          "Configure imported RIBs.";
                        leaf source-vpn {
                          type leafref {
                            path
                              "/ni:network-instance/ni:instances/ni:instance/ni:name";
                          }
                          must
                            "../../../../../../../../ni:name != current()";
                          description
                            "Source VPN name for imported RIBs.";
                        }
    
                        leaf source-address-family {
                          type import-rib-ipv6-safi-type;
                          description
                            "Source address family type for imported RIBs.";
                        }
    
                        leaf valid-route {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported valid route.";
                        }
    
                        leaf include-label-route {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported include label route.";
                        }
    
                        uses choice-policy-set;
                      }  // list import-rib
                    }  // container import-ribs
    
                    container segment-routing-ipv6 {
                      description
                        "Configure BGP segment-routing IPv6.";
                      leaf srv6-best-effort-enable {
                        type empty;
                        description
                          "Enable SRv6 BE iteration.";
                      }
    
                      leaf srv6-traffic-engineer-enable {
                        type empty;
                        description
                          "Enable SRv6 TE iteration.";
                      }
                    }  // container segment-routing-ipv6
    
                    container hierarchy-convergence {
                      when
                        "../../../../../../ni:name='_public_'";
                      description
                        "Configure unicast route hierarchy convergence.";
                      uses ipv6-hierarchy-convergence;
                    }  // container hierarchy-convergence
    
                    uses vrf-af-dampening-routes;
    
                    uses ipv6-import-filter-protocol-type;
    
                    uses ipv6-export-filter-protocol-type;
    
                    uses bgp:slow-peer-type;
    
                    uses routing-table-rib-only-type {
                      refine routing-table-rib-only/enable {
                        must
                          "not (../../common/active-route-advertise = 'true' and ../enable = 'true')";
                      }
                    }
    
                    uses ipv6-qos-local-id-type;
    
                    uses region-validation-grp;
                  }  // container ipv6-unicast
    
                  container ipv4-vpn {
                    when "../type = 'ipv4vpn'";
                    description
                      "Configure IPv4 VPNv4 options.";
                    uses vpn-target-type;
    
                    uses reflector-cluster-type;
    
                    uses reflect-type;
    
                    leaf auto-frr {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable BGP Auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                    }
    
                    leaf tunnel-selector-name {
                      type leafref {
                        path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                      }
                      description
                        "Configure a tunnel selector and apply it to the BGP IPv4 unicast, BGP VPNv4 address families and BGP VPNv6 address families so that IPv4,VPNv4 and VPNv6 labeled routes can be iterated to tunnels based on the tunnel selector.";
                    }
    
                    leaf route-select-delay {
                      type uint16 {
                        range "0..3600";
                      }
                      units "s";
                      default "0";
                      description
                        "Route selection delay.";
                    }
    
                    leaf apply-label-mode {
                      type apply-label-type;
                      default "per-route";
                      description
                        "Method of distributing labels to VPNV4 and VPNV6 routes. The way which assigns the label depends on the paf value. If there are a large number of routes, assign a label for the routes that have same nexthop and out-label. This allows all routes which have same nexthop and out-label to use one label.";
                    }
    
                    leaf nexthop-select-depend-type {
                      type select-depend-type-ext;
                      default "depend-ip";
                      description
                        "In none mode, route selection does not depend on whether the next hop is reachable. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                      mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                      if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                      networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                      advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                      service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                    }
    
                    leaf default-med {
                      type uint32;
                      default "0";
                      description
                        "Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer. This value is valid only for the imported routes and BGP summarized routes on the local router.";
                    }
    
                    leaf best-external {
                      when
                        "../../../../../../ni:name='_public_'";
                      type boolean;
                      default "false";
                      description
                        "Enable/disable best external route selection.";
                    }
    
                    leaf label-free-delay {
                      type uint8 {
                        range "0..180";
                      }
                      units "s";
                      default "0";
                      description
                        "Label free delay.";
                    }
    
                    leaf add-path-select-num {
                      when
                        "../../../../../../ni:name='_public_'";
                      type uint8 {
                        range "2..64";
                      }
                      description
                        "Number of Add-Path routes.";
                    }
    
                    leaf default-local-preference {
                      type uint32 {
                        range "0..4294967295";
                      }
                      default "100";
                      description
                        "The local preference of BGP routes.";
                    }
    
                    uses bestroute-med-plus-igp-type;
    
                    uses bestroute-router-id-prior-clusterlist-type;
    
                    leaf reflect-between-client {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable route reflection between clients. If clients of a route reflector (RR) are fully meshed, you can disable route reflection among clients to reduce the cost.";
                    }
    
                    leaf activate-route-tag {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable tag-based filtering.";
                    }
    
                    uses route-reflector-ext-community-filter-type;
    
                    uses load-balancing-configuration;
    
                    uses vrf-af-dampening-routes-ext;
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        uses nexthop-recursive-lookup-restrain;
    
                        uses nexthop-recursive-lookup-default-route;
                      }  // container common
    
                      uses nexthop-recursive-lookup-delay;
    
                      uses bit-error-detection-type;
                    }  // container nexthop-recursive-lookup
    
                    uses ipv4-import-filter-protocol-type;
    
                    uses ipv4vpn-export-filter-protocol-type;
    
                    uses bgp:slow-peer-type;
                  }  // container ipv4-vpn
    
                  container ipv6-vpn {
                    when "../type = 'ipv6vpn'";
                    description
                      "Configure IPv6 VPNv6 options.";
                    uses vpn-target-type;
    
                    uses reflector-cluster-type;
    
                    uses reflect-type;
    
                    leaf auto-frr {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable BGP Auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                    }
    
                    leaf tunnel-selector-name {
                      type leafref {
                        path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                      }
                      description
                        "Configure a tunnel selector and apply it to the BGP IPv4 unicast, BGP VPNv4 address families and BGP VPNv6 address families so that IPv4,VPNv4 and VPNv6 labeled routes can be iterated to tunnels based on the tunnel selector. By default, no tunnel selector is configured.";
                    }
    
                    leaf route-select-delay {
                      type uint16 {
                        range "0..3600";
                      }
                      units "s";
                      default "0";
                      description
                        "Route selection delay.";
                    }
    
                    leaf apply-label-mode {
                      type apply-label-type;
                      default "per-route";
                      description
                        "Method of distributing labels to VPNV4 and VPNV6 routes. The way which assigns the label depends on the paf value. If there are a large number of routes, assign a label for the routes that have same nexthop and out-label. This allows all routes which have same nexthop and out-label to use one label.";
                    }
    
                    leaf nexthop-select-depend-type {
                      type select-depend-type-ext;
                      default "depend-ip";
                      description
                        "In none mode, route selection does not depend on whether the next hop is reachable. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                      mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                      if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                      networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                      advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                      service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                    }
    
                    leaf default-med {
                      type uint32;
                      default "0";
                      description
                        "Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer. This value is valid only for the imported routes and BGP summarized routes on the local router.";
                    }
    
                    leaf best-external {
                      when
                        "../../../../../../ni:name='_public_'";
                      type boolean;
                      default "false";
                      description
                        "Enable/disable best external route selection.";
                    }
    
                    leaf add-path-select-num {
                      when
                        "../../../../../../ni:name='_public_'";
                      type uint8 {
                        range "2..64";
                      }
                      description
                        "Number of add-path routes.";
                    }
    
                    leaf default-local-preference {
                      type uint32 {
                        range "0..4294967295";
                      }
                      default "100";
                      description
                        "The local preference of BGP routes.";
                    }
    
                    uses bestroute-med-plus-igp-type;
    
                    uses bestroute-router-id-prior-clusterlist-type;
    
                    leaf reflect-between-client {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable route reflection between clients. If clients of a route reflector (RR) are fully meshed, you can disable route reflection among clients to reduce the cost.";
                    }
    
                    leaf label-free-delay {
                      type uint8 {
                        range "0..180";
                      }
                      units "s";
                      default "0";
                      description
                        "Label free delay.";
                    }
    
                    uses route-reflector-ext-community-filter-type;
    
                    uses load-balancing-configuration;
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        uses nexthop-recursive-lookup-restrain;
    
                        uses nexthop-recursive-lookup-default-route;
                      }  // container common
    
                      uses nexthop-recursive-lookup-delay;
    
                      uses bit-error-detection-type;
                    }  // container nexthop-recursive-lookup
    
                    uses ipv6-import-filter-protocol-type;
    
                    uses ipv6vpn-export-filter-protocol-type;
    
                    uses bgp:slow-peer-type;
    
                    uses vrf-af-dampening-routes-ext;
                  }  // container ipv6-vpn
    
                  container ipv4-labeluni {
                    when
                      "../type = 'ipv4labeluni'";
                    must
                      "../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                    description
                      "Configure IPv4 label unicast options.";
                    container common {
                      description
                        "Configure IPv4 label unicast common options.";
                      leaf auto-frr {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP Auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                      }
    
                      leaf tunnel-selector-name {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Configure a tunnel selector and apply it to the BGP IPv4 unicast, BGP VPNv4 address families and BGP VPNv6 address families so that IPv4,VPNv4 and VPNv6 labeled routes can be iterated to tunnels based on the tunnel selector. By default, no tunnel selector is configured.";
                      }
    
                      leaf tunnel-selector-all {
                        when
                          "../tunnel-selector-name";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable tunnel selector for labeled, imported, and network segment routes.";
                      }
    
                      leaf nexthop-select-depend-type {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type select-depend-type;
                        default "depend-tunnel";
                        description
                          "Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                        mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                        if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                        networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                        advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                        service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                      }
    
                      leaf nexthop-inherit-ip-cost {
                        when
                          "../nexthop-select-depend-type='depend-tunnel'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable next hop iteration mode to IP. Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP.";
                      }
    
                      leaf always-compare-med {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare the MEDs of routes from peers in different ASs in route selection. If 
                        there are multiple reachable routes to the same destination, the route with the smallest MED is preferred. Do not use this option unless different ASs use the same IGP and route selection mode.";
                      }
    
                      leaf default-med {
                        type uint32;
                        default "0";
                        description
                          "Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer. This value is valid only for the imported routes and BGP summarized routes on the local router.";
                      }
    
                      leaf best-route-bit-error-detection {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to reroute traffic when a bit error event occurs.";
                      }
    
                      leaf supernet-label-advertise {
                        type boolean;
                        default "true";
                        description
                          "Enable/disable the function to advertise supernet labeled routes.";
                      }
    
                      leaf lsp-mtu {
                        type uint16 {
                          range "46..65535";
                        }
                        default "1500";
                        description
                          "BGP LSP MTU.";
                      }
    
                      leaf label-free-delay {
                        type uint8 {
                          range "0..180";
                        }
                        units "s";
                        default "0";
                        description
                          "Label free delay.";
                      }
    
                      leaf bestroute-med-confederation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare Med value only within the federation.";
                      }
    
                      leaf bestroute-as-path-ignore {
                        type boolean;
                        must
                          "../bestroute-as-path-ignore = 'false' or ../load-balanc-as-path-ignore ='false' or not(../load-balanc-as-path-ignore)";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path attribute when selecting the optimal route. By default, BGP uses the AS_Path attribute as one of route selection rules, and a route with a shorter AS_Path is preferred. After bestroute-as-path-ignore is selected, BGP does not compare the AS_Path length.";
                      }
    
                      leaf determin-med {
                        type boolean;
                        must
                          "../determin-med ='false' or (not(../add-path-select-num) and (../best-external ='false' or not(../best-external)))";
                        default "false";
                        description
                          "Enable/disable deterministic MED so that the route selection result is relevant to the sequence in which routes are received.";
                      }
    
                      leaf best-external {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "../best-external ='false' or ../determin-med ='false'";
                        default "false";
                        description
                          "Enable/disable best external route selection.";
                      }
    
                      leaf add-path-select-num {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type uint8 {
                          range "2..64";
                        }
                        must
                          "../determin-med ='false'";
                        description
                          "Number of add-path routes.";
                      }
    
                      leaf load-balanc-igp-metric-ignore {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore the IGP cost of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same IGP cost can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-ignore {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "../load-balanc-as-path-ignore ='false' or (../load-balanc-as-path-relax ='false' and ../bestroute-as-path-ignore ='false')";
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path of each BGP route to the next hop when selecting routes for load balancing. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf load-balanc-as-path-relax {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        must
                          "../load-balanc-as-path-relax ='false' or ../load-balanc-as-path-ignore ='false'";
                        default "false";
                        description
                          "Enable/disable BGP to ignore comparison of AS_Path attributes with the same length. By default, only the routes with the same AS_Path can participate in load balancing.";
                      }
    
                      leaf default-local-preference {
                        type uint32 {
                          range "0..4294967295";
                        }
                        default "100";
                        description
                          "The local preference of BGP routes.";
                      }
    
                      leaf default-route-import {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to import default routes into the BGP routing table. Default-route-imported must be used with import-routes so that default routes can be imported to the BGP routing table. If only import-routes is used, no default routes can be added to the BGP routing table. In addition, default-route-imported can only import the default routes in the routing table into the BGP routing table.";
                      }
    
                      leaf routerid-neglect {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore router IDs when selecting the optimal route. Comparing router IDs is the last resort in route selection. This means that if one optimal route must be selected and no other parameters can be used to break the tie, router IDs can be used. If this option is selected, the first received route will be selected as the optimal route, and BGP will ignore the router ID and peer address in route selection.";
                      }
    
                      leaf route-select-delay {
                        type uint16 {
                          range "0..3600";
                        }
                        units "s";
                        default "0";
                        description
                          "Route selection delay.";
                      }
    
                      leaf import-rib-nexthop-invariable {
                        when
                          "../../../../../../../ni:name!='_public_'";
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the command to enable advertise the route without modifying the next-hop.";
                      }
    
                      uses reflect-type;
    
                      uses reflector-cluster-type;
    
                      leaf reflect-between-client {
                        type boolean;
                        default "true";
                        description
                          "Enable/disable route reflection between clients. If clients of a route reflector (RR) are fully meshed, you can disable route reflection among clients to reduce the cost.";
                      }
    
                      uses bestroute-med-plus-igp-type;
    
                      uses bestroute-router-id-prior-clusterlist-type;
    
                      leaf bestroute-med-none-as-maximum {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP considers its MED as the largest MED value (4294967295). If a route does not carry MED, BGP considers its MED as the default value (0) during route selection.";
                      }
    
                      leaf ext-community-change {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to change the extended community attribute.";
                      }
                    }  // container common
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        uses nexthop-recursive-lookup-restrain;
                      }  // container common
                    }  // container nexthop-recursive-lookup
    
                    container import-routes {
                      description
                        "List of imported routes.";
                      list import-route {
                        key "protocol process-id";
                        description
                          "Apply route import policy. Routes of other protocol types can be imported by BGP. By default, BGP does not import routes of other protocol types.";
                        uses import-routes-type;
    
                        leaf non-relay-tunnel {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported route relay a tunnel.";
                        }
                      }  // list import-route
                    }  // container import-routes
    
                    container network-routes {
                      description
                        "List of network routes.";
                      list network-route {
                        key "address mask-length";
                        description
                          "Configure a network route in the BGP routing table.";
                        uses network-route-ipv4;
    
                        leaf non-relay-tunnel {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported route relay a tunnel.";
                        }
    
                        leaf label-index {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type uint32 {
                            range
                              "0..4294967294";
                          }
                          description
                            "Management label value assigned for imported routes.";
                        }
                      }  // list network-route
                    }  // container network-routes
    
                    container import-ribs {
                      description
                        "List of imported RIBs configuration.";
                      list import-rib {
                        key "source-vpn source-address-family";
                        description
                          "Configure imported RIBs.";
                        leaf source-vpn {
                          type leafref {
                            path
                              "/ni:network-instance/ni:instances/ni:instance/ni:name";
                          }
                          must
                            "not(../../../../../../../../ni:name = current() and ../source-address-family = 'ipv4labeluni')";
                          description
                            "Source VPN name.";
                        }
    
                        leaf source-address-family {
                          type import-rib-ipv4-safi-type;
                          description
                            "Source address family type.";
                        }
    
                        leaf valid-route {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported valid route.";
                        }
    
                        leaf include-label-route {
                          when
                            "../source-address-family='ipv4uni'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable imported include label route.";
                        }
    
                        uses choice-policy-set;
                      }  // list import-rib
                    }  // container import-ribs
    
                    container lsp-options {
                      description
                        "Configure BGP ingress-lsp.";
                      uses safi-lsp-options;
    
                      leaf maximum-load-balancing-transit {
                        type uint16 {
                          range "1..65535";
                        }
                        default "1";
                        description
                          "Maximum number of transit LSPs for load balancing.";
                      }
    
                      leaf unicast-rt-label-advertise-popgo {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type boolean;
                        default 'false';
                        description
                          "Enable/disable a device to convert received IPv4 public network unicast routes to labeled routes by adding a BGP label to each route and advertise the labeled routes to peers with the labeled route exchange capability. If the IP address of an outbound interface is reachable but no LSP is reachable, traffic is forwarded through the outbound interface and a specific next hop, during which the label POPGO action is performed.";
                      }
    
                      leaf lsp-operation {
                        when
                          "../../../../../../../ni:name='_public_'";
                        type lsp-operation-type;
                        default "pop";
                        description
                          "Label operation type.";
                      }
    
                      uses ingress-choice-policy-set;
                    }  // container lsp-options
    
                    uses vrf-af-dampening-routes;
    
                    uses bgp:slow-peer-type;
                  }  // container ipv4-labeluni
    
                  container ipv4-multicast {
                    when "../type='ipv4multi'";
                    description
                      "Configure IPv4 multicast options.";
                    container common {
                      description
                        "Configure BGP IPv4-multicast address family options.";
                      leaf always-compare-med {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare the MEDs of routes from peers in different ASs in route selection. If 
                        there are multiple reachable routes to the same destination, the route with the smallest MED is preferred. Do not use this option unless different ASs use the same IGP and route selection mode.";
                      }
    
                      leaf default-med {
                        type uint32;
                        default "0";
                        description
                          "Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer. This value is valid only for the imported routes and BGP summarized routes on the local router.";
                      }
    
                      leaf summary-automatic {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable automatic summarization for imported routes. Manual summarization takes precedence over automatic summarization. After automatic summarization is enabled, BGP summarizes routes based on the natural network segment (for example, 10.1.1.1/24 and 10.2.1.1/24 are summarized into 10.0.0.0/8, a Class A address), and sends only the summarized route to peers. This reduces the number of routes.";
                      }
    
                      leaf bestroute-med-confederation {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to compare Med value only within the federation.";
                      }
    
                      leaf default-local-preference {
                        type uint32 {
                          range "0..4294967295";
                        }
                        default "100";
                        description
                          "The local preference of BGP routes.";
                      }
    
                      leaf default-route-import {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to import default routes into the BGP routing table. Default-route-imported must be used with import-routes so that default routes can be imported to the BGP routing table. If only import-routes is used, no default routes can be added to the BGP routing table. In addition, default-route-imported can only import the default routes in the routing table into the BGP routing table.";
                      }
    
                      leaf routerid-neglect {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore router IDs when selecting the optimal route. Comparing router IDs is the last resort in route selection. This means that if one optimal route must be selected and no other parameters can be used to break the tie, router IDs can be used. If this option is selected, the first received route will be selected as the optimal route, and BGP will ignore the router ID and peer address in route selection.";
                      }
    
                      leaf route-select-delay {
                        type uint16 {
                          range "0..3600";
                        }
                        units "s";
                        default "0";
                        description
                          "Route selection delay.";
                      }
    
                      uses reflect-type;
    
                      uses reflector-cluster-type;
    
                      leaf reflect-between-client {
                        type boolean;
                        default "true";
                        description
                          "Enable/disable route reflection between clients. If clients of a route reflector (RR) are fully meshed, you can disable route reflection among clients to reduce the cost.";
                      }
    
                      leaf determin-med {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable deterministic MED so that the route selection result is relevant to the sequence in which routes are received.";
                      }
    
                      uses bestroute-med-plus-igp-type;
    
                      uses bestroute-router-id-prior-clusterlist-type;
    
                      leaf bestroute-as-path-ignore {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP to ignore the AS_Path attribute when selecting the optimal route. By default, BGP uses the AS_Path attribute as one of route selection rules, and a route with a shorter AS_Path is preferred. After bestroute-as-path-ignore is selected, BGP does not compare the AS_Path length.";
                      }
    
                      leaf bestroute-med-none-as-maximum {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP considers its MED as the largest MED value (4294967295). If a route does not carry MED, BGP considers its MED as the default value (0) during route selection.";
                      }
    
                      leaf maximum-load-balancing {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing-ibgp>1 or ../maximum-load-balancing-ebgp>1) or ../maximum-load-balancing=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost routes in the BGP routing table. The value can be 1 or an integer greater than 1. The value depends on the associated license. By default, the maximum number of equal-cost routes is 1. Equal-cost BGP routes can be generated for load balancing only when the BGP routes meet the first nine rules of the route-selection policy and have the same AS-Path attribute. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf maximum-load-balancing-ibgp {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing>1) or ../maximum-load-balancing-ibgp=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost IBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf maximum-load-balancing-ebgp {
                        type uint16 {
                          range "1..65535";
                        }
                        must
                          "not (../maximum-load-balancing>1) or ../maximum-load-balancing-ebgp=1";
                        default "1";
                        description
                          "Specify the maximum number of equal-cost EBGP routes. The value range and default value are controlled by the PAF.";
                      }
    
                      leaf ext-community-change {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable the function to change the extended community attribute.";
                      }
                    }  // container common
    
                    container nexthop-recursive-lookup {
                      description
                        "Configure next hop iteration.";
                      container common {
                        description
                          "Configure next hop iteration common options.";
                        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
                      }  // container common
    
                      uses nexthop-recursive-lookup-delay;
                    }  // container nexthop-recursive-lookup
    
                    uses bgp-route-preference-options;
    
                    uses vrf-af-dampening-routes;
    
                    container network-routes {
                      description
                        "List of network routes.";
                      list network-route {
                        key "address mask-length";
                        description
                          "Configure a network route in the BGP routing table.";
                        uses network-route-ipv4;
                      }  // list network-route
                    }  // container network-routes
    
                    container import-routes {
                      description
                        "List of imported routes.";
                      list import-route {
                        key "protocol process-id";
                        description
                          "Configure route import. Routes of other protocol types can be imported by BGP. By default, BGP does not import routes of other protocol types.";
                        leaf protocol {
                          type ipv4multi-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
                      }  // list import-route
                    }  // container import-routes
    
                    container aggregate-routes {
                      description
                        "List of summarized routes.";
                      list aggregate-route {
                        key "address mask-length";
                        description
                          "Configure a summarized route in the BGP routing table. The local outbound interface of the summarized route is Null0. When another router receives the route, the route adds an outbound interface to the route. By default, route summarization is not performed. If the Origin attributes of the specific routes for the route summarization are different, the Origin attribute of the summarized route is that with the highest priority. Origin attributes are arranged in the priority order of complete > egp > igp. A summarized route carries the community attribute of each specific route.";
                        uses unicast-aggregate-routes-type {
                          refine address {
                            must
                              "not(contains(../address,':'))";
                          }
    
                          refine mask-length {
                            must
                              "../mask-length<=32";
                          }
                        }
                      }  // list aggregate-route
                    }  // container aggregate-routes
    
                    uses ipv4-import-filter-protocol-type;
    
                    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 ipv4-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";
                          }
                          must
                            "((../protocol='ospf' or ../protocol='rip' or ../protocol='isis') and ../process-id!=0) or ((../protocol!='ospf' and ../protocol!='rip' and ../protocol!='isis') and ../process-id=0)";
                          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 ipv4-filter-protocol-policy-choice-type;
                      }  // list export-filter-policy
                    }  // container export-filter-policys
    
                    uses bgp:slow-peer-type;
    
                    uses qos-local-id-type;
                  }  // container ipv4-multicast
                }  // list af
              }  // container afs
    
              container vpn-as-number {
                when
                  "../../../ni:name!='_public_'";
                description
                  "Configure BGP vpn as-number.";
                leaf local-ipv4 {
                  type as-number-validate;
                  description "IPv4 as-number.";
                }
    
                leaf local-ipv6 {
                  type as-number-validate;
                  description "IPv6 as-number.";
                }
              }  // container vpn-as-number
    
              container dynamic-peer-prefixes {
                description
                  "List of IP prefixes from which a dynamic BGP peer group listens for BGP connection requests.";
                list dynamic-peer-prefix {
                  key "address mask-length peer-group";
                  description
                    "Configure an IP prefix from which a dynamic BGP peer group listens for BGP connection requests.";
                  leaf address {
                    type inet:ip-address-no-zone;
                    must
                      "contains(., ':') = 'false'";
                    description
                      "Network segment address for a dynamic peer connection.";
                  }
    
                  leaf mask-length {
                    type uint8 {
                      range "0..32";
                    }
                    description
                      "Mask length of a network segment. For an IPv4 network address, the value ranges from 0 to 32.";
                  }
    
                  leaf peer-group {
                    type leafref {
                      path
                        "../../../peer-groups/peer-group/name";
                    }
                    must
                      "../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'dynamic'";
                    must
                      "../../../peer-groups/peer-group[name = current()]/listen-as or ../../../peer-groups/peer-group[name = current()]/listen-as-segments/listen-as-segment or /ni:network-instance/ni:instances/ni:instance[ni:name='_public_']/bgp:bgp/bgp:base-process/bgp:peer-groups/bgp:peer-group[name = current()]/bgp:as-number-type='confederation'";
                    description
                      "The peer-group within which the dynamic neighbor will be configured.";
                  }
                }  // list dynamic-peer-prefix
              }  // container dynamic-peer-prefixes
    
              container unnumbered-peer-interfaces {
                description
                  "List of address unnumbered interface.";
                list unnumbered-peer-interface {
                  key "if-name";
                  description
                    "Configure the interface bound to the peer group.";
                  leaf if-name {
                    type leafref {
                      path
                        "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name";
                    }
                    description
                      "Address unnumbered interface.";
                  }
    
                  leaf peer-group {
                    ext:operation-exclude "update" {
                      description "The node cannot be modified, when node is already configured.";
                    }
                    type leafref {
                      path "../../../peer-groups/peer-group/name";
                    }
                    must
                      "../../../peer-groups/peer-group[name = current()]/peer-establish-mode='unnumbered'";
                    mandatory true;
                    description
                      "The peer-group within which the unnumbered neighbor will be configured.";
                  }
                }  // list unnumbered-peer-interface
              }  // container unnumbered-peer-interfaces
    
              container peer-groups {
                description
                  "List of BGP peer groups. The BGP peer groups can help you simplify the configurations. If you want to perform the same configuration for several peers, you can create a peer group and then configure the peer group. After you add these peers to the peer group, all these peers will have the same configurations as the peer group.";
                list peer-group {
                  key "name";
                  description
                    "Configure information about a BGP peer group.";
                  leaf name {
                    type string {
                      length "1..47";
                      pattern '([^\? ]+)';
                    }
                    description
                      "Specify the name of a peer group. The value is a string of characters, spaces not supported.";
                  }
    
                  leaf type {
                    ext:operation-exclude "update" {
                      description "The node cannot be modified, when node is already configured.";
                    }
                    type group-type;
                    mandatory true;
                    description
                      "Specify the type of a peer group. The value can be IBGP or EBGP.The object cannot be modified.";
                  }
    
                  uses peer-local-if-type;
    
                  uses authentication-attr-type;
    
                  leaf tcp-ao-name {
                    type leafref {
                      path "/socket:socket/socket:tcp-aos/socket:tcp-ao/socket:name";
                    }
                    must
                      "not(../password-type!='null' or ../key-chain-name)";
                    description
                      "Specify TCP-AO authentication for establishing the TCP connection between BGP peers.";
                  }
    
                  leaf description {
                    type string {
                      length "1..255";
                      pattern '([^?]*)';
                    }
                    description
                      "Specify the description of a peer group. The value is a string, which can be letters or digits, spaces supported. By default, no description is configured.";
                  }
    
                  leaf group-as {
                    when
                      "not(../type='ibgp') and ../peer-establish-mode = 'static'";
                    type as-number-validate;
                    description
                      "Specify the AS number of a peer group. The AS number is in either a 2-byte or 4-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 tcp-mss {
                    type uint16 {
                      range "176..4096";
                    }
                    description
                      "Maximum TCP MSS value used for TCP connection establishment for a peer group.";
                  }
    
                  leaf ebgp-max-hop {
                    when "../type='ebgp'";
                    type uint32 {
                      range "1..255";
                    }
                    must
                      "not(../valid-ttl-hops) or (../valid-ttl-hops>=1 and not(../valid-ttl-hops>255) and ../ebgp-max-hop=1)";
                    default "1";
                    description
                      "Maximum number of hops in an indirect EBGP connection. By default, EBGP connections can be established only between directly connected peers. The function must be configured on both ends.";
                  }
    
                  leaf valid-ttl-hops {
                    type uint16 {
                      range "1..255";
                    }
                    must
                      "not(../ebgp-max-hop and ../ebgp-max-hop>1)";
                    description
                      "Enable GTSM on a peer or peer group. The valid-TTL-Value parameter is used to specify the number of TTL hops to be detected. If the value is configured as hops, the valid TTL range of the detected packet is [255-hops+1, 255].";
                  }
    
                  uses peer-tracking-type;
    
                  leaf conventional {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable general router functions on peers. In conventional mode, not all the extended router functions, such as, route refreshing, GR, and multi-address family negotiation, are available. Therefore, the router of a new version can be compatible with the routers of earlier versions.";
                  }
    
                  leaf route-refresh {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to advertise Refresh messages to peers.";
                  }
    
                  leaf four-byte-as {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to advertise routes carrying 4-byte AS numbers to peers. After the 4-byte AS number function is disabled, Open packets will not carry 4-byte AS number capability flag, and peer ends will not know that local ends have the 4-byte AS number function. The 4-byte AS number function cannot be disabled from peers (peer groups) if a 4-byte AS number, fake AS number, or confederation ID is configured on a router and the AS number of a peer is 4-byte. If the 4-byte AS number function is disabled in such a situation, BGP sessions may fail to be established, and route transmission may be affected.";
                  }
    
                  leaf ignore {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable the function to tear down sessions between peers and clear all related routing information.";
                  }
    
                  leaf connect-mode {
                    when
                      "../peer-establish-mode!='dynamic'";
                    type connect-mode;
                    default "null";
                    description
                      "The value can be Connect-only, Listen-only, or Both. If the value is Connect-only, the specified peer or peer group only initiatively sends connection requests, instead of listening to connection requests. If the value is Listen-only, the specified peer or peer group only listens to connection requests, instead of initiatively sending connection requests. If the value is Both, the specified peer or peer group not only initiatively sends connection requests, but also listens to connection requests. The default value is Both.";
                  }
    
                  leaf log-change {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to record the session status and events of the specified peer or peer group.";
                  }
    
                  leaf path-mtu-auto-discovery {
                    when
                      "../peer-establish-mode = 'static'";
                    type boolean;
                    default "false";
                    description
                      "Enable/disable path mtu auto discovery.";
                  }
    
                  leaf local-ifnet-disable {
                    ext:dynamic-default;
                    type boolean;
                    description
                      "Enable/disable MPLS local IFNET tunnel creation on a BGP peer. By default, MPLS local IFNET tunnels can be created on an EBGP peer,but such tunnels cannot be created on an IBGP peer.";
                  }
    
                  leaf check-first-as {
                    when "../type='ebgp'";
                    type peer-cap-config-state;
                    default "default";
                    description
                      "Check the first AS in the AS_Path of the update messages from EBGP peers.";
                  }
    
                  leaf memory-priority {
                    type memory-priority;
                    default "medium";
                    description
                      "Set a priority that determines the disconnection order of each BGP peer relationship in a peer group if memory overload occurs.";
                  }
    
                  leaf oscillation-dampening {
                    when
                      "../peer-establish-mode!='dynamic'";
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to suppress the establishment of a specified peer group's peer relationships that flap continuously. By default, the capability is enabled.";
                  }
    
                  leaf peer-establish-mode {
                    ext:operation-exclude "update|delete" {
                      description "The node cannot be modified, deleted when node is already configured.";
                    }
                    type peer-establish-mode;
                    default "static";
                    description
                      "Specify mode in which a BGP peer is established.";
                  }
    
                  leaf as-number-type {
                    ext:operation-exclude "update|delete" {
                      description "The node cannot be modified, deleted when node is already configured.";
                    }
                    when
                      "../peer-establish-mode = 'dynamic' and ../../../../../ni:name='_public_'";
                    type as-number-type;
                    must
                      ". = 'dynamic-neighbor' or (. = 'confederation' and /bgp:bgp/bgp:base-process/bgp:confederation/bgp:id and ../type = 'ebgp')";
                    default "dynamic-neighbor";
                    description
                      "Specify the type of the AS number that is used to establish a BGP peer relationship dynamically. The value can be dynamic-neighbor or confederation.";
                  }
    
                  leaf-list listen-as {
                    when
                      "../peer-establish-mode = 'dynamic' and ../type = 'ebgp'";
                    type as-number-validate;
                    must
                      "not(. = /bgp:bgp/bgp:base-process/bgp:as) and not(/ni:network-instance/ni:instances/ni:instance[ni:name='_public_']/bgp:bgp/bgp:base-process/bgp:peer-groups/bgp:peer-group[name = current()/../name]/bgp:as-number-type='confederation')";
                    max-elements 6;
                    description
                      "Specify the peer AS from which a dynamic EBGP peer group listens for BGP connection requests.";
                  }
    
                  container listen-as-segments {
                    when
                      "../peer-establish-mode = 'dynamic' and ../type = 'ebgp'";
                    description
                      "List of AS number ranges for listening.";
                    list listen-as-segment {
                      must
                        "not(../../listen-as) and not(/ni:network-instance/ni:instances/ni:instance[ni:name='_public_']/bgp:bgp/bgp:base-process/bgp:peer-groups/bgp:peer-group[name = current()/../../name]/bgp:as-number-type='confederation')";
                      key "begin-as end-as";
                      max-elements 16;
                      description
                        "Specify an AS number range from which a dynamic EBGP peer group listens for connection requests. The value of begin-as must be smaller than that of end-as. The value of As-Segment cannot contain the value of LocalAS or the value of fake-as. An AS number range cannot contain a confederation AS number, and any two AS number ranges cannot contain each other.";
                      leaf begin-as {
                        type as-number-validate;
                        description
                          "Specify the start AS number in an AS range.";
                      }
    
                      leaf end-as {
                        type as-number-validate;
                        description
                          "Specify the end AS number in an AS range.";
                      }
                    }  // list listen-as-segment
                  }  // container listen-as-segments
    
                  container fake-as-parameter {
                    description
                      "Configure BGP fake-as parameters.";
                    leaf fake-as {
                      when
                        "../../bgp:type='ebgp'";
                      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.";
                    }
                  }  // container fake-as-parameter
    
                  uses peer-timer-para-type;
    
                  uses group-bfd-parameter-type;
    
                  container graceful-restart {
                    when
                      "../peer-establish-mode!='dynamic'";
                    description
                      "Configure graceful restart.";
                    uses group-graceful-restart-type;
    
                    leaf peer-reset {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable reseting BGP peer graceful.";
                    }
                  }  // container graceful-restart
    
                  container local-graceful-restart {
                    when
                      "../peer-establish-mode = 'static'";
                    description
                      "Configure local graceful restart.";
                    uses group-graceful-restart-type;
                  }  // container local-graceful-restart
    
                  container ssl-policy {
                    when
                      "../../../../../ni:name='_public_' and ../peer-establish-mode='static'";
                    description
                      "Configure SSL policy for BGP group.";
                    uses group-ssl-policy-grouping {
                      refine role {
                        must
                          "(../role='client' and ../../connect-mode != 'listen-only') or (../role='server' and ../../connect-mode != 'connect-only')";
                      }
                    }
                  }  // container ssl-policy
    
                  container members {
                    config false;
                    description
                      "List of members in a peer group.";
                    list member {
                      key "peer-address";
                      config false;
                      description
                        "Statistics of member in a peer group.";
                      leaf peer-address {
                        type inet:ip-address-no-zone;
                        config false;
                        description
                          "Specify the address of the peer joining the peer group.";
                      }
                    }  // list member
                  }  // container members
    
                  container afs {
                    description
                      "List of all peer groups that are enabled in a specified address family.";
                    list af {
                      key "type";
                      description
                        "Configure peer group enabled in a specified address family.";
                      leaf type {
                        type group-af-type;
                        must
                          "../../../../../afs/af[type = current()]";
                        description
                          "Address family type of a BGP instance.";
                      }
    
                      container ipv4-unicast {
                        when
                          "../type = 'ipv4uni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                        description
                          "Configure IPv4 unicast options.";
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        leaf orf-type {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type bgp-orf-type;
                          must
                            "(../orf-mode='null' and ../orf-type='null') or (../orf-mode!='null' and ../orf-type!='null')";
                          default "null";
                          description
                            "ORF Type.";
                        }
    
                        leaf orf-mode {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type bgp-orf-mode-type;
                          must
                            "(../orf-mode='null' and ../orf-type='null') or (../orf-mode!='null' and ../orf-type!='null')";
                          default "null";
                          description
                            "Configure an outbound route filtering (ORF) mode, which can be Receive, Send, or Both, and the default ORF mode is Both.";
                        }
    
                        leaf label-route-capability {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange labeled routes.";
                        }
    
                        leaf check-tunnel-reachable {
                          when
                            "../label-route-capability='true'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable tunnel reachability check.";
                        }
    
                        leaf check-withdraw-type {
                          when
                            "../label-route-capability='true'";
                          type boolean;
                          default "true";
                          status obsolete;
                          description
                            "Enable/disable withdraw type check.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNv6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf static-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported static route when advertising them to its peers.";
                        }
    
                        leaf unicast-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported unicast route when advertising them to its peers.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf origin-as-validation {
                          when
                            "../advertise-ext-community='true' and ../../../../peer-establish-mode='static'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses default-route-advertise-type;
    
                        leaf default-route-match-mode {
                          when
                            "../default-route-advertise='true'";
                          type cra-match-mode;
                          default "null";
                          description
                            "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                        }
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          when
                            "../../../../bgp:type='ebgp'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        leaf exp-mode {
                          type exp-mode-type;
                          default "null";
                          description
                            "Specify the ASs in which a BGP label can inherit the QoS priority carried in the outer label of public tunnel in the Core AS and the ASs in which the priorities of BGP LSPs must be restored before the LSPs are advertised to a non-core AS.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange IPv4 prefix SIDs with a specified IPv6 peer group.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='true'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        uses group-independent-peer-group-type;
    
                        uses load-balancing-type;
    
                        uses community-attribute;
    
                        uses advertise-large-community-group-type;
    
                        container option {
                          description
                            "Configure IPv4 unicast group common options.";
                          leaf export-origin-as-validation {
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable the function ebgp group advertising dependent roa validation, route is advtised roa reslut is valid.";
                          }
    
                          leaf include-not-found {
                            when
                              "../export-origin-as-validation='enable'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the include-not-found attribute of the ROA validation.";
                          }
    
                          leaf external {
                            when
                              "../include-not-found='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable ROA export validation to advertise only external not found routes.";
                          }
                        }  // container option
    
                        uses ipv4-default-route-match-conditions-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
    
                        uses advertise-dependent-filter-group-type;
    
                        container entropy-label-parameter {
                          when
                            "../../../../../../../../ni:name='_public_' and ../label-route-capability='true'";
                          description
                            "Configure information about entropy label parameter in a peer group.";
                          uses group-entropy-label-type;
                        }  // container entropy-label-parameter
    
                        container route-server {
                          description
                            "Configure the route server function on a device and specifies an EBGP peer as its client.";
                          leaf route-server-client {
                            when
                              "../../../../../bgp:type='ebgp' and ../../../../../peer-establish-mode='static'";
                            type empty;
                            must
                              "not(../route-server-client) or (not(/bgp:bgp/bgp:base-process/bgp:confederation/bgp:id) and (/bgp:bgp/bgp:base-process/bgp:confederation/bgp:nonstanded = 'false'))";
                            must
                              "not(../route-server-client) or (../../label-route-capability = 'false')";
                            must
                              "not(../route-server-client) or (../../prefix-sid = 'false')";
                            description
                              "Enable/disable the route server function on a device and specifies an EBGP peer as its client.";
                          }
                        }  // container route-server
    
                        container hierarchy-convergence {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure the current peer group's hierarchy convergence capablity.";
                          uses group-hierarchy-convergence;
                        }  // container hierarchy-convergence
    
                        container link-bandwidth {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure link bandwidth attribute.";
                          leaf advertise {
                            when
                              "../../../../../bgp:type='ebgp'";
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable advertise the link bandwidth attribute to an EBGP peer.";
                          }
    
                          leaf transitive {
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable transitive the link bandwidth attribute.";
                          }
    
                          leaf generate {
                            when
                              "../../../../../bgp:type='ebgp'";
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable generate the link bandwidth attribute to an EBGP peer.";
                          }
                        }  // container link-bandwidth
                      }  // container ipv4-unicast
    
                      container ipv6-unicast {
                        when
                          "../type = 'ipv6uni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                        description
                          "Configure IPv6 unicast options.";
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        leaf label-route-capability {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange labeled routes.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf static-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported static route when advertising them to its peers.";
                        }
    
                        leaf unicast-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported unicast route when advertising them to its peers.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf advertise-ext-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the extended community attribute to a peer or peer group.";
                        }
    
                        leaf origin-as-validation {
                          when
                            "../advertise-ext-community='true' and ../../../../peer-establish-mode='static' and ../../../../bgp:type='ibgp'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf discard-ext-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable discard the extended community attribute in the routing information about a specified peer.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        uses default-route-advertise-type;
    
                        leaf default-route-match-mode {
                          when
                            "../default-route-advertise='true'";
                          type cra-match-mode;
                          default "null";
                          description
                            "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ipv6-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl6-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          when
                            "../../../../bgp:type='ebgp'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        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
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange IPv4 prefix SIDs with a specified IPv6 peer group.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='true'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        uses advertise-large-community-group-type;
    
                        uses group-independent-peer-group-type;
    
                        container option {
                          description
                            "Configure IPv6 unicast group common options.";
                          leaf export-origin-as-validation {
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable the function ebgp group advertising dependent roa validation, route is advtised roa reslut is valid.";
                          }
    
                          leaf include-not-found {
                            when
                              "../export-origin-as-validation='enable'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the include-not-found attribute of the ROA validation.";
                          }
    
                          leaf external {
                            when
                              "../include-not-found='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable ROA export validation to advertise only external not found routes.";
                          }
                        }  // container option
    
                        uses ipv6-default-route-match-conditions-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
    
                        uses advertise-dependent-filter6-group-type;
    
                        container route-server {
                          description
                            "Configure the route server function on a device and specifies an EBGP peer as its client.";
                          leaf route-server-client {
                            when
                              "../../../../../bgp:type='ebgp' and ../../../../../peer-establish-mode='static'";
                            type empty;
                            must
                              "not(../route-server-client) or (not(/bgp:bgp/bgp:base-process/bgp:confederation/bgp:id) and (/bgp:bgp/bgp:base-process/bgp:confederation/bgp:nonstanded = 'false'))";
                            must
                              "not(../route-server-client) or (../../label-route-capability = 'false')";
                            must
                              "not(../route-server-client) or (../../prefix-sid = 'false')";
                            description
                              "Enable/disable the route server function on a device and specifies an EBGP peer as its client.";
                          }
                        }  // container route-server
    
                        container hierarchy-convergence {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure the current peer group's hierarchy convergence capablity.";
                          uses group-hierarchy-convergence;
                        }  // container hierarchy-convergence
    
                        container link-bandwidth {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure link bandwidth attribute.";
                          leaf advertise {
                            when
                              "../../../../../bgp:type='ebgp'";
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable advertise the link bandwidth attribute to an EBGP peer.";
                          }
    
                          leaf transitive {
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable transitive the link bandwidth attribute.";
                          }
    
                          leaf generate {
                            when
                              "../../../../../bgp:type='ebgp'";
                            type peer-attr-enable-type;
                            default "disable";
                            description
                              "Enable/disable generate the link bandwidth attribute to an EBGP peer.";
                          }
                        }  // container link-bandwidth
                      }  // container ipv6-unicast
    
                      container ipv4-vpn {
                        when
                          "../type = 'ipv4vpn'";
                        description
                          "Configure IPv4 vpnv4 options.";
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf ignore-bit-error {
                          when
                            "../export-policy or ../export-filter";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer to ignore bit error detection results.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../bgp:type='ibgp'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ip-prefix-filter-type;
    
                        uses peer-ipv4-reoriginate-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../bgp:type='ibgp'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf upe {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer as an underlayer PE (UPE).";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../bgp:type='ibgp'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        uses advertise-large-community-group-type;
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses group-independent-peer-group-type;
    
                        leaf origin-as-validation {
                          when
                            "../../../../peer-establish-mode='static' and ../../../../bgp:type='ibgp'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf high-priority {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable vpn-router high priority.";
                        }
    
                        container default-route-originates {
                          description
                            "Configure advertised default VPNv4 routes.";
                          uses default-route-originate-type;
                        }  // container default-route-originates
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
                      }  // container ipv4-vpn
    
                      container ipv6-vpn {
                        when
                          "../type = 'ipv6vpn'";
                        description
                          "Configure IPv6 vpn options.";
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf ignore-bit-error {
                          when
                            "../export-policy or ../export-filter";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer to ignore bit error detection results.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../bgp:type='ibgp'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ipv6-prefix-filter-type;
    
                        leaf reoriginate-route-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route regeneration.";
                        }
    
                        leaf reoriginate-ipv6-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable IP route regeneration and advertisement.";
                        }
    
                        leaf reoriginate-mac-ipv6-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable MAC-IP route regeneration and advertisement.";
                        }
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl6-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../bgp:type='ibgp'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../bgp:type='ibgp'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        uses advertise-large-community-group-type;
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses group-independent-peer-group-type;
    
                        leaf origin-as-validation {
                          when
                            "../../../../peer-establish-mode='static'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf high-priority {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable vpn-router high priority.";
                        }
    
                        leaf prefix-sid {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a SID mode relay for group.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='true'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
                      }  // container ipv6-vpn
    
                      container ipv4-labeluni {
                        when
                          "../type = 'ipv4labeluni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                        description
                          "Configure IPv4 label unicast options.";
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        leaf check-tunnel-reachable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable tunnel reachability check.";
                        }
    
                        uses peer-policy-filter-type;
    
                        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.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses preferred-value-type;
    
                        leaf exp-mode {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type exp-mode-type;
                          default "null";
                          description
                            "Specify the ASs in which a BGP label can inherit the QoS priority carried in the outer label of public tunnel in the Core AS and the ASs in which the priorities of BGP LSPs must be restored before the LSPs are advertised to a non-core AS.";
                        }
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          when
                            "../../../../bgp:type='ebgp'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_' and ../../../../bgp:type='ibgp'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        leaf load-balancing-enable {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a neighbour to participate in load balancing.";
                        }
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange IPv4 prefix SIDs with a specified IPv6 peer group.";
                        }
    
                        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
    
                        uses advertise-large-community-group-type;
    
                        uses group-independent-peer-group-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
    
                        container entropy-label-parameter {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure information about entropy label parameter in a peer group.";
                          uses group-entropy-label-type;
                        }  // container entropy-label-parameter
                      }  // container ipv4-labeluni
    
                      container ipv4-multicast {
                        when
                          "../type='ipv4multi'";
                        description
                          "Configure IPv4 multicast options.";
                        uses default-route-advertise-type;
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        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.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          must
                            "../nexthop-configure='local'";
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf reflect-client {
                          when
                            "../../../../bgp:type='ibgp'";
                          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.";
                        }
    
                        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
    
                        uses advertise-large-community-group-type;
    
                        uses rt-update-interval-type;
    
                        uses bgp:preferred-value-type;
    
                        uses group-independent-peer-group-type;
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses group-public-as-only-import-type;
                      }  // container ipv4-multicast
                    }  // list af
                  }  // container afs
                }  // list peer-group
              }  // container peer-groups
    
              container peers {
                description "List of BGP peers.";
                list peer {
                  key "address";
                  description
                    "Configure a single BGP peer.";
                  leaf address {
                    type inet:ip-address-no-zone;
                    description
                      "Connection address of a peer, which can be an IPv4 or IPv6 address.";
                  }
    
                  leaf remote-as {
                    ext:operation-exclude "update" {
                      description "The node cannot be modified, when node is already configured.";
                    }
                    type as-number-validate;
                    mandatory true;
                    description
                      "AS number of a peer, which must be selected or group name when creating, and which 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.
                     The object cannot be modified.";
                  }
    
                  leaf group-name {
                    ext:operation-exclude "update" {
                      description "The node cannot be modified, when the peer already belongs to a peer-group.";
                    }
                    type leafref {
                      path "../../../peer-groups/peer-group/name";
                    }
                    must
                      "../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                    description
                      "Specify the name of a peer group that BGP peers need to join. That must be selected group name or AS when creating, and the value is a string, spaces not supported. By default, BGP peers join no peer group. BGP peers distinguish the peer group type when joining a peer group. IBGP peers cannot join an EBGP peer group. BGP peers will be deleted when they leave a peer group. The object cannot be modified.";
                  }
    
                  uses peer-local-if-type;
    
                  uses authentication-attr-type;
    
                  leaf tcp-ao-disable {
                    type empty;
                    description
                      "Disable the TCP-AO authentication for establishing the TCP connection between BGP peers.";
                  }
    
                  leaf tcp-ao-name {
                    when
                      "not(../tcp-ao-disable)";
                    type leafref {
                      path "/socket:socket/socket:tcp-aos/socket:tcp-ao/socket:name";
                    }
                    must
                      "not(../password-type!='null' or ../key-chain-name)";
                    description
                      "Specify TCP-AO authentication for establishing the TCP connection between BGP peers.";
                  }
    
                  leaf description {
                    type string {
                      length "1..255";
                      pattern '([^?]*)';
                    }
                    description
                      "Description of a peer, which can be letters or digits. The description is a string, spaces supported. By default, no description is configured for a peer.";
                  }
    
                  leaf ebgp-max-hop {
                    type uint32 {
                      range "1..255";
                    }
                    must
                      "not(../valid-ttl-hops) or (../valid-ttl-hops>=1 and ../valid-ttl-hops<=255 and ../ebgp-max-hop=1)";
                    description
                      "Maximum number of hops in an indirect EBGP connection. By default, EBGP connections can be established only between directly connected peers. The function must be configured on both ends. By default, value is determined by the neighbor type, the default value of EBGP is 1 and the default value of IBGP is 0.";
                  }
    
                  uses peer-tracking-type;
    
                  leaf conventional {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable general router functions on peers. In conventional mode, not all the extended router functions, such as, route refreshing, GR, and multi-address family negotiation, are available. Therefore, the router of a new version can be compatible with the routers of earlier versions.";
                  }
    
                  leaf route-refresh {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to advertise Refresh messages to peers.";
                  }
    
                  leaf four-byte-as {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to advertise routes carrying 4-byte AS numbers to peers. After the 4-byte AS number function is disabled, Open packets will not carry 4-byte AS number capability flag, and peer ends will not know that local ends have the 4-byte AS number function. The 4-byte AS number function cannot be disabled from peers (peer groups) if a 4-byte AS number, fake AS number, or confederation ID is configured on a router and the AS number of a peer is 4-byte. If the 4-byte AS number function is disabled in such a situation, BGP sessions may fail to be established, and route transmission may be affected.";
                  }
    
                  leaf ignore {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable the function to tear down sessions between peers and clear all related routing information.";
                  }
    
                  leaf valid-ttl-hops {
                    type uint16 {
                      range "1..255";
                    }
                    must
                      "not(../ebgp-max-hop and ../ebgp-max-hop>1)";
                    description
                      "Enable GTSM on a peer or peer group. The valid-TTL-Value parameter is used to specify the number of TTL hops to be detected. If the value is configured as hops, the valid TTL range of the detected packet is [255-hops+1, 255].";
                  }
    
                  leaf connect-mode {
                    type connect-mode;
                    default "null";
                    description
                      "The value can be Connect-only, Listen-only, or Both. If the value is Connect-only, the specified peer or peer group only initiatively sends connection requests, instead of listening to connection requests. If the value is Listen-only, the specified peer or peer group only listens to connection requests, instead of initiatively sending connection requests. If the value is Both, the specified peer or peer group not only initiatively sends connection requests, but also listens to connection requests. The default value is Both.";
                  }
    
                  leaf log-change {
                    type boolean;
                    default "true";
                    description
                      "Enable/disable BGP to record the session status and events of the specified peer or peer group.";
                  }
    
                  leaf path-mtu-auto-discovery {
                    type boolean;
                    default "false";
                    description
                      "Enable/disable path mtu auto discovery.";
                  }
    
                  leaf local-ifnet-disable {
                    ext:dynamic-default;
                    type boolean;
                    description
                      "Enable/disable MPLS local IFNET tunnel creation on a BGP IPv4 peer. By default, MPLS local IFNET tunnels can be created on an EBGP peer,but such tunnels cannot be created on an IBGP peer.";
                  }
    
                  leaf check-first-as {
                    type peer-cap-config-state;
                    default "default";
                    description
                      "Check the first AS in the AS_Path of the update messages from EBGP peers.";
                  }
    
                  leaf egress-engineer {
                    when
                      "../../../../../ni:name='_public_'";
                    type epe-state;
                    default "default";
                    description
                      "BGP Egress Peer Engineering (BGP-EPE) is enable or disable. The default value is default (The function is disable, If the neighbour joins the group, the function is Inheritance group).";
                  }
    
                  leaf tcp-mss {
                    type uint16 {
                      range "176..4096";
                    }
                    description
                      "Maximum TCP MSS value used for TCP connection establishment for a peer.";
                  }
    
                  leaf memory-priority {
                    type peer-memory-priority;
                    default "default";
                    description
                      "Set a priority that determines the disconnection order of a BGP peer relationship if memory overload occurs.";
                  }
    
                  leaf memory-priority-capability {
                    type memory-priority;
                    config false;
                    description
                      "Priority that is used to determine the disconnection order of a BGP peer relationship if memory overload occurs.";
                  }
    
                  leaf oscillation-dampening {
                    type peer-attr-enable-type;
                    description
                      "Enable/disable BGP to suppress the establishment of a specified peer relationship that flaps continuously. By default, the capability is enabled.";
                  }
    
                  container effect-state {
                    config false;
                    description
                      "Operational state of a BGP peer. It uses the peer-specific configuration or inherits the configuration of its peer group.";
                    leaf oscillation-dampening {
                      type boolean;
                      description
                        "Whether the capability of suppressing the establishment of a specified peer relationship that flaps continuously is enabled on the BGP peer.";
                    }
                  }  // container effect-state
    
                  container fake-as-parameter {
                    description
                      "Configure BGP fake-as parameters.";
                    uses fake-as-type;
                  }  // container fake-as-parameter
    
                  uses peer-timer-para-type;
    
                  uses peer-bfd-parameter-type;
    
                  uses peer-bfd-parameter-state-grouping;
    
                  container egress-engineer-parameter {
                    when
                      "../egress-engineer='enable'";
                    description
                      "Configure BGP peer egress engineering information.";
                    leaf static-label {
                      type uint32 {
                        range "16..1048575";
                      }
                      description
                        "The static label for BGP EPE. The value range and default value are controlled by the PAF.";
                    }
    
                    leaf label-pop {
                      when "../static-label";
                      type boolean;
                      must
                        "not(../relate-bfd='true' and ../label-pop='true')";
                      default "false";
                      description
                        "Enable/disable the BGP-EPE label popping function.";
                    }
    
                    leaf relate-bfd {
                      type boolean;
                      must
                        "not(../relate-bfd='true' and ../label-pop='true')";
                      default "false";
                      description
                        "Enable/disable association between the BGP-EPE label and BFD status.";
                    }
    
                    leaf peer-set-name {
                      type leafref {
                        path "../../../../bgp:egress-engineer-peer-sets/bgp:egress-engineer-peer-set/bgp:peer-set-name";
                      }
                      description
                        "Add peer to peer set.";
                    }
                  }  // container egress-engineer-parameter
    
                  container graceful-restart {
                    description
                      "Configure graceful restart.";
                    uses peer-graceful-restart-type;
    
                    leaf peer-reset {
                      type peer-comm-config-type;
                      default "default";
                      description
                        "Enable/disable reseting BGP peer graceful.";
                    }
    
                    leaf effect-peer-reset {
                      type boolean;
                      config false;
                      description
                        "Whether enable/disable reseting BGP peer graceful.";
                    }
                  }  // container graceful-restart
    
                  container local-graceful-restart {
                    description
                      "Configure local graceful restart.";
                    uses peer-graceful-restart-type;
                  }  // container local-graceful-restart
    
                  container ssl-policy {
                    when
                      "../../../../../ni:name='_public_'";
                    description
                      "Configure SSL policy for BGP peer.";
                    leaf enable {
                      type peer-attr-enable-type;
                      description
                        "Enable/disable SSL policy.";
                    }
    
                    leaf name {
                      when
                        "../enable = 'enable'";
                      type leafref {
                        path "/ssl:ssl/ssl:ssl-policys/ssl:ssl-policy/ssl:policy-name";
                      }
                      mandatory true;
                      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 peer-ssl-role-type;
                      must
                        "(.='client' and ../../connect-mode != 'listen-only') or (.='server' and ../../connect-mode != 'connect-only') or (.= 'disable')";
                      description
                        "Configure a peer as an SSL client or server.";
                    }
    
                    leaf server-certificate {
                      type peer-attr-enable-type;
                      must
                        "(../role = 'server') or (../role = 'disable') or (../role = 'client' and ../server-certificate != 'enable') or (not(../role) and not(../../bgp:group-name)) or (not(../role) and ../../bgp:group-name and  (../../../../bgp:peer-groups/bgp:peer-group[bgp:name=current()/../../bgp:group-name]/bgp:ssl-policy/bgp:role = 'server' or not(../../../../bgp:peer-groups/bgp:peer-group[bgp:name=current()/../../bgp:group-name]/bgp:ssl-policy/bgp:role))) or (not(../role) and ../../bgp:group-name and  ../../../../bgp:peer-groups/bgp:peer-group[bgp:name=current()/../../bgp:group-name]/bgp:ssl-policy/bgp:role = 'client' and ../server-certificate != 'enable')";
                      description
                        "Enable/disable SSL/TLS authentication on an SSL server.";
                    }
                  }  // container ssl-policy
    
                  container afs {
                    description
                      "List of peers in a specified address family.";
                    list af {
                      key "type";
                      description
                        "Configure peer in a specified address family.";
                      leaf type {
                        type af-type;
                        must
                          "../../../../../afs/af[type = current()]";
                        description
                          "Specify the address family type to set the peer enable.";
                      }
    
                      container ipv4-unicast {
                        when "../type='ipv4uni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                        description
                          "Configure IPv4 unicast options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4uni']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        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.";
                        }
    
                        leaf orf-type {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type bgp-orf-type;
                          must
                            "(../orf-mode='null' and ../orf-type='null') or (../orf-mode!='null' and ../orf-type!='null')";
                          default "null";
                          description
                            "ORF Type.";
                        }
    
                        leaf orf-mode {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type bgp-orf-mode-type;
                          must
                            "(../orf-mode='null' and ../orf-type='null') or (../orf-mode!='null' and ../orf-type!='null')";
                          default "null";
                          description
                            "Configure an outbound route filtering (ORF) mode, which can be Receive, Send, or Both, and the default ORF mode is Both.";
                        }
    
                        leaf label-route-capability {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange labeled routes.";
                        }
    
                        leaf check-tunnel-reachable {
                          when
                            "../label-route-capability='true'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable tunnel reachability check.";
                        }
    
                        leaf check-withdraw-type {
                          when
                            "../label-route-capability='true'";
                          type boolean;
                          default "true";
                          status obsolete;
                          description
                            "Enable/disable withdraw type check.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf static-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable' and contains(../../../../address,'.')";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported static route when advertising them to its peers.";
                        }
    
                        leaf unicast-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable' and contains(../../../../address,'.')";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported unicast route when advertising them to its peers.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf origin-as-validation {
                          when
                            "../advertise-ext-community='true'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        uses default-route-advertise-type;
    
                        leaf default-route-match-mode {
                          when
                            "../default-route-advertise='true'";
                          type cra-match-mode;
                          default "null";
                          description
                            "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable add-path route advertisement to a peer.";
                        }
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of add-path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        leaf exp-mode {
                          type exp-mode-type;
                          default "null";
                          description
                            "Specify the ASs in which a BGP label can inherit the QoS priority carried in the outer label of public tunnel in the Core AS and the ASs in which the priorities of BGP LSPs must be restored before the LSPs are advertised to a non-core AS.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type peer-comm-config-type;
                          default "default";
                          description
                            "Enable/disable a device to exchange IPv4 prefix SIDs with a specified IPv6 peer.";
                        }
    
                        leaf prefix-sid-state {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          config false;
                          description
                            "Whether the prefix-sid to a peer is enabled.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='enable'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        container effect-state {
                          config false;
                          description
                            "Operational state of peer.";
                          leaf advertise-srv6-locator {
                            type boolean;
                            description
                              "Whether to advertise SRv6 locators on the BGP peer.";
                          }
                        }  // container effect-state
    
                        uses load-balancing-type;
    
                        uses community-attribute;
    
                        uses advertise-large-community-type;
    
                        uses peer-independent-peer-group-type;
    
                        leaf rpd-policy-export {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type peer-enable-config-type;
                          default "default";
                          description
                            "Enable/disable RPD export policy.";
                        }
    
                        container option {
                          description
                            "Configure IPv4 unicast peer common options.";
                          leaf export-origin-as-validation {
                            type peer-attr-enable-type;
                            description
                              "Enable/disable the function ebgp peer advertising dependent roa validation, route is advtised roa reslut is valid.";
                          }
    
                          leaf include-not-found {
                            when
                              "../export-origin-as-validation='enable'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the include-not-found attribute of the ROA validation.";
                          }
    
                          leaf external {
                            when
                              "../include-not-found='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable ROA export validation to advertise only external not found routes.";
                          }
                        }  // container option
    
                        uses ipv4-default-route-match-conditions-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        container entropy-label-parameter {
                          when
                            "../../../../../../../../ni:name='_public_' and ../label-route-capability='true'";
                          description
                            "Configure information about entropy label parameter configuration in a peer.";
                          uses peer-entropy-label-type;
                        }  // container entropy-label-parameter
    
                        uses path-attr-map-type;
    
                        uses advertise-dependent-filter-type;
    
                        container route-server {
                          description
                            "Configure the route server function on a device and specifies an EBGP peer as its client.";
                          leaf route-server-client {
                            type peer-attr-enable-type;
                            must
                              "(. = 'disable') or (not(/bgp:bgp/bgp:base-process/bgp:confederation/bgp:id) and (/bgp:bgp/bgp:base-process/bgp:confederation/bgp:nonstanded = 'false'))";
                            must
                              "(. = 'disable') or (../../label-route-capability = 'false')";
                            description
                              "Enable/disable the route server function on a device and specifies an EBGP peer as its client.";
                          }
                        }  // container route-server
    
                        container hierarchy-convergence {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure the current peer's hierarchy convergence capablity.";
                          uses peer-hierarchy-convergence;
                        }  // container hierarchy-convergence
    
                        container link-bandwidth {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure peer link bandwidth attribute.";
                          uses peer-link-bandwidth-type;
                        }  // container link-bandwidth
                      }  // container ipv4-unicast
    
                      container ipv6-unicast {
                        when
                          "../type = 'ipv6uni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                        description
                          "Configure IPv6 unicast options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv6uni']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        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.";
                        }
    
                        leaf label-route-capability {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable a device to exchange labeled routes.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          must
                            "(not(contains(../../../../address,':')) and ../nexthop-configure='local') or contains(../../../../address,':')";
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf static-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported static route when advertising them to its peers.";
                        }
    
                        leaf unicast-route-nexthop-invariable {
                          when
                            "../../../../../../../../ni:name='_public_' and ../nexthop-configure='invariable'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable BGP speaker does not change the next hop of an imported unicast route when advertising them to its peers.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf advertise-ext-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the extended community attribute to a peer or peer group.";
                        }
    
                        leaf origin-as-validation {
                          when
                            "../advertise-ext-community='true'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the BGP peer origin validation.";
                        }
    
                        leaf discard-ext-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable discard the extended community attribute in the routing information about a specified peer.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        uses default-route-advertise-type;
    
                        leaf default-route-match-mode {
                          when
                            "../default-route-advertise='true'";
                          type cra-match-mode;
                          default "null";
                          description
                            "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable Add-Path route advertisement to a peer.";
                        }
    
                        uses ipv6-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl6-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        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
    
                        leaf tunnel-policy {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type leafref {
                            path "/tnlm:tunnel-management/tnlm:tunnel-policys/tnlm:tunnel-policy/tnlm:name";
                          }
                          description
                            "Apply a tunnel policy for a 6PE peer. By default, no tunnel policy is configured.";
                        }
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type peer-comm-config-type;
                          must
                            "(contains(../../../../address,'.') and ../prefix-sid='default') or contains(../../../../address,':')";
                          default "default";
                          description
                            "Enable/disable a device to exchange prefix SIDs with a specified IPv6 peer.";
                        }
    
                        leaf prefix-sid-state {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          config false;
                          description
                            "Whether the prefix-sid to a peer is enabled.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='enable'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        container effect-state {
                          config false;
                          description
                            "Operational state of peer.";
                          leaf advertise-srv6-locator {
                            type boolean;
                            description
                              "Whether to advertise SRv6 locators on the BGP peer.";
                          }
                        }  // container effect-state
    
                        uses advertise-large-community-type;
    
                        uses peer-independent-peer-group-type;
    
                        container option {
                          description
                            "Configure IPv6 unicast peer common options.";
                          leaf export-origin-as-validation {
                            type peer-attr-enable-type;
                            description
                              "Enable/disable the function ebgp peer advertising dependent roa validation, route is advtised roa reslut is valid.";
                          }
    
                          leaf include-not-found {
                            when
                              "../export-origin-as-validation='enable'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the include-not-found attribute of the ROA validation.";
                          }
    
                          leaf external {
                            when
                              "../include-not-found='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable ROA export validation to advertise only external not found routes.";
                          }
                        }  // container option
    
                        uses ipv6-default-route-match-conditions-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        uses path-attr-map-type;
    
                        uses advertise-dependent-filter6-type;
    
                        container route-server {
                          description
                            "Configure the route server function on a device and specifies an EBGP peer as its client.";
                          leaf route-server-client {
                            type peer-attr-enable-type;
                            must
                              "(. = 'disable') or (not(/bgp:bgp/bgp:base-process/bgp:confederation/bgp:id) and (/bgp:bgp/bgp:base-process/bgp:confederation/bgp:nonstanded = 'false'))";
                            must
                              "(. = 'disable') or (../../label-route-capability = 'false')";
                            must
                              "(. = 'disable') or (../../prefix-sid = 'disable')";
                            description
                              "Enable/disable the route server function on a device and specifies an EBGP peer as its client.";
                          }
                        }  // container route-server
    
                        container hierarchy-convergence {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure the current peer's hierarchy convergence capablity.";
                          uses peer-hierarchy-convergence;
                        }  // container hierarchy-convergence
    
                        container link-bandwidth {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure peer link bandwidth attribute.";
                          uses peer-link-bandwidth-type;
                        }  // container link-bandwidth
                      }  // container ipv6-unicast
    
                      container ipv4-vpn {
                        when
                          "../type = 'ipv4vpn'";
                        description
                          "Configure IPv4 VPNv4 options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4vpn']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        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.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf ignore-bit-error {
                          when
                            "../export-policy or ../export-filter";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer to ignore bit error detection results.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        uses peer-add-path-type;
    
                        uses ip-prefix-filter-type;
    
                        uses peer-ipv4-reoriginate-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf upe {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer as an underlayer PE (UPE).";
                        }
    
                        leaf high-priority {
                          type peer-comm-config-type;
                          default "default";
                          description
                            "Enable/disable vpn-router high priority.";
                        }
    
                        leaf prefix-sid {
                          type peer-enable-config-type;
                          must
                            "(contains(../../../../address,'.') and ../prefix-sid='default') or contains(../../../../address,':')";
                          default "default";
                          description
                            "Specify a SID mode relay for peer.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf sid-type5 {
                              when
                                "../prefix-sid='enable'";
                              type empty;
                              description
                                "Packet by type5.";
                            }
    
                            leaf advertise-srv6-locator {
                              when
                                "../sid-type5";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        leaf advertise-best-external {
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        uses advertise-large-community-type;
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses peer-independent-peer-group-type;
    
                        uses peer-origin-as-validation-type;
    
                        container default-route-originates {
                          description
                            "Configure advertised default VPNv4 routes.";
                          uses default-route-originate-type;
                        }  // container default-route-originates
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        uses path-attr-map-type;
                      }  // container ipv4-vpn
    
                      container ipv6-vpn {
                        when
                          "../type = 'ipv6vpn'";
                        description
                          "Configure IPv6 vpn options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv6vpn']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        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.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses peer-policy-filter-type;
    
                        leaf ignore-bit-error {
                          when
                            "../export-policy or ../export-filter";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable the peer to ignore bit error detection results.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        uses peer-add-path-type;
    
                        uses ipv6-prefix-filter-type;
    
                        leaf reoriginate-route-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route regeneration.";
                        }
    
                        leaf reoriginate-ipv6-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable IP route regeneration and advertisement.";
                        }
    
                        leaf reoriginate-mac-ipv6-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable MAC-IP route regeneration and advertisement.";
                        }
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl6-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        uses preferred-value-type;
    
                        leaf advertise-best-external {
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        uses advertise-large-community-type;
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses peer-independent-peer-group-type;
    
                        uses peer-origin-as-validation-type;
    
                        leaf high-priority {
                          type peer-comm-config-type;
                          default "default";
                          description
                            "Enable/disable vpn-router high priority.";
                        }
    
                        leaf prefix-sid {
                          type peer-comm-config-type;
                          must
                            "(contains(../../../../address,'.') and ../prefix-sid='default') or contains(../../../../address,':')";
                          default "default";
                          description
                            "Specify a SID mode relay for peer.";
                        }
    
                        leaf prefix-sid-state {
                          type boolean;
                          default "false";
                          config false;
                          description
                            "Whether the prefix-sid to a peer is enabled.";
                        }
    
                        choice prefix-sid-packet {
                          description
                            "Prefix-sid packet method.";
                          case sid-type5 {
                            description
                              "Packet by type5.";
                            leaf advertise-srv6-locator {
                              when
                                "../prefix-sid='enable'";
                              type empty;
                              description
                                "Advertise SRv6 locators.";
                            }
                          }  // case sid-type5
                        }  // choice prefix-sid-packet
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        uses path-attr-map-type;
                      }  // container ipv6-vpn
    
                      container ipv4-labeluni {
                        when
                          "../type = 'ipv4labeluni'";
                        must
                          "../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                        description
                          "Configure IPv4 label unicast options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4labeluni']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        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.";
                        }
    
                        leaf check-tunnel-reachable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable tunnel reachability check.";
                        }
    
                        uses peer-policy-filter-type;
    
                        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.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf aigp {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                        }
    
                        leaf add-path-mode {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type add-path-cap-type;
                          default "null";
                          description
                            "Enable add-path route advertisement to a peer.";
                        }
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        uses rt-update-interval-type;
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        uses preferred-value-type;
    
                        leaf exp-mode {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type exp-mode-type;
                          default "null";
                          description
                            "Specify the ASs in which a BGP label can inherit the QoS priority carried in the outer label of public tunnel in the Core AS and the ASs in which the priorities of BGP LSPs must be restored before the LSPs are advertised to a non-core AS.";
                        }
    
                        leaf add-path-number {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type uint8 {
                            range "2..64";
                          }
                          description
                            "Number of Add-Path routes that can be advertised to a peer.";
                        }
    
                        leaf substitute-as-enable {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                        }
    
                        leaf soo {
                          when
                            "../../../../../../../../ni:name!='_public_'";
                          type string {
                            length "3..21";
                          }
                          description
                            "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                          Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                          The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                        }
    
                        leaf advertise-best-external {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          must
                            "../reflect-client='false' or ../advertise-best-external='false'";
                          must
                            "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                          must
                            "not(../add-path-number and ../advertise-best-external='true')";
                          default "false";
                          description
                            "Enable/disable the device to advertise Best External routes to peers.";
                        }
    
                        leaf prefix-sid {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type peer-comm-config-type;
                          default "default";
                          description
                            "Enable/disable a device to exchange IPv4 prefix SIDs with a specified IPv6 peer.";
                        }
    
                        leaf prefix-sid-state {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          type boolean;
                          config false;
                          description
                            "Whether the prefix-sid to a peer is enabled.";
                        }
    
                        leaf load-balancing-enable {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          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
    
                        uses advertise-large-community-type;
    
                        uses peer-independent-peer-group-type;
    
                        uses route-limit-accept-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        container entropy-label-parameter {
                          when
                            "../../../../../../../../ni:name='_public_'";
                          description
                            "Configure information about entropy label parameter configuration in a peer.";
                          uses peer-entropy-label-type;
                        }  // container entropy-label-parameter
    
                        uses path-attr-map-type;
                      }  // container ipv4-labeluni
    
                      container ipv4-multicast {
                        when
                          "../type='ipv4multi'";
                        description
                          "Configure IPv4 multicast options.";
                        leaf group-name {
                          ext:operation-exclude "update" {
                            description "The node cannot be modified, when the peer already belongs to a peer-group.";
                          }
                          type leafref {
                            path "../../../../../../peer-groups/peer-group/name";
                          }
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4multi']";
                          must
                            "../../../../../../peer-groups/peer-group[name = current()]/peer-establish-mode = 'static'";
                          description
                            "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                        }
    
                        uses default-route-advertise-type;
    
                        uses ip-prefix-filter-type;
    
                        uses as-path-filter-type;
    
                        uses peer-group-acl-name-or-num-type;
    
                        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.";
                        }
    
                        leaf allow-as-loop {
                          type uint32 {
                            range "1..10";
                          }
                          description
                            "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                        }
    
                        leaf nexthop-configure {
                          type nexthop-configuration-type;
                          must
                            "../nexthop-configure='local'";
                          description
                            "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                        }
    
                        leaf advertise-community {
                          type boolean;
                          default "false";
                          description
                            "Enable/disable advertise the community attribute to a peer or a peer group.";
                        }
    
                        leaf keep-all-routes {
                          when
                            "/bgp:bgp/bgp:base-process/bgp:keep-all-routes='false'";
                          type boolean;
                          default "false";
                          description
                            "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                        }
    
                        uses peer-policy-filter-type;
    
                        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.";
                        }
    
                        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
    
                        uses advertise-large-community-type;
    
                        uses rt-update-interval-type;
    
                        uses bgp:preferred-value-type;
    
                        uses peer-independent-peer-group-type;
    
                        uses route-limit-type;
    
                        uses public-as-only-type;
    
                        uses peer-public-as-only-import-type;
    
                        uses path-attr-map-type;
                      }  // container ipv4-multicast
    
                      container state {
                        config false;
                        description
                          "Operational state of peer information.";
                        leaf type {
                          type peer-type-info;
                          config false;
                          description
                            "Configures the type of BGP peers: IBGP or EBGP.";
                        }
    
                        leaf version {
                          type uint8;
                          config false;
                          description
                            "The current BGP version is BGP-4. BGP-4 provides a set of new mechanisms to support Classless Inter-Domain Routing (CIDR). The new mechanisms also support the network prefix-based advertisement, cancellation of the 'class' concept for a BGP network during the network prefix-supported advertisements, and route summarization and AS path summarization.";
                        }
    
                        leaf remote-router-id {
                          type inet:ipv4-address-no-zone;
                          config false;
                          description
                            "Router ID for a peer.";
                        }
    
                        leaf current-state {
                          type peer-state;
                          config false;
                          description
                            "Current BGP state, which can be Idle, Active, Established, Connect, OpenSent, or OpenConfirm.
    Idle: In this state, BGP denies all connection requests. This is the initial state of BGP.
    Active: In this state, BGP tries to establish TCP connections. This is the intermediate state of BGP.
    Established: In this state, BGP peers can exchange Update, Notification, and Keepalive packets with each other.
    Connect: In this state, BGP determines the subsequent operation after the TCP connections are established.
    OpenSent: In this state, BGP is waiting for the Open packet from the peer.
    OpenConfirm: In this state, BGP is waiting for a Notification packet and a Keepalive packet.";
                        }
    
                        leaf local-port {
                          type uint32;
                          config false;
                          description
                            "Local port number. BGP uses TCP as the transport layer protocol, and the port number of the TCP connection initiator is 179.";
                        }
    
                        leaf remote-port {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Port number for a peer to establish a peer relationship.";
                        }
    
                        leaf current-event {
                          type string {
                            length "1..39";
                          }
                          config false;
                          description
                            "Recent event that occurs on a peer.";
                        }
    
                        leaf last-state {
                          type peer-state;
                          config false;
                          description
                            "Last state of a peer, which can be Idle, Connect, Active, OpenSent, OpenConfirm, or Established.";
                        }
    
                        leaf up-down-duration {
                          type string {
                            length "1..49";
                          }
                          config false;
                          description
                            "Duration in which a BGP peer is in the Up or Down state.
    The Up state indicates the established state, and the Down state indicates a non-established state (including the Idle, Active, Connect, OpenSent and OpenConfirm state). When the state is switched between Up and Down, the upDownDuration timer is reset and starts from 0.";
                        }
    
                        leaf send-message {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of messages sent to the peer.";
                        }
    
                        leaf rpd-capability {
                          type rpd-cap-type;
                          config false;
                          description
                            "Peer route-policy distribute capability.";
                        }
    
                        leaf local-rpd-capability {
                          type rpd-cap-type;
                          config false;
                          description
                            "Local route-policy distribute capability.";
                        }
    
                        leaf negotiate-rpd-capability {
                          type rpd-cap-type;
                          config false;
                          description
                            "Negotiated route-policy distribute capability.";
                        }
    
                        leaf receive-message {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of messages received from the peer.";
                        }
    
                        leaf out-queue {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of messages to be sent in a queue.";
                        }
    
                        leaf receive-hold-time {
                          type uint32 {
                            range "0..65535";
                          }
                          units "s";
                          config false;
                          description
                            "Hold time of a peer.";
                        }
    
                        leaf receive-last-keepalive-time {
                          type yang:date-and-time;
                          config false;
                          description
                            "Last time when Keepalive packets were received from a peer.";
                        }
    
                        leaf negotiate-hold-time {
                          type uint32 {
                            range "0..65535";
                          }
                          units "s";
                          config false;
                          description
                            "Hold time negotiated by BGP peers.";
                        }
    
                        leaf negotiate-keepalive-time {
                          type uint32 {
                            range "0..21845";
                          }
                          units "s";
                          config false;
                          description
                            "Keepalive time negotiated by BGP peers.";
                        }
    
                        leaf receive-update-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Update packets received from a peer.";
                        }
    
                        leaf receive-open-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Open packets received from a peer.";
                        }
    
                        leaf receive-keepalive-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Keepalive packets received from a peer.";
                        }
    
                        leaf receive-notification-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Notification packets received from a peer.";
                        }
    
                        leaf receive-route-refresh-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Route-Refresh packets received from a peer.";
                        }
    
                        leaf send-update-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Update packets sent to a peer.";
                        }
    
                        leaf send-open-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Open packets sent to a peer.";
                        }
    
                        leaf send-keepalive-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Keepalive packets sent to a peer.";
                        }
    
                        leaf send-notification-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Notification packets sent to a peer.";
                        }
    
                        leaf send-route-refresh-count {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of Route-Refresh packets sent to a peer.";
                        }
    
                        leaf send-graceful-restart-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the local end supports the GR (Graceful Restart) capability.";
                        }
    
                        leaf receive-refresh-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports RR.";
                        }
    
                        leaf receive-four-byte-as-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports 4-byte AS numbers.";
                        }
    
                        leaf receive-multi-protocol-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports MP.";
                        }
    
                        leaf receive-graceful-restart-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports GR.";
                        }
    
                        leaf receive-add-path {
                          type string {
                            length "1..50";
                          }
                          config false;
                          description
                            "Whether the peer supports Add-Path.";
                        }
    
                        leaf negotiate-add-path {
                          type string {
                            length "1..50";
                          }
                          config false;
                          description
                            "Negotiated Add-Path.";
                        }
    
                        leaf receive-label-add-path {
                          type string {
                            length "1..50";
                          }
                          config false;
                          description
                            "Whether the peer supports labeled Add-Path.";
                        }
    
                        leaf negotiate-label-add-path {
                          type string {
                            length "1..50";
                          }
                          config false;
                          description
                            "Negotiated Label Add-Path.";
                        }
    
                        leaf receive-prefix {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of received route prefixes.";
                        }
    
                        leaf receive-active-prefix {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of received prefixes of active routes.";
                        }
    
                        leaf advertise-prefix {
                          type uint32 {
                            range
                              "0..4294967295";
                          }
                          config false;
                          description
                            "Number of advertised route prefixes.";
                        }
    
                        leaf discard-attribute {
                          type string {
                            length "1..300";
                          }
                          config false;
                          description
                            "The attribute id discard info.";
                        }
    
                        leaf check-first-as {
                          type first-as-state;
                          config false;
                          description
                            "Check the first AS in the AS_Path of the update messages from EBGP peers.";
                        }
    
                        leaf extend-nexthop-capability {
                          type boolean;
                          config false;
                          description
                            "Peer extended next hop encoding capability.";
                        }
    
                        leaf egress-engineer-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports EPE.";
                        }
    
                        leaf orf-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports VPN orf capability.";
                        }
    
                        leaf rely-interface-capability {
                          type boolean;
                          config false;
                          description
                            "Whether the peer supports check interface.";
                        }
    
                        leaf remote-as {
                          type string {
                            length "1..11";
                          }
                          config false;
                          description
                            "AS number of the BGP peer.";
                        }
    
                        leaf memory-priority {
                          type memory-priority;
                          description
                            "Priority that is used to determine the disconnection order of a BGP peer relationship if memory overload occurs.";
                        }
    
                        leaf region-id {
                          ext:support-filter "true";
                          type uint32 {
                            range "1..65535";
                          }
                          description
                            "Region ID.";
                        }
    
                        leaf region-confederation-id {
                          type uint32 {
                            range "1..65535";
                          }
                          description
                            "Region confederation ID.";
                        }
                      }  // container state
                    }  // list af
                  }  // container afs
                }  // list peer
              }  // container peers
    
              container peer-bfd-session-states {
                config false;
                description
                  "List of BFD sessions.";
                list peer-bfd-session-state {
                  key "address";
                  config false;
                  description
                    "Operational state of BFD session.";
                  leaf address {
                    type inet:ip-address-no-zone;
                    config false;
                    description
                      "Peer address of the BFD session.";
                  }
    
                  leaf local-address {
                    type inet:ip-address-no-zone;
                    config false;
                    description
                      "Local address of the BFD session.";
                  }
    
                  leaf if-name {
                    type pub-type:if-name;
                    config false;
                    description
                      "Name of an interface of the BFD session.";
                  }
    
                  leaf tx-interval {
                    type uint32;
                    units "ms";
                    default "0";
                    config false;
                    description
                      "Interval at which BFD packets are sent.";
                  }
    
                  leaf rx-interval {
                    type uint32;
                    units "ms";
                    default "0";
                    config false;
                    description
                      "Interval at which BFD packets are received.";
                  }
    
                  leaf multiplier {
                    type uint32 {
                      range "0..50";
                    }
                    config false;
                    description
                      "Detection multiplier.";
                  }
    
                  leaf status {
                    type bfd-state;
                    config false;
                    description
                      "State of the BFD session.";
                  }
    
                  leaf global-bfd-enable {
                    type boolean;
                    config false;
                    description
                      "Global BFD state.";
                  }
    
                  leaf valid-ttl-hops {
                    type uint8 {
                      range "1..255";
                    }
                    config false;
                    description
                      "The valid TTL hops value.";
                  }
                }  // list peer-bfd-session-state
              }  // container peer-bfd-session-states
    
              container egress-engineer-peer-sets {
                when
                  "../../../ni:name='_public_'";
                description
                  "List of peer set information under BGP instance.";
                list egress-engineer-peer-set {
                  key "peer-set-name";
                  description
                    "Configure peer set information.";
                  leaf peer-set-name {
                    type string {
                      length "1..63";
                    }
                    description
                      "The name for peer set.";
                  }
    
                  leaf static-label {
                    type uint32 {
                      range "16..1048575";
                    }
                    description
                      "The static label for peer set. The value range and default value are controlled by the PAF.";
                  }
    
                  leaf label-pop {
                    when "../static-label";
                    type boolean;
                    must
                      "not(../relate-bfd='true' and ../label-pop='true')";
                    default "false";
                    description
                      "Enable/disable the BGP-EPE label popping function.";
                  }
    
                  leaf relate-bfd {
                    type boolean;
                    must
                      "not(../relate-bfd='true' and ../label-pop='true')";
                    default "false";
                    description
                      "Enable/disable association between the BGP-EPE label and BFD status.";
                  }
                }  // list egress-engineer-peer-set
              }  // container egress-engineer-peer-sets
            }  // container base-process
    
            container instance-processs {
              description
                "List of all BGP instances.";
              list instance-process {
                ext:generated-by "system" {
                  description "The BGP public instance is generated automatically when BGP instances is enabled.";
                }
                key "name";
                max-elements 1;
                description
                  "Configure a BGP instance.";
                leaf name {
                  type leafref {
                    path
                      "/bgp:bgp/bgp:instance-processs/bgp:instance-process/bgp:name";
                  }
                  description
                    "Name of BGP Site.";
                }
    
                leaf router-id {
                  type inet:ipv4-address-no-zone;
                  description
                    "ID of a router that is in IPv4 address format. Certain dynamic routing protocols require a router ID. If no router ID is specified for a router when these protocols are enabled, the router ID in the RM module is used by default. The default router ID in the RM module is 0.0.0.0 when the router is not configured with any interface. 
                   The rules for selecting a router ID are as follows:
                   1. If you set a router ID through this configuration, the set router ID is used. If the router ID is not set, you need to select a router ID according to the following rules:
                   (1) If loopback interfaces configured with IP addresses exist, the largest IP address among the IP addresses of the loopback interfaces is selected as the router ID.
                   (2) If no loopback interface configured with an IP address exists, the largest IP address among the IP addresses of other interfaces is selected as the router ID, regardless of whether the interface is Up.
                   The router ID is reselected only when the interface address that is selected as the router ID is deleted or changed. The router ID is not reselected in any of the following cases:
                   a. The interface is Down.
                   b. A loopback interface is configured when the IP address of a non-loopback interface is selected as the router ID.
                   c. A larger IP address of an interface is configured.
                   2. Each VPN instance selects the router ID from the addresses of the interfaces of the VPN instance according to the preceding rules.
                   3. When both the AMB and SMB exist on the router, the system backs up the router ID set through the related command and the router ID that is selected from IP addresses of the interfaces. After the active/standby switchover is performed, the system checks the validity of the router ID selected from the interface addresses. If the router ID is invalid, the system reselects a router ID.";
                }
    
                leaf effect-router-id {
                  type inet:ipv4-address-no-zone;
                  default "0.0.0.0";
                  config false;
                  description
                    "Router ID that takes effect.";
                }
    
                container afs {
                  description
                    "List of BGP address family instances.";
                  list af {
                    key "type";
                    description
                      "Configure BGP address family instance.";
                    leaf type {
                      type instance-af-type;
                      description
                        "Address family type of a BGP instance.";
                    }
    
                    container ipv4-unicast {
                      when
                        "../type = 'ipv4uni' and ../../../../../../ni:name!='_public_'";
                      must
                        "../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                      description
                        "Configure IPv4 unicast options.";
                      container common {
                        description
                          "Configure IPv4 unicast common options.";
                        uses common-configure;
    
                        uses ipv4-common-configure;
                      }  // container common
    
                      uses bgp-route-preference-options;
    
                      container nexthop-recursive-lookup {
                        description
                          "Configure next hop iteration.";
                        container common {
                          description
                            "Configure next hop iteration common options.";
                          uses nexthop-recursive-lookup-restrain;
                        }  // container common
    
                        uses nexthop-recursive-lookup-delay;
                      }  // container nexthop-recursive-lookup
    
                      uses ipv4-import-route;
    
                      uses ipv4-aggregate-routes;
    
                      uses ipv4-aggregate-default-route;
    
                      container network-routes {
                        description
                          "List of network routes.";
                        list network-route {
                          key "address mask-length";
                          description
                            "Configure a network route in the BGP routing table.";
                          uses network-route-ipv4;
                        }  // list network-route
                      }  // container network-routes
    
                      container import-ribs {
                        description
                          "List of imported RIBs configuration.";
                        list import-rib {
                          key "source-vpn source-address-family";
                          description
                            "Configure imported RIBs.";
                          leaf source-vpn {
                            type leafref {
                              path
                                "/ni:network-instance/ni:instances/ni:instance/ni:name";
                            }
                            must
                              "../../../../../../../../../ni:name != current()";
                            description
                              "Source VPN name.";
                          }
    
                          leaf source-address-family {
                            type vrf-import-rib-ipv4-safi-type;
                            description
                              "Source address family type.";
                          }
    
                          leaf valid-route {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable imported valid route.";
                          }
    
                          leaf include-label-route {
                            when
                              "../source-address-family='ipv4uni'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable imported include label route.";
                          }
    
                          uses choice-policy-set;
                        }  // list import-rib
                      }  // container import-ribs
    
                      container instance-import-ribs {
                        description
                          "List of imported RIBs from BGP instances configuration.";
                        list instance-import-rib {
                          key "source-instance source-vpn source-address-family";
                          description
                            "Configure imported RIBs.";
                          leaf source-instance {
                            type string {
                              length "1..31";
                            }
                            must
                              "../source-instance = 'default' and /bgp:bgp/bgp:base-process/bgp:enable='true'";
                            description
                              "Configure source BGP instance.";
                          }
    
                          leaf source-vpn {
                            type leafref {
                              path
                                "/ni:network-instance/ni:instances/ni:instance/ni:name";
                            }
                            must
                              "../../../../../../../../../ni:name != current()";
                            description
                              "Source VPN name.";
                          }
    
                          leaf source-address-family {
                            type vrf-import-rib-ipv4-safi-type;
                            description
                              "Source address family type.";
                          }
    
                          leaf valid-route {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable imported valid route.";
                          }
    
                          leaf include-label-route {
                            when
                              "../source-address-family='ipv4uni'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable imported include label route.";
                          }
    
                          uses choice-policy-set;
                        }  // list instance-import-rib
                      }  // container instance-import-ribs
    
                      uses ipv4-import-filter-protocol-type;
    
                      uses ipv4-export-filter-policys;
    
                      uses vrf-af-dampening-routes;
    
                      uses bgp:slow-peer-type;
    
                      uses qos-local-id-type;
                    }  // container ipv4-unicast
    
                    container ipv4-vpn {
                      when
                        "../type = 'ipv4vpn' and ../../../../../../ni:name='_public_'";
                      description
                        "Configure IPv4 VPNv4 options.";
                      uses vpn-target-type;
    
                      uses reflector-cluster-type;
    
                      uses reflect-type;
    
                      leaf auto-frr {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable BGP Auto FRR. If IP FRR, VPN FRR, and Auto FRR are all enabled, IP FRR and VPN FRR take precedence over Auto FRR. If a route fails to match the routing policy of IP FRR or VPN FRR, Auto FRR takes effect.";
                      }
    
                      leaf tunnel-selector-name {
                        type leafref {
                          path "/rtp:routing-policy/rtp:tunnel-selectors/rtp:tunnel-selector/rtp:name";
                        }
                        description
                          "Configure a tunnel selector and apply it to the BGP IPv4 unicast, BGP VPNv4 address families and BGP VPNv6 address families so that IPv4,VPNv4 and VPNv6 labeled routes can be iterated to tunnels based on the tunnel selector.";
                      }
    
                      leaf route-select-delay {
                        type uint16 {
                          range "0..3600";
                        }
                        units "s";
                        default "0";
                        description
                          "Route selection delay.";
                      }
    
                      leaf apply-label-mode {
                        type apply-label-type;
                        default "per-route";
                        description
                          "Method of distributing labels to VPNV4 and VPNV6 routes. The way which assigns the label depends on the paf value. If there are a large number of routes, assign a label for the routes that have same nexthop and out-label. This allows all routes which have same nexthop and out-label to use one label.";
                      }
    
                      leaf nexthop-select-depend-type {
                        type select-depend-type-ext;
                        default "depend-ip";
                        description
                          "Specify the route iteration mode: IP or tunnel. In tunnel mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an LSP. In IP 
                        mode, the labeled BGP IPv4 route can participate in route selection only after its next hop is iterated to an IP address. By default, the labeled BGP IPv4 route can participate in route selection 
                        if its next hop can be iterated to an IP address, regardless of whether the LSP of the next hop exists. This allows the RR that is not enabled with MPLS to forward labeled routes. In non-RR 
                        networking or RR networking where the BGP next hop is changed, BGP needs to check whether there is an LSP destined for the next hop. If such an LSP is not found, BGP needs to establish an LSP in 
                        advance. If the default setting is adopted, a labeled BGP IPv4 unicast route may be selected prior to LSP establishment. As a result, services are incorrectly switched before LSP establishment and 
                        service stability is affected. Therefore, allow route selection only after the labeled BGP IPv4 route is iterated to an LSP.";
                      }
    
                      leaf default-med {
                        type uint32;
                        default "0";
                        description
                          "Specify the Multi-Exit-Discriminator (MED) of BGP routes. The value is an integer. This value is valid only for the imported routes and BGP summarized routes on the local router.";
                      }
    
                      leaf best-external {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable best external route selection.";
                      }
    
                      leaf label-free-delay {
                        type uint8 {
                          range "0..180";
                        }
                        units "s";
                        default "0";
                        description
                          "Label free delay.";
                      }
    
                      leaf add-path-select-num {
                        type uint8 {
                          range "2..64";
                        }
                        description
                          "Number of Add-Path routes.";
                      }
    
                      leaf default-local-preference {
                        type uint32 {
                          range "0..4294967295";
                        }
                        default "100";
                        description
                          "The local preference of BGP routes.";
                      }
    
                      uses bestroute-med-plus-igp-type;
    
                      uses bestroute-router-id-prior-clusterlist-type;
    
                      leaf reflect-between-client {
                        type boolean;
                        default "true";
                        description
                          "Enable/disable route reflection between clients. If clients of a route reflector (RR) are fully meshed, you can disable route reflection among clients to reduce the cost.";
                      }
    
                      leaf activate-route-tag {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable tag-based filtering.";
                      }
    
                      uses route-reflector-ext-community-filter-type;
    
                      uses vrf-af-dampening-routes-ext;
    
                      container nexthop-recursive-lookup {
                        description
                          "Configure next hop iteration.";
                        container common {
                          description
                            "Configure next hop iteration common options.";
                          uses nexthop-recursive-lookup-restrain;
                        }  // container common
    
                        uses nexthop-recursive-lookup-delay;
    
                        uses bit-error-detection-type;
                      }  // container nexthop-recursive-lookup
    
                      uses ipv4-import-filter-protocol-type;
    
                      uses ipv4vpn-export-filter-protocol-type;
    
                      uses slow-peer-type;
                    }  // container ipv4-vpn
    
                    container ipv6-unicast {
                      when
                        "../type = 'ipv6uni' and ../../../../../../ni:name!='_public_'";
                      must
                        "../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                      description
                        "Configure IPv6 unicast options.";
                      container common {
                        description
                          "Configure IPv6 unicast common options.";
                        uses common-configure;
    
                        uses ipv6-common-configure;
                      }  // container common
    
                      uses ipv6-aggregate-default-route;
    
                      uses ipv6-aggregate-routes;
    
                      uses ipv6-import-route;
    
                      container nexthop-recursive-lookup {
                        description
                          "Configure next hop iteration.";
                        container common {
                          description
                            "Configure next hop iteration common options.";
                          uses ipv6-nexthop-recursive-lookup-restrain;
                        }  // container common
    
                        uses nexthop-recursive-lookup-delay;
                      }  // container nexthop-recursive-lookup
    
                      container network-routes {
                        description
                          "List of network routes.";
                        list network-route {
                          key "address mask-length";
                          description
                            "Configure a network route in the BGP routing table.";
                          uses network-route-ipv6;
                        }  // list network-route
                      }  // container network-routes
    
                      container advertise-route-to-evpns {
                        description
                          "Configure advertise route protocol.";
                        uses advertise-route-to-evpn-type;
                      }  // container advertise-route-to-evpns
    
                      uses bgp-route-preference-options;
                    }  // container ipv6-unicast
                  }  // list af
                }  // container afs
    
                container vpn-as-number {
                  when
                    "../../../../ni:name!='_public_'";
                  description
                    "Configure BGP vpn as-number.";
                  leaf local-ipv4 {
                    type as-number-validate;
                    description
                      "IPv4 as-number.";
                  }
    
                  leaf local-ipv6 {
                    type as-number-validate;
                    description
                      "IPv6 as-number.";
                  }
                }  // container vpn-as-number
    
                container peer-groups {
                  description
                    "List of BGP peer groups. The BGP peer groups can help you simplify the configurations. If you want to perform the same configuration for several peers, you can create a peer group and then configure the peer group. After you add these peers to the peer group, all these peers will have the same configurations as the peer group.";
                  list peer-group {
                    key "name";
                    description
                      "Configure information about a BGP peer group.";
                    leaf name {
                      type string {
                        length "1..47";
                        pattern '([^\? ]+)';
                      }
                      description
                        "Specify the name of a peer group. The value is a string of characters, spaces not supported.";
                    }
    
                    leaf type {
                      ext:operation-exclude "update" {
                        description "The node cannot be modified, when node is already configured.";
                      }
                      type group-type;
                      mandatory true;
                      description
                        "Specify the type of a peer group. The value can be IBGP or EBGP.The object cannot be modified.";
                    }
    
                    uses peer-local-if-type;
    
                    uses authentication-attr-type;
    
                    leaf tcp-ao-name {
                      type leafref {
                        path "/socket:socket/socket:tcp-aos/socket:tcp-ao/socket:name";
                      }
                      must
                        "not(../password-type!='null' or ../key-chain-name)";
                      description
                        "Specify TCP-AO authentication for establishing the TCP connection between BGP peers.";
                    }
    
                    leaf description {
                      type string {
                        length "1..255";
                        pattern '([^?]*)';
                      }
                      description
                        "Specify the description of a peer group. The value is a string, which can be letters or digits, spaces supported. By default, no description is configured.";
                    }
    
                    leaf group-as {
                      when "not(../type='ibgp')";
                      type as-number-validate;
                      description
                        "Specify the AS number of a peer group. The AS number is in either a 2-byte or 4-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 ebgp-max-hop {
                      when "../type='ebgp'";
                      type uint32 {
                        range "1..255";
                      }
                      must
                        "not(../valid-ttl-hops) or (../valid-ttl-hops>=1 and not(../valid-ttl-hops>255) and ../ebgp-max-hop=1)";
                      default "1";
                      description
                        "Maximum number of hops in an indirect EBGP connection. By default, EBGP connections can be established only between directly connected peers. The function must be configured on both ends.";
                    }
    
                    leaf valid-ttl-hops {
                      type uint16 {
                        range "1..255";
                      }
                      must
                        "not(../ebgp-max-hop and ../ebgp-max-hop>1)";
                      description
                        "Enable GTSM on a peer or peer group. The valid-TTL-Value parameter is used to specify the number of TTL hops to be detected. If the value is configured as hops, the valid TTL range of the detected packet is [255-hops+1, 255].";
                    }
    
                    uses peer-tracking-type;
    
                    leaf conventional {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable general router functions on peers. In conventional mode, not all the extended router functions, such as, route refreshing, GR, and multi-address family negotiation, are available. Therefore, the router of a new version can be compatible with the routers of earlier versions.";
                    }
    
                    leaf route-refresh {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to advertise Refresh messages to peers.";
                    }
    
                    leaf four-byte-as {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to advertise routes carrying 4-byte AS numbers to peers. After the 4-byte AS number function is disabled, Open packets will not carry 4-byte AS number capability flag, and peer ends will not know that local ends have the 4-byte AS number function. The 4-byte AS number function cannot be disabled from peers (peer groups) if a 4-byte AS number, fake AS number, or confederation ID is configured on a router and the AS number of a peer is 4-byte. If the 4-byte AS number function is disabled in such a situation, BGP sessions may fail to be established, and route transmission may be affected.";
                    }
    
                    leaf ignore {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable the function to tear down sessions between peers and clear all related routing information.";
                    }
    
                    leaf connect-mode {
                      type connect-mode;
                      default "null";
                      description
                        "The value can be Connect-only, Listen-only, or Both. If the value is Connect-only, the specified peer or peer group only initiatively sends connection requests, instead of listening to connection requests. If the value is Listen-only, the specified peer or peer group only listens to connection requests, instead of initiatively sending connection requests. If the value is Both, the specified peer or peer group not only initiatively sends connection requests, but also listens to connection requests. The default value is Both.";
                    }
    
                    leaf log-change {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to record the session status and events of the specified peer or peer group.";
                    }
    
                    leaf check-first-as {
                      when "../type='ebgp'";
                      type peer-cap-config-state;
                      default "default";
                      description
                        "Check the first AS in the AS_Path of the update messages from EBGP peers.";
                    }
    
                    leaf memory-priority {
                      type memory-priority;
                      default "medium";
                      description
                        "Set a priority that determines the disconnection order of each BGP peer relationship in a peer group if memory overload occurs.";
                    }
    
                    leaf oscillation-dampening {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to suppress the establishment of a specified peer group's peer relationships that flap continuously. By default, the capability is enabled.";
                    }
    
                    container fake-as-parameter {
                      when
                        "../../../../../../ni:name!='_public_'";
                      description
                        "Configure BGP fake-as parameters.";
                      leaf fake-as {
                        when
                          "../../bgp:type='ebgp'";
                        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.";
                      }
                    }  // container fake-as-parameter
    
                    uses peer-timer-para-type;
    
                    uses group-bfd-parameter-type;
    
                    container graceful-restart {
                      description
                        "Configure graceful restart.";
                      uses group-graceful-restart-type;
    
                      leaf peer-reset {
                        type boolean;
                        default "false";
                        description
                          "Enable/disable reseting BGP peer graceful.";
                      }
                    }  // container graceful-restart
    
                    container local-graceful-restart {
                      description
                        "Configure local graceful restart.";
                      uses group-graceful-restart-type;
                    }  // container local-graceful-restart
    
                    container afs {
                      description
                        "List of all peer groups that are enabled in a specified address family.";
                      list af {
                        key "type";
                        description
                          "Configure peer group enabled in a specified address family.";
                        leaf type {
                          type instance-group-af-type;
                          must
                            "../../../../../afs/af[type = current()]";
                          description
                            "Address family type of a BGP instance.";
                        }
    
                        container ipv4-unicast {
                          when
                            "../type = 'ipv4uni' and ../../../../../../../../ni:name!='_public_'";
                          must
                            "../../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                          description
                            "Configure IPv4 unicast options.";
                          leaf reflect-client {
                            when
                              "../../../../bgp:type='ibgp'";
                            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.";
                          }
    
                          leaf label-route-capability {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable a device to exchange labeled routes.";
                          }
    
                          leaf check-tunnel-reachable {
                            when
                              "../label-route-capability='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable tunnel reachability check.";
                          }
    
                          leaf nexthop-configure {
                            type vrf-nexthop-configuration-type;
                            description
                              "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNv6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                          }
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          uses ip-prefix-filter-type;
    
                          uses as-path-filter-type;
    
                          uses peer-group-acl-name-or-num-type;
    
                          uses default-route-advertise-type;
    
                          leaf default-route-match-mode {
                            when
                              "../default-route-advertise='true'";
                            type cra-match-mode;
                            default "null";
                            description
                              "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                          }
    
                          uses rt-update-interval-type;
    
                          uses preferred-value-type;
    
                          leaf substitute-as-enable {
                            when
                              "../../../../bgp:type='ebgp'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                          }
    
                          leaf soo {
                            type string {
                              length "3..21";
                            }
                            description
                              "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                            Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                            The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                          }
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          uses load-balancing-type;
    
                          uses group-independent-peer-group-type;
    
                          uses community-attribute;
    
                          uses advertise-large-community-group-type;
    
                          uses ipv4-default-route-match-conditions-type;
    
                          uses route-limit-accept-type;
    
                          uses public-as-only-type;
    
                          uses group-public-as-only-import-type;
                        }  // container ipv4-unicast
    
                        container ipv4-vpn {
                          when
                            "../type = 'ipv4vpn' and ../../../../../../../../ni:name='_public_'";
                          description
                            "Configure IPv4 vpnv4 options.";
                          leaf advertise-community {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable advertise the community attribute to a peer or a peer group.";
                          }
    
                          leaf reflect-client {
                            when
                              "../../../../bgp:type='ibgp'";
                            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.";
                          }
    
                          leaf nexthop-configure {
                            type nexthop-configuration-type;
                            description
                              "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                          }
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          leaf aigp {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                          }
    
                          leaf add-path-mode {
                            when
                              "../../../../bgp:type='ibgp'";
                            type add-path-cap-type;
                            default "null";
                            description
                              "Enable Add-Path route advertisement to a peer.";
                          }
    
                          uses ip-prefix-filter-type;
    
                          uses as-path-filter-type;
    
                          uses peer-group-acl-name-or-num-type;
    
                          uses rt-update-interval-type;
    
                          uses preferred-value-type;
    
                          leaf add-path-number {
                            when
                              "../../../../bgp:type='ibgp'";
                            type uint8 {
                              range "2..64";
                            }
                            description
                              "Number of Add-Path routes that can be advertised to a peer.";
                          }
    
                          leaf upe {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the peer as an underlayer PE (UPE).";
                          }
    
                          leaf advertise-best-external {
                            when
                              "../../../../bgp:type='ibgp'";
                            type boolean;
                            must
                              "../reflect-client='false' or ../advertise-best-external='false'";
                            must
                              "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                            must
                              "not(../add-path-number and ../advertise-best-external='true')";
                            default "false";
                            description
                              "Enable/disable the device to advertise Best External routes to peers.";
                          }
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          uses group-independent-peer-group-type;
    
                          leaf origin-as-validation {
                            when
                              "../../../../bgp:type='ibgp'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the BGP peer origin validation.";
                          }
    
                          container default-route-originates {
                            description
                              "Configure advertised default VPNv4 routes.";
                            uses default-route-originate-type;
                          }  // container default-route-originates
    
                          uses route-limit-type;
    
                          uses public-as-only-type;
    
                          uses group-public-as-only-import-type;
                        }  // container ipv4-vpn
    
                        container ipv6-unicast {
                          when
                            "../type = 'ipv6uni' and ../../../../../../../../ni:name!='_public_'";
                          must
                            "../../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                          description
                            "Configure IPv6 unicast options.";
                          uses community-attribute;
    
                          uses advertise-large-community-group-type;
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          leaf reflect-client {
                            when
                              "../../../../bgp:type='ibgp'";
                            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.";
                          }
    
                          uses preferred-value-type;
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          uses as-path-filter-type;
    
                          uses ipv6-prefix-filter-type;
    
                          uses route-limit-type;
    
                          uses public-as-only-type;
    
                          uses group-public-as-only-import-type;
                        }  // container ipv6-unicast
                      }  // list af
                    }  // container afs
                  }  // list peer-group
                }  // container peer-groups
    
                container peers {
                  description
                    "List of BGP peers.";
                  list peer {
                    key "address";
                    description
                      "Configure a single BGP peer.";
                    leaf address {
                      type inet:ip-address-no-zone;
                      description
                        "Connection address of a peer, which can be an IPv4 or IPv6 address.";
                    }
    
                    leaf remote-as {
                      ext:operation-exclude "update" {
                        description "The node cannot be modified, when node is already configured.";
                      }
                      type as-number-validate;
                      mandatory true;
                      description
                        "AS number of a peer, which must be selected or group name when creating, and which 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.
                       The object cannot be modified.";
                    }
    
                    leaf group-name {
                      ext:operation-exclude "update" {
                        description "The node cannot be modified, when the peer already belongs to a peer-group.";
                      }
                      type leafref {
                        path "../../../peer-groups/peer-group/name";
                      }
                      description
                        "Specify the name of a peer group that BGP peers need to join. That must be selected group name or AS when creating, and the value is a string, spaces not supported. By default, BGP peers join no peer group. BGP peers distinguish the peer group type when joining a peer group. IBGP peers cannot join an EBGP peer group. BGP peers will be deleted when they leave a peer group. The object cannot be modified.";
                    }
    
                    uses peer-local-if-type {
                      refine local-if-address {
                        must
                          "not(contains(., ':'))";
                      }
                    }
    
                    uses authentication-attr-type;
    
                    leaf tcp-ao-disable {
                      type empty;
                      description
                        "Disable the TCP-AO authentication for establishing the TCP connection between BGP peers.";
                    }
    
                    leaf tcp-ao-name {
                      when
                        "not(../tcp-ao-disable)";
                      type leafref {
                        path "/socket:socket/socket:tcp-aos/socket:tcp-ao/socket:name";
                      }
                      must
                        "not(../password-type!='null' or ../key-chain-name)";
                      description
                        "Specify TCP-AO authentication for establishing the TCP connection between BGP peers.";
                    }
    
                    leaf description {
                      type string {
                        length "1..255";
                        pattern '([^?]*)';
                      }
                      description
                        "Description of a peer, which can be letters or digits. The description is a string, spaces supported. By default, no description is configured for a peer.";
                    }
    
                    leaf ebgp-max-hop {
                      type uint32 {
                        range "1..255";
                      }
                      must
                        "not(../valid-ttl-hops) or (../valid-ttl-hops>=1 and ../valid-ttl-hops<=255 and ../ebgp-max-hop=1)";
                      description
                        "Maximum number of hops in an indirect EBGP connection. By default, EBGP connections can be established only between directly connected peers. The function must be configured on both ends. By default, value is determined by the neighbor type, the default value of EBGP is 1 and the default value of IBGP is 0.";
                    }
    
                    uses peer-tracking-type;
    
                    leaf conventional {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable general router functions on peers. In conventional mode, not all the extended router functions, such as, route refreshing, GR, and multi-address family negotiation, are available. Therefore, the router of a new version can be compatible with the routers of earlier versions.";
                    }
    
                    leaf route-refresh {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to advertise Refresh messages to peers.";
                    }
    
                    leaf four-byte-as {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to advertise routes carrying 4-byte AS numbers to peers. After the 4-byte AS number function is disabled, Open packets will not carry 4-byte AS number capability flag, and peer ends will not know that local ends have the 4-byte AS number function. The 4-byte AS number function cannot be disabled from peers (peer groups) if a 4-byte AS number, fake AS number, or confederation ID is configured on a router and the AS number of a peer is 4-byte. If the 4-byte AS number function is disabled in such a situation, BGP sessions may fail to be established, and route transmission may be affected.";
                    }
    
                    leaf ignore {
                      type boolean;
                      default "false";
                      description
                        "Enable/disable the function to tear down sessions between peers and clear all related routing information.";
                    }
    
                    leaf valid-ttl-hops {
                      type uint16 {
                        range "1..255";
                      }
                      must
                        "not(../ebgp-max-hop and ../ebgp-max-hop>1)";
                      description
                        "Enable GTSM on a peer or peer group. The valid-TTL-Value parameter is used to specify the number of TTL hops to be detected. If the value is configured as hops, the valid TTL range of the detected packet is [255-hops+1, 255].";
                    }
    
                    leaf connect-mode {
                      type connect-mode;
                      default "null";
                      description
                        "The value can be Connect-only, Listen-only, or Both. If the value is Connect-only, the specified peer or peer group only initiatively sends connection requests, instead of listening to connection requests. If the value is Listen-only, the specified peer or peer group only listens to connection requests, instead of initiatively sending connection requests. If the value is Both, the specified peer or peer group not only initiatively sends connection requests, but also listens to connection requests. The default value is Both.";
                    }
    
                    leaf log-change {
                      type boolean;
                      default "true";
                      description
                        "Enable/disable BGP to record the session status and events of the specified peer or peer group.";
                    }
    
                    leaf check-first-as {
                      type peer-cap-config-state;
                      default "default";
                      description
                        "Check the first AS in the AS_Path of the update messages from EBGP peers.";
                    }
    
                    leaf memory-priority {
                      type peer-memory-priority;
                      default "default";
                      description
                        "Set a priority that determines the disconnection order of a BGP peer relationship if memory overload occurs.";
                    }
    
                    leaf memory-priority-capability {
                      type memory-priority;
                      config false;
                      description
                        "Priority that is used to determine the disconnection order of a BGP peer relationship if memory overload occurs.";
                    }
    
                    leaf oscillation-dampening {
                      type peer-attr-enable-type;
                      description
                        "Enable/disable BGP to suppress the establishment of a specified peer relationship that flaps continuously. By default, the capability is enabled.";
                    }
    
                    container fake-as-parameter {
                      when
                        "../../../../../../ni:name!='_public_'";
                      description
                        "Configure BGP fake-as parameters.";
                      uses fake-as-type;
                    }  // container fake-as-parameter
    
                    uses peer-timer-para-type;
    
                    uses peer-bfd-parameter-type;
    
                    uses peer-bfd-parameter-state-grouping;
    
                    container graceful-restart {
                      description
                        "Configure graceful restart.";
                      uses peer-graceful-restart-type;
    
                      leaf peer-reset {
                        type peer-comm-config-type;
                        default "default";
                        description
                          "Enable/disable reseting BGP peer graceful.";
                      }
    
                      leaf effect-peer-reset {
                        type boolean;
                        config false;
                        description
                          "Whether enable/disable reseting BGP peer graceful.";
                      }
                    }  // container graceful-restart
    
                    container local-graceful-restart {
                      description
                        "Configure local graceful restart.";
                      uses peer-graceful-restart-type;
                    }  // container local-graceful-restart
    
                    container afs {
                      description
                        "List of peers in a specified address family.";
                      list af {
                        key "type";
                        description
                          "Configure peer in a specified address family.";
                        leaf type {
                          type instance-af-type;
                          must
                            "../../../../../afs/af[type = current()]";
                          description
                            "Specify the address family type to set the peer enable.";
                        }
    
                        container ipv4-unicast {
                          when
                            "../type='ipv4uni' and ../../../../../../../../ni:name!='_public_'";
                          must
                            "../../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']";
                          description
                            "Configure IPv4 unicast options.";
                          leaf group-name {
                            ext:operation-exclude "update" {
                              description "The node cannot be modified, when the peer already belongs to a peer-group.";
                            }
                            type leafref {
                              path "../../../../../../peer-groups/peer-group/name";
                            }
                            must
                              "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4uni']";
                            description
                              "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                          }
    
                          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.";
                          }
    
                          leaf label-route-capability {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable a device to exchange labeled routes.";
                          }
    
                          leaf check-tunnel-reachable {
                            when
                              "../label-route-capability='true'";
                            type boolean;
                            default "false";
                            description
                              "Enable/disable tunnel reachability check.";
                          }
    
                          leaf nexthop-configure {
                            type vrf-nexthop-configuration-type;
                            description
                              "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                          }
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          uses default-route-advertise-type;
    
                          leaf default-route-match-mode {
                            when
                              "../default-route-advertise='true'";
                            type cra-match-mode;
                            default "null";
                            description
                              "Configure the matching mode of default route advertisement, which can be disabling of route advertisement conditions, enabling of all route advertisement conditions, and enabling of part route advertisement conditions. Enabling of all route advertisement conditions indicates that a default route can be advertised only when it matches all the conditions. Enabling of part route advertisement conditions indicates that a default route can be advertised only when it matches one condition.";
                          }
    
                          uses ip-prefix-filter-type;
    
                          uses as-path-filter-type;
    
                          uses peer-group-acl-name-or-num-type;
    
                          uses rt-update-interval-type;
    
                          uses preferred-value-type;
    
                          leaf substitute-as-enable {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable replace the AS number of a specified peer in the AS_Path attribute with the local AS number. On a PE where AS number replacement is enabled, if an AS number in the AS_Path attribute of a route is same as that of the CE to which the PE advertises the route, the PE replaces the AS number with its own AS number before advertising the route.";
                          }
    
                          leaf soo {
                            type string {
                              length "3..21";
                            }
                            description
                              "Configure the Site-of-Origin (SoO) extended community attribute. This attribute can be expressed in the following formats: X.X.X.X:number<0-65535>, number<0-65535>:number<0-4294967295>, or number<0-65535>.number<0-65535>:number<0-65535> or <65536-4294967295>:<0-65535>. 0:0 or 0.0:0 is not supported. 
                            Two CEs are in the same site and can advertise routes to each other, and they are connected to a VPN through PEs. If the local routes of a CE are advertised to the other CE over the VPN, a routing loop may occur. 
                            The SoO feature can prevent a route advertised by a site from being sent back to the site, preventing routing loops. After SoO is enabled and a PE receives a route from a CE, the specified SoO attribute will be added to the route. Before advertising the route to the other CE, the PE checks the SoO attribute. If the SoO attribute is the same as the locally configured SoO attribute, the PE does not advertise the route, preventing routing loops.";
                          }
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          uses load-balancing-type;
    
                          uses community-attribute;
    
                          uses advertise-large-community-type;
    
                          uses peer-independent-peer-group-type;
    
                          uses ipv4-default-route-match-conditions-type;
    
                          uses route-limit-accept-type;
    
                          uses public-as-only-type;
    
                          uses peer-public-as-only-import-type;
    
                          uses path-attr-map-type;
                        }  // container ipv4-unicast
    
                        container ipv4-vpn {
                          when
                            "../type = 'ipv4vpn' and ../../../../../../../../ni:name='_public_'";
                          description
                            "Configure IPv4 VPNv4 options.";
                          leaf group-name {
                            ext:operation-exclude "update" {
                              description "The node cannot be modified, when the peer already belongs to a peer-group.";
                            }
                            type leafref {
                              path "../../../../../../peer-groups/peer-group/name";
                            }
                            must
                              "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv4vpn']";
                            description
                              "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                          }
    
                          leaf advertise-community {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable advertise the community attribute to a peer or a peer group.";
                          }
    
                          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.";
                          }
    
                          leaf nexthop-configure {
                            type nexthop-configuration-type;
                            description
                              "Both the next-hop-local mode and next-hop-invariable mode are available when the peer address family is the VPNv4/VPNV6/L2VPN AD address family. Only the next-hop-local mode is available when the peer address family is not VPNv4/VPNV6/L2VPN AD address family. In next-hop-local mode, you can configure a BGP speaker to set its IP address of as the next hop of the routes to be advertised to IBGP peers or IBGP peer groups. In next-hop-invariable mode, you can configure PEs in different ASs not to change the next hop of routes when the PEs advertise the routes to their EBGP peers and use the next hop addresses of IGP routes to advertise imported IGP routes to IBGP peers. By default, when a BGP speaker advertises routes to EBGP peers and imported IGP routes to IBGP peers, the BGP speaker changes the next hop to its interface address.";
                          }
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          leaf aigp {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable route with AIGP attribute advertisement to or from a peer.";
                          }
    
                          uses peer-add-path-type;
    
                          uses ip-prefix-filter-type;
    
                          uses as-path-filter-type;
    
                          uses peer-group-acl-name-or-num-type;
    
                          uses rt-update-interval-type;
    
                          uses preferred-value-type;
    
                          leaf upe {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable the peer as an underlayer PE (UPE).";
                          }
    
                          leaf advertise-best-external {
                            type boolean;
                            must
                              "../reflect-client='false' or ../advertise-best-external='false'";
                            must
                              "../add-path-mode='null' or not(../add-path-mode) or ../advertise-best-external='false'";
                            must
                              "not(../add-path-number and ../advertise-best-external='true')";
                            default "false";
                            description
                              "Enable/disable the device to advertise Best External routes to peers.";
                          }
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          uses peer-independent-peer-group-type;
    
                          uses peer-origin-as-validation-type;
    
                          container default-route-originates {
                            description
                              "Configure advertised default VPNv4 routes.";
                            uses default-route-originate-type;
                          }  // container default-route-originates
    
                          uses route-limit-type;
    
                          uses public-as-only-type;
    
                          uses peer-public-as-only-import-type;
    
                          uses path-attr-map-type;
                        }  // container ipv4-vpn
    
                        container ipv6-unicast {
                          when
                            "../type='ipv6uni' and ../../../../../../../../ni:name!='_public_'";
                          must
                            "../../../../../../../../l3vpn:afs/l3vpn:af[l3vpn:type='ipv6-unicast']";
                          description
                            "Configure IPv6 unicast options.";
                          leaf group-name {
                            ext:operation-exclude "update" {
                              description "The node cannot be modified, when the peer already belongs to a peer-group.";
                            }
                            type leafref {
                              path "../../../../../../peer-groups/peer-group/name";
                            }
                            must
                              "../../../../../../peer-groups/peer-group[name = current()]/afs/af[type = 'ipv6uni']";
                            description
                              "Configure a name for a peer group. After a peer is deleted from the peer group, the peer is disabled from the address family. The object cannot be modified.";
                          }
    
                          uses community-attribute;
    
                          uses advertise-large-community-type;
    
                          leaf keep-all-routes {
                            type boolean;
                            default "false";
                            description
                              "Enable/disable saving all the updated information about BGP routes from a specified peer or peer group after a BGP connection is established, even though these BGP routes fail to match the routing policy on the ingress. By default, the updated information about BGP routes from a specified peer is saved only when the routes match the routing policy on the ingress. If a router supports route refreshing, this option is not required.";
                          }
    
                          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.";
                          }
    
                          uses preferred-value-type;
    
                          uses peer-policy-filter-type;
    
                          leaf allow-as-loop {
                            type uint32 {
                              range "1..10";
                            }
                            description
                              "Allow repetitive local AS numbers. By default, repetitive local AS numbers are not allowed.";
                          }
    
                          uses as-path-filter-type;
    
                          uses ipv6-prefix-filter-type;
    
                          uses route-limit-type;
    
                          uses public-as-only-type;
    
                          uses peer-public-as-only-import-type;
                        }  // container ipv6-unicast
                      }  // list af
                    }  // container afs
                  }  // list peer
                }  // container peers
              }  // list instance-process
            }  // container instance-processs
          }  // container bgp
        }
      }  // module huawei-bgp
    

© 2023 YumaWorks, Inc. All rights reserved.