This YANG module defines a YANG data model to configure and manage Layer3 VPNs. It augments the huawei-network-instance yang mod...
Version: 2021-08-11
module huawei-l3vpn { yang-version 1; namespace "urn:huawei:yang:huawei-l3vpn"; prefix l3vpn; import huawei-extension { prefix ext; } import huawei-network-instance { prefix ni; } import ietf-yang-types { prefix yang; } import huawei-pub-type { prefix pub-type; } import huawei-routing-policy { prefix rtp; } import huawei-tunnel-management { prefix tnlm; } import huawei-xpl { prefix xpl; } import ietf-inet-types { prefix inet; } include huawei-l3vpn-type; organization "Huawei Technologies Co., Ltd."; contact "Huawei Industrial Base Bantian, Longgang Shenzhen 518129 People's Republic of China Website: http://www.huawei.com Email: support@huawei.com"; description "This YANG module defines a YANG data model to configure and manage Layer3 VPNs. It augments the huawei-network-instance yang model to add L3VPN specific configuration."; revision "2021-08-11" { description "Change the default value of node label-mode."; reference "Huawei private."; } revision "2019-07-05" { description "Modify descriptions of the YANG file."; reference "Huawei private."; } revision "2019-04-27" { description "Initial revision."; reference "Huawei private."; } ext:task-name "l3vpn"; container l3vpn { description "Layer 3 Virtual Private Network (L3VPN). An L3VPN is a virtual private network set up over public networks by Internet Service Providers (ISPs) and Network Service Providers (NSPs)."; container statistics { config false; description "Statistics of L3VPN information."; leaf vpn-total-number { type uint32; description "VPN total number."; } leaf ipv4-vpn-number { type uint32; description "IPv4 unicast VPN number."; } leaf ipv6-vpn-number { type uint32; description "IPv6 unicast VPN number."; } leaf vpn-max-number { type uint32; description "Maximum number of VPNs."; } } // container statistics } // container l3vpn augment /ni:network-instance/ni:instances/ni:instance { description "Augment the huawei-network-instance model to add L3VPN specific configuration."; leaf traffic-statistic-enable { when "../ni:name!='_public_'"; type boolean; default "false"; description "Enable/disable L3VPN traffic statistics."; } container parameter { when "../ni:name!='_public_'"; description "Configure L3VPN instances information."; leaf identifier { type string { length "3..15"; pattern '[1-9a-f][0-9a-f]{0,5}:[1-9a-f][0-9a-f]{0,7}|0:[1-9a-f][0-9a-f]{0,7}|[1-9a-f][0-9a-f]{0,5}:0'; } must "count(/ni:network-instance/ni:instances/ni:instance[l3vpn:parameter/l3vpn:identifier=current()])=1"; description "Configures a globally unique identifier for a VPN instance. The format of a VPN identifier are follows:HEX<0-ffffff>:HEX<0-ffffffff>, but not support 0:0."; } leaf vn-id { type uint32 { range "1..16777215"; } description "Configures a VN ID."; } } // container parameter container afs { description "List of VPN address families. A VPN instance supports the configurations and functions of an address family only after the address family is configured on the instance."; list af { ext:generated-by "system" { when "../../ni:name = '_public_'"; description "The address families of the public instance are generated automatically when public instance is created."; } key "type"; max-elements 2; description "Configure address families of the VPN instance. A VPN instance supports the configurations and functions of an address family only after the address family is configured on the instance. Neither of the address families in the _public_ VPN instance can be deleted. If either of a VPN instance's IPv4 and IPv6 address families is referenced by BGP, the referenced address family cannot be deleted. If one of the address families is referenced by BGP, the non-referenced address family in the VPN instance can be deleted. If the VPN instance is referenced by BGP but its address families are not referenced by BGP, neither address family can be deleted."; leaf type { type af-type; description "Types of the VPN address families."; } leaf route-distinguisher { when "../../../ni:name!='_public_'"; type string { length "3..21"; } description "A VPN address family takes effect only after it is configured with a RD.The object allows configuration and deletion, it cannot be modified. The format of an RD are as follows: (1) 16-bit AS number :32-bit user-defined number, for example, 101:3. An AS number ranges from 0 to 65535, and a user-defined number ranges from 0 to 4294967295. The AS number and user-defined number cannot be both 0s. This means that the RD value cannot be 0:0. (2) 32-bit IP address:16-bit user-defined number, for example: 192.168.122.15:1.The IP address ranges from 0.0.0.0 to 255.255.255.255, and the user-defined number ranges from 0 to 65535. (3) 32-bit AS number :16-bit user-defined number, for example, 10.11:3. An AS number ranges from 0.0 to 65535.65535 or 0 to 4294967295, and a user-defined number ranges from 0 to 65535. The AS number and user-defined number cannot be both 0s. This means that the RD value cannot be 0.0:0. If a VPN instance's IPv4 or IPv6 address family to which the node belongs is referenced by BGP, the node cannot be deleted. If the IPv4 or IPv6 address family to which the node belongs is not referenced by BGP and the other address family is referenced by BGP, the node can be deleted. If the VPN instance is referenced by BGP but its address families are not referenced by BGP, the nodes in the address families cannot be deleted."; } leaf effect-route-distinguisher { type string { length "3..21"; } config false; description "Effective RD."; } choice import-policy-type { description "Set route policy or filter."; case rtp-ref { description "Route policy."; leaf import-policy { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type leafref { path "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name"; } description "Name of a route import policy. The policy is associating the VPN instance with an inbound routing policy. If a mode that is more accurate than the extended community attribute mode is required for filtering import VPN instance routes, the inbound routing policy can be adopted. The inbound routing policy can filter imported routes and set routing attributes for the qualified routes. If the inbound routing policy is not configured, all routes matching the VPN-target attribute are added to the VPN instance."; } } // case rtp-ref case xpl-ref { description "Route filter."; container import-filter { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; description "Configure an import route-filter with the current VPN instance. To control the routes imported to a VPN instance in a more precise way than using extcommunity attributes, you can specify an import route-filter. The import route-filter can be used to filter the imported routes and set attributes for the qualified routes. If no import route-filter is specified, all routes that match the VPN instance's VPN targets will be added to the VPN instance."; leaf name { type leafref { path "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name"; } description "Specify an import route-filter name."; } leaf parameter { when "../name"; type xpl:filter-parameter-type; description "Specify an import route-filter parameter."; } } // container import-filter } // case xpl-ref } // choice import-policy-type choice export-policy-type { description "Set route policy or filter."; case rtp-ref { description "Route policy."; leaf export-policy { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type leafref { path "/rtp:routing-policy/rtp:policy-definitions/rtp:policy-definition/rtp:name"; } description "Name of a route export policy. The policy is associating the VPN instance with an outbound routing policy. If a mode that is more accurate than the extended community attribute mode is required to control the advertisement ofVPN instance routes, the outbound routing policy can be adopted. The outbound routing policy can filter the routes to be advertised and set routing attributes for the qualified routes. If the outbound routing policy is not configured, all routes can be advertised."; } } // case rtp-ref case xpl-ref { description "Route filter."; container export-filter { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; description "Configure an export route-filter with the current VPN instance. To control the routes to be advertised to a VPN instance in a more precise way than using extcommunity attributes, you can specify an export route-filter. The export route-filter can be used to filter the routes to be advertised and set attributes for the qualified routes. If no export route-filter is specified, all routes will be advertised to the VPN instance."; leaf name { type leafref { path "/xpl:xpl/xpl:route-filters/xpl:route-filter/xpl:name"; } description "Specify an export route-filter name."; } leaf parameter { when "../name"; type xpl:filter-parameter-type; description "Specify an export route-filter parameter."; } } // container export-filter } // case xpl-ref } // choice export-policy-type leaf export-policy-add-ert-first { when "../export-policy or ../export-filter/name"; type boolean; default "false"; description "Enable/disable advertise routes to VPNv4 add ERT first."; } leaf label-mode { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type label-mode-type; default "per-instance"; description "Method of distributing labels to VPN instance routes. The way which assigns the label depends on the paf value. If there are a large number of routes in a VPN instance, assign a label for each instance. This allows all routes in the instance to use one label."; } leaf static-label { when "../type = 'ipv4-unicast' and ../label-mode = 'per-instance'"; type uint32 { range "16..1048575"; } description "Enable a device to assign the same static label to all routes destined for a remote PE in a VPN instance IPv4 address family."; } leaf vpn-frr { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type boolean; default "false"; description "Enable/disable the VPN FRR function."; } leaf tunnel-policy { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type leafref { path "/tnlm:tunnel-management/tnlm:tunnel-policys/tnlm:tunnel-policy/tnlm:name"; } description "Name of a tunnel policy. It is used to associate the VPN instance with the specified tunnel policy. If no tunnel policy is configured, the default tunnel policy is used. Only LDP LSPs or static LSPs match the default tunnel policy, and load balancing is not performed for LSPs."; } leaf transit-vpn { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type boolean; default "false"; description "Enable/disable keeping the VPN instance status up."; } leaf lsp-operation { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type lsp-operation-type; must "../label-mode and ../label-mode!='per-instance' or ../lsp-operation='pop'"; default "pop"; description "Label Operation Mode."; } leaf default-color { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; type uint32 { range "0..4294967295"; } description "Set default color for nexthop iteration."; } container vpn-targets { when "../../../ni:name!='_public_' and (../route-distinguisher or ../../../../../ni:global/ni:route-distinguisher-auto-ip)"; description "List of RTs. The number of RTs in the group ranges from 1 to 8."; list vpn-target { key "value type"; description "Configure RT (VPN Target) s to control route advertisement between network nodes. Before sending a VPN route to a PE, the local PE adds an Export RT to the route. After receiving a route from another PE, the local PE determines whether the route will be added to the VPN instance based on the local Import RT and the Export RT that is added to the VPN route."; leaf value { type string { length "3..21"; } description "The formats of a VPN target value are as follows: (1) 16-bit AS number : 32-bit user-defined number, for example, 1:3. An AS number ranges from 0 to 65535, and a user-defined number ranges from 0 to 4294967295. The AS number and user-defined number cannot be both 0s. This means that the VPN Target value cannot be 0:0. (2) 32-bit IP address: 16-bit user-defined number, for example: 192.168.122.15:1.The IP address ranges from 0.0.0.0 to 255.255.255.255, and the user-defined number ranges from 0 to 65535. (3) 32-bit AS number :16-bit user-defined number, for example, 10.11:3. An AS number ranges from 0.0 to 65535.65535 or 0 to 4294967295, and a user-defined number ranges from 0 to 65535. The AS number and user-defined number cannot be both 0s. This means that the VPN Target value cannot be 0.0:0."; } leaf type { type vpn-target-type; description "RT types are as follows: export-extcommunity: Specifies the value of the extended community attribute of the route from an outbound interface to the destination VPN. import-extcommunity: Receives routes that carry the specified extended community attribute value."; } } // list vpn-target } // container vpn-targets container state { config false; description "Statistics of address families of the VPN instance."; leaf create-time { type yang:date-and-time; description "The createtime of address families of the VPN instance."; } leaf up-time { type pub-type:time-tick; description "The uptime of address families of the VPN instance."; } leaf label { type uint32; description "The label of address families of the VPN instance."; } leaf status { type vpn-status-type; description "VPN instance status. A VPN instance is up when there is at least one interface associated with the VRF whose ifOperStatus is up. A VRF is down when: a. There does not exist at least one interface whose ifOperStatus is up. b. There are no interfaces associated with the VRF."; } } // container state container tunnel-infos { config false; description "List of tunnel informations."; list tunnel-info { key "type peer-ip id iid"; description "Statistics of tunnel informations."; leaf type { type tnlm:tunnel-type; description "Tunnel's type."; } leaf peer-ip { type inet:ip-address-no-zone; description "Next Hop address through which the packet has to be sent."; } leaf id { type uint32 { range "0..4294967295"; } description "Tunnel's ID."; } leaf iid { type uint32 { range "0..4294967295"; } description "Indirect ID."; } leaf color { type uint32 { range "0..4294967295"; } description "Color information for tunnel."; } leaf name { type string { length "0..256"; } description "Tunnel's name."; } } // list tunnel-info } // container tunnel-infos } // list af } // container afs } } // module huawei-l3vpn
© 2023 YumaWorks, Inc. All rights reserved.