This module contains a collection of YANG definitions for managing DHCP relay.
Version: 2020-03-15
submodule huawei-dhcp-relay { yang-version 1; belongs-to huawei-dhcp { prefix dhcp; } import huawei-ifm { prefix ifm; } import ietf-inet-types { prefix inet; } import huawei-network-instance { prefix ni; } import huawei-l3vpn { prefix l3vpn; } 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 module contains a collection of YANG definitions for managing DHCP relay."; revision "2020-03-15" { description "Modify description."; reference "Huawei private."; } revision "2020-02-25" { description "Add the node of link-selection-address."; reference "Huawei private."; } revision "2019-12-25" { description "Initial revision."; reference "Huawei private."; } typedef dhcp-relay-reply-type { type enumeration { enum "broadcast-always" { value 1; description "Always broadcast the reply."; } } description "The type of relay reply."; } typedef dhcp-opt82-sub6-format { type enumeration { enum "self-define" { value 1; description "DHCP option82 self-define format."; } } description "The type of DHCP option82 suboption6 format."; } typedef dhcp-opt82-vendor-sub-option-format { type enumeration { enum "source-ip-address" { value 0; description "Source IP address."; } } description "The type of DHCP option82 vendor suboption format."; } grouping dhcp-relay-type { description "DHCP relay."; container global { description "Configure DHCP relay global attributes."; leaf user-detect-interval { type uint16 { range "0..60"; } units "min"; default "20"; description "DHCP relay ARP user-detect interval."; } leaf user-autosave-flag { type boolean; default "false"; description "Enable/disable a DHCP relay agent to store user entries."; } leaf user-store-interval { type uint32 { range "300..86400"; } units "s"; default "300"; description "DHCP relay unnumbered table write-delay."; } leaf distribute-flag { type boolean; default "false"; description "Enable/disable DHCP relay distribute flag."; } leaf opt82-inner-vlan-insert-flag { type boolean; default "false"; description "Enable/disable DHCP option82 inner-VLAN change flag."; } container option { description "Configure the information instance of DHCP packet option code."; leaf option-code { type uint8 { range "1..255"; } description "Option code."; } leaf sub-option { when "../option-code"; type uint8 { range "1..255"; } description "Sub-option code."; } } // container option container source-ip { description "Configure DHCP relay global source IP attributes."; leaf source-ip-address { type inet:ipv4-address-no-zone; description "Relay source address."; } leaf vpn-name { when "../source-ip-address"; type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; default "_public_"; description "VPN name."; } } // container source-ip container route-isolation-vpns { config false; description "List of statistics of route isolation VPN instances."; list route-isolation-vpn { key "source-address vpn-name"; description "Statistics of a route isolation VPN instance."; leaf source-address { type inet:ipv4-address-no-zone; description "Route isolation VPN instance source address."; } leaf vpn-name { type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; description "Route isolation VPN instance VRF name."; } leaf if-name { type leafref { path "/ifm:ifm/ifm:interfaces/ifm:interface/ifm:name"; } description "Route isolation VPN instance interface name."; } } // list route-isolation-vpn } // container route-isolation-vpns container relay-packet-statistics { config false; description "Statistics of DHCP relay."; leaf packets-receive-from-client { type uint32; description "Number of packets received from clients."; } leaf discover-packets-receive { type uint32; description "Number of discover packets received."; } leaf request-packets-receive { type uint32; description "Number of request packets received."; } leaf release-packets-receive { type uint32; description "Number of release packets received."; } leaf inform-packets-receive { type uint32; description "Number of inform packets received."; } leaf decline-packets-receive { type uint32; description "Number of decline packets received."; } leaf init-request-packets-receive { type uint32; description "Number of init request packets received."; } leaf select-request-packets-receive { type uint32; description "Number of select request packets received."; } leaf renew-request-packets-receive { type uint32; description "Number of renew request packets received."; } leaf rebind-request-packets-receive { type uint32; description "Number of rebind request packets received."; } leaf packets-sent-to-clients { type uint32; description "Number of packets sent to clients."; } leaf unicast-packets-sent-to-clients { type uint32; description "Number of unicast packets sent to clients."; } leaf broadcast-packets-sent-to-clients { type uint32; description "Number of broadcast packets sent to clients."; } leaf offer-packets-sent-to-clients { type uint32; description "Number of offer packets sent to clients."; } leaf ack-packets-sent-to-clients { type uint32; description "Number of ACK packets sent to clients."; } leaf nak-packets-sent-to-clients { type uint32; description "Number of NAK packets sent to clients."; } leaf packets-receive-from-servers { type uint32; description "Number of packets received from servers."; } leaf offer-packets-receive { type uint32; description "Number of offer packets received."; } leaf ack-packets-receive { type uint32; description "Number of ACK packets received."; } leaf nak-packets-receive { type uint32; description "Number of NAK packets received."; } leaf packets-sent-to-servers { type uint32; description "Number of packets sent to servers."; } leaf discover-packets-sent { type uint32; description "Number of discover packets sent."; } leaf request-packets-sent { type uint32; description "Number of request packets sent."; } leaf release-packets-sent { type uint32; description "Number of release packets sent."; } leaf inform-packets-sent { type uint32; description "Number of inform packets sent."; } leaf decline-packets-sent { type uint32; description "Number of decline packets sent."; } leaf init-request-packets-sent { type uint32; description "Number of init request packets sent."; } leaf select-request-packets-sent { type uint32; description "Number of select request packets sent."; } leaf renew-request-packets-sent { type uint32; description "Number of renew request packets sent."; } leaf rebind-request-packets-sent { type uint32; description "Number of rebind request packets sent."; } leaf bad-packets-receive { type uint32; description "Number of error packets received."; } leaf release-packets-sent-to-servers { type uint32; description "Number of release packets sent to servers."; } } // container relay-packet-statistics } // container global } // grouping dhcp-relay-type augment /ifm:ifm/ifm:interfaces/ifm:interface { description "Extend interface attribute."; container dhcp-relay-attribute { description "Configure DHCP relay attributes on an interface."; leaf enable { type boolean; default "false"; description "Enable/disable DHCP relay."; } leaf reply-packet-policy { type dhcp-relay-reply-type; description "Reply packets policy."; } container option82 { must "(subscriber-id-enable='true' and subscriber-id-mode='self-define' and subscriber-id-self-define-text) or (subscriber-id-enable='false')"; description "Configure DHCP relay option82 on an interface."; leaf link-selection-enable { type boolean; default "false"; description "Enable/disable to insert link selection information."; } leaf link-selection-address { type inet:ipv4-address-no-zone; description "Link selection sub-option IP address."; } leaf vendor-specific-enable { when "(../../../ifm:type='Vbdif') or (../../../ifm:type='Global-VE' and ../../../ifm:class='sub-interface') or (../../../ifm:type='Virtual-Ethernet' and ../../../ifm:class='sub-interface')"; type boolean; default "false"; description "Enable/disable to insert suboption9 of option82."; } leaf subscriber-id-enable { type boolean; default "false"; description "Enable/disable to insert subscriber ID."; } leaf subscriber-id-mode { when "../subscriber-id-enable='true'"; type dhcp-opt82-sub6-format; default "self-define"; description "Subscriber ID mode."; } leaf subscriber-id-self-define-text { when "../subscriber-id-enable='true' and ../subscriber-id-mode='self-define'"; type string { length "1..251"; pattern '([^\t]{1,})'; } description "Configure a DHCP option82 self-defined string for subscriber ID."; } } // container option82 container server-addresses { description "List of configuring server addresses on interfaces."; list server-address { must "(vendor='false' and vendor-class='-') or (vendor='true' and option-code=60)"; key "address vendor option-code vendor-class"; description "Configure a server address on an interface."; leaf address { type inet:ipv4-address-no-zone; description "Server address."; } leaf vendor { type boolean; description "Enable/disable to carry a vendor identifier."; } leaf option-code { type uint8 { range "0..254"; } description "Option code, 0 means NULL."; } leaf vendor-class { type string { length "1..128"; pattern '([^\t]{1,})'; } description "Vendor identifier."; } } // list server-address } // container server-addresses container gateway-addresses { description "List of configuring a gateway address list on an interface."; list gateway-address { must "(vendor='false' and vendor-class='-') or (vendor='true' and option-code=60)"; key "vendor option-code vendor-class"; description "Configure a gateway address instance on an interface."; leaf vendor { type boolean; description "Enable/disable to carry vendor identifier."; } leaf option-code { type uint8 { range "0..254"; } description "Option code, 0 means NULL."; } leaf vendor-class { type string { length "1..128"; pattern '([^\t]{1,})'; } description "Vendor identifier."; } leaf ip-address { type inet:ipv4-address-no-zone; mandatory true; description "Gateway address."; } } // list gateway-address } // container gateway-addresses container relay-source-address { must "not(../relay-source-option-addresses/relay-source-option-address)"; presence "Enable/disable the functions of DHCP relay source address."; description "Configure DHCP relay source address."; leaf vpn-name { type leafref { path "/ni:network-instance/ni:instances/ni:instance/ni:name"; } must "/ni:network-instance/ni:instances/ni:instance[ni:name=current()]/l3vpn:afs/l3vpn:af[l3vpn:type='ipv4-unicast']"; mandatory true; description "VPN name specified in the source address of a relay interface, the '_public_' of vpn-name means public network."; } leaf source-address { type inet:ipv4-address-no-zone; mandatory true; description "Source address."; } } // container relay-source-address container relay-source-option-addresses { description "List of configuring source IP addresses based on option."; list relay-source-option-address { must "not(../../relay-source-address)"; must "(vendor='false' and vendor-class='-') or (vendor='true' and option-code=60)"; key "vendor option-code vendor-class"; description "Configure a source IP address based on option."; leaf vendor { type boolean; description "Enable/disable to carry a vendor identifier."; } leaf option-code { type uint8 { range "0..254"; } description "Option code, 0 means NULL."; } leaf vendor-class { type string { length "1..128"; pattern '([^\t]{1,})'; } description "Vendor identifier."; } leaf source-address { type inet:ipv4-address-no-zone; mandatory true; description "Source address."; } } // list relay-source-option-address } // container relay-source-option-addresses container opt82-vendor-specifics { description "List of option82 vendor-specific instance."; list opt82-vendor-specific { must "(../../../ifm:type='Vbdif') or (../../../ifm:type='Global-VE' and ../../../ifm:class='sub-interface') or (../../../ifm:type='Virtual-Ethernet' and ../../../ifm:class='sub-interface')"; key "sub-option-number"; max-elements 1; description "Configure an option82 vendor-specific instance. Only one record can be configured."; leaf sub-option-number { type uint32 { range "1..255"; } description "Suboption of option82."; } leaf sub-option-format { type dhcp-opt82-vendor-sub-option-format; mandatory true; description "Suboption format."; } leaf ip-address { type inet:ipv4-address-no-zone; mandatory true; description "Source IPv4 address of forward package."; } } // list opt82-vendor-specific } // container opt82-vendor-specifics } // container dhcp-relay-attribute } } // submodule huawei-dhcp-relay
© 2023 YumaWorks, Inc. All rights reserved.