huawei-dhcp-server

This module contains a collection of YANG definitions for managing DHCP server.

  • Version: 2020-03-13

    huawei-dhcp-server@2020-03-13


    
      submodule huawei-dhcp-server {
    
        yang-version 1;
    
        belongs-to huawei-dhcp {
            prefix dhcp;
        }
    
        import huawei-network-instance {
          prefix ni;
        }
        import ietf-inet-types {
          prefix inet;
        }
        import huawei-l3vpn {
          prefix l3vpn;
        }
        import huawei-extension {
          prefix ext;
        }
        import huawei-pub-type {
          prefix pub-type;
        }
        import ietf-yang-types {
          prefix yang;
        }
    
        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 server.";
    
        revision "2020-03-13" {
          description "Modify description.";
          reference
            "Huawei private.";
    
        }
    
        revision "2020-03-03" {
          description "Initial revision.";
          reference
            "Huawei private.";
    
        }
    
    
        typedef network-bios-type {
          type enumeration {
            enum "b-node" {
              value 1;
              description "B-node.";
            }
            enum "h-node" {
              value 2;
              description "H-node.";
            }
            enum "m-node" {
              value 3;
              description "M-node.";
            }
            enum "p-node" {
              value 4;
              description "P-node.";
            }
          }
          description
            "The type of network BIOS.";
        }
    
        typedef reply-type {
          type enumeration {
            enum "broadcast-always" {
              value 1;
              description
                "Always broadcast the reply.";
            }
            enum "unicast-always" {
              value 2;
              description
                "Always unicast the reply.";
            }
          }
          description "DHCP reply type.";
        }
    
        typedef sip-mode {
          type enumeration {
            enum "ip-mode" {
              value 1;
              description "SIP server IP mode.";
            }
            enum "list-mode" {
              value 2;
              description
                "SIP server string mode.";
            }
          }
          description "The type of SIP mode.";
        }
    
        typedef address-status {
          type enumeration {
            enum "static-bind-used" {
              value 0;
              description
                "Static bind used status.";
            }
            enum "static-bind" {
              value 1;
              description "Static bind status.";
            }
            enum "used" {
              value 2;
              description "Used status.";
            }
            enum "expired" {
              value 3;
              description "Expired status.";
            }
            enum "conflict" {
              value 4;
              description "Conflict status.";
            }
            enum "disable" {
              value 5;
              description "Disable status.";
            }
            enum "idle" {
              value 6;
              description "Idle status.";
            }
            enum "error" {
              value 7;
              description "Error.";
            }
          }
          description
            "The type of address status.";
        }
    
        typedef server-file-authentication-mode {
          type enumeration {
            enum "check" {
              value 0;
              description "Check.";
            }
            enum "no-check" {
              value 1;
              description "No-check.";
            }
            enum "force-check" {
              value 2;
              description "Force-check.";
            }
          }
          description
            "The type of file authentication mode.";
        }
    
        grouping dhcp-server-type {
          description
            "Configure DHCP server attributes.";
          container common {
            description
              "Configure DHCP server common attributes.";
            leaf ping-packet-nub {
              type uint32 {
                range "0..10";
              }
              units "pps";
              default "2";
              description
                "Number of ping packets.";
            }
    
            leaf ping-packet-timeout {
              type uint32 {
                range "0..10000";
              }
              units "ms";
              default "500";
              description
                "Timeout interval of ping reply.";
            }
    
            leaf database-enable {
              type boolean;
              default "false";
              description
                "Enable/disable database.";
            }
    
            leaf database-recover {
              type boolean;
              default "false";
              description
                "Enable/disable database recover.";
            }
    
            leaf write-delay-interval {
              type uint32 {
                range "300..86400";
              }
              units "s";
              default "300";
              description
                "Write delay interval, in the range of 300 to 86400, in seconds.";
            }
    
            leaf option60-enable {
              type boolean;
              default "false";
              description
                "Enable/disable to allocate IP address by option60.";
            }
    
            leaf dest-ip-enable {
              type boolean;
              default "false";
              description
                "Enable/disable to use destination IP address of the request packet as server identifier option.";
            }
    
            leaf lease-items-path {
              type string {
                length "1..64";
              }
              config false;
              description "Lease items path.";
            }
    
            leaf conflict-items-path {
              type string {
                length "1..64";
              }
              config false;
              description "Conflict items path.";
            }
    
            leaf link-selection-enable {
              type boolean;
              default "false";
              description
                "Enable/disable DHCP server to assign IP addresses based on the link-selection value in option82.";
            }
    
            leaf server-id-override-enable {
              type boolean;
              default "false";
              description
                "Enable/disable DHCP server to encapsulate option54 into packet based on the server-id-override value in option82.";
            }
    
            leaf request-packet-all-interface-enable {
              type boolean;
              default "false";
              description
                "Enable/disable the function of DHCP server on all interfaces.";
            }
    
            leaf file-authentication-mode {
              type server-file-authentication-mode;
              default "check";
              description
                "Set file authentication mode.";
            }
          }  // container common
    
          container global-ip-pools {
            description
              "List of global ip pools.";
            list global-ip-pool {
              key "ip-pool-name";
              description
                "Configure a global ip pool.";
              leaf ip-pool-name {
                ext:case-sensitivity "upper2lower";
                type string {
                  length "1..128";
                }
                description "Pool name.";
              }
    
              leaf vpn-instance {
                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 instance.";
              }
    
              leaf locked-flag {
                type boolean;
                default "false";
                description
                  "Enable/disable to lock.";
              }
    
              leaf option-router-disable {
                type boolean;
                default "false";
                description
                  "Enable/disable reply router option.";
              }
    
              leaf client-option60-string {
                type string {
                  length "1..255";
                }
                description
                  "The value of client option60 in the pool.";
              }
    
              leaf warning-exhaust-enable {
                type boolean;
                default "false";
                description
                  "Enable/disable the warning-exhaust of the pool.";
              }
    
              leaf warning-threshold {
                type uint8 {
                  range "0..100";
                }
                default "80";
                description
                  "The warning threshold of the pool.";
              }
    
              leaf domain-name {
                type string {
                  length "1..63";
                }
                description
                  "Configure a DNS domain name assigned to a DHCP client.";
              }
    
              leaf network-bios-type {
                type network-bios-type;
                description "NetBIOS type.";
              }
    
              leaf reply-packet-policy {
                type reply-type;
                description
                  "Reply packets policy.";
              }
    
              leaf profile-name {
                type string {
                  length "1..128";
                }
                description
                  "Remote backup profile.";
              }
    
              leaf identifier-ip {
                type inet:ipv4-address-no-zone;
                description
                  "Server identify IP.";
              }
    
              container gateway {
                must
                  "../gateway or (not(../gateway) and not(../sections))";
                must
                  "(../gateway/ip-address and ../gateway/mask) or (not(../gateway/ip-address) and not(../gateway/mask))";
                description
                  "Configure the gateway information of the pool.";
                leaf ip-address {
                  type inet:ipv4-address-no-zone;
                  description
                    "The gateway address of the pool.";
                }
    
                leaf mask {
                  type inet:ipv4-address-no-zone;
                  description
                    "The gateway mask of the pool.";
                }
              }  // container gateway
    
              container conflict-recycle {
                description
                  "Configure the conflict address auto recycle.";
                leaf auto-recycle-enable {
                  type boolean;
                  default "true";
                  description
                    "Enable/disable auto recycle of the conflict address.";
                }
    
                leaf conflict-recycle-interval {
                  when
                    "../auto-recycle-enable='true'";
                  type uint16 {
                    range "30..1440";
                  }
                  units "min";
                  default "30";
                  description
                    "The interval of the conflict address auto recycle.";
                }
              }  // container conflict-recycle
    
              container lease-time {
                must
                  "(day=0 and hour=0 and minute=0) or
                    (not (../rebind-time/day)) or
                    (day>../rebind-time/day) or
                    (day=../rebind-time/day and hour>../rebind-time/hour) or
                    (day=../rebind-time/day and hour=../rebind-time/hour and minute>../rebind-time/minute)";
                description
                  "Configure lease time.";
                leaf day {
                  type uint16 {
                    range "0..999";
                  }
                  units "d";
                  default "3";
                  description
                    "The lease time day.";
                }
    
                leaf hour {
                  type uint16 {
                    range "0..23";
                  }
                  units "h";
                  default "0";
                  description
                    "The lease time hour.";
                }
    
                leaf minute {
                  type uint16 {
                    range "0..59";
                  }
                  units "min";
                  default "0";
                  description
                    "The lease time minute.";
                }
              }  // container lease-time
    
              container rebind-time {
                must
                  "(day=0 and hour=0 and minute=0) or
                    (../renew-time/day=0 and ../renew-time/hour=0 and ../renew-time/minute=0) or
                    (day>../renew-time/day) or
                    (day=../renew-time/day and hour>../renew-time/hour) or
                    (day=../renew-time/day and hour=../renew-time/hour and minute>../renew-time/minute)";
                must
                  "(../lease-time/day=0 and ../lease-time/hour=0 and ../lease-time/minute=0) or
                    (day<../lease-time/day) or
                    (day=../lease-time/day and hour<../lease-time/hour) or
                    (day=../lease-time/day and hour=../lease-time/hour and minute<../lease-time/minute)";
                description
                  "Configure the rebind time of the pool.";
                leaf day {
                  type uint16 {
                    range "0..999";
                  }
                  units "d";
                  default "0";
                  description
                    "The rebinding time day.";
                }
    
                leaf hour {
                  type uint8 {
                    range "0..23";
                  }
                  units "h";
                  default "0";
                  description
                    "The rebinding time hour.";
                }
    
                leaf minute {
                  type uint8 {
                    range "0..59";
                  }
                  units "min";
                  default "0";
                  description
                    "The rebinding time minute.";
                }
              }  // container rebind-time
    
              container renew-time {
                must
                  "(day=0 and hour=0 and minute=0) or
                    (../rebind-time/day=0 and ../rebind-time/hour=0 and ../rebind-time/minute=0) or
                    (day < ../rebind-time/day) or
                    (day = ../rebind-time/day and hour < ../rebind-time/hour) or
                    (day = ../rebind-time/day and hour = ../rebind-time/hour and minute < ../rebind-time/minute)";
                must
                  "(../lease-time/day=0 and ../lease-time/hour=0 and ../lease-time/minute=0) or
                    (day<../lease-time/day) or
                    (day=../lease-time/day and hour<../lease-time/hour) or
                    (day=../lease-time/day and hour=../lease-time/hour and minute<../lease-time/minute)";
                description
                  "Configure the renew time of the pool.";
                leaf day {
                  type uint16 {
                    range "0..999";
                  }
                  units "d";
                  default "0";
                  description
                    "The renew time day.";
                }
    
                leaf hour {
                  type uint8 {
                    range "0..23";
                  }
                  units "h";
                  default "0";
                  description
                    "The renew time hour.";
                }
    
                leaf minute {
                  type uint8 {
                    range "0..59";
                  }
                  units "min";
                  default "0";
                  description
                    "The renew time minute.";
                }
              }  // container renew-time
    
              container option125 {
                description
                  "Configure an option125 of the pool.";
                leaf enterprise-code {
                  when "../option-string";
                  type uint32 {
                    range "0..4294967295";
                  }
                  default "2011";
                  description
                    "The enterprise information option code.";
                }
    
                leaf option-string {
                  type string {
                    length "1..32";
                  }
                  description
                    "The enterprise information option value.";
                }
              }  // container option125
    
              container sip-server {
                description
                  "Configure the SIP server of the pool.";
                leaf sip-server-mode {
                  type sip-mode;
                  must
                    "((../sip-server-mode = 'ip-mode') and (../sip-server-ip1)) or
                      ((../sip-server-mode = 'list-mode') and (../sip-server-name1)) or
                      (not(../sip-server-mode))";
                  description
                    "The mode of SIP server.";
                }
    
                choice sip-server-format {
                  description
                    "The format of SIP server.";
                  case ip-format {
                    description
                      "The IP of SIP server.";
                    leaf sip-server-ip1 {
                      when
                        "../sip-server-mode='ip-mode'";
                      type inet:ipv4-address-no-zone;
                      mandatory true;
                      description
                        "The first IP of SIP server.";
                    }
    
                    leaf sip-server-ip2 {
                      when
                        "../sip-server-mode='ip-mode'";
                      type inet:ipv4-address-no-zone;
                      description
                        "The second IP of SIP server.";
                    }
                  }  // case ip-format
    
                  case string-format {
                    description
                      "The name of SIP server.";
                    leaf sip-server-name1 {
                      when
                        "../sip-server-mode='list-mode'";
                      type string {
                        length "1..63";
                      }
                      mandatory true;
                      description
                        "The first name of SIP server.";
                    }
    
                    leaf sip-server-name2 {
                      when
                        "../sip-server-mode='list-mode'";
                      type string {
                        length "1..63";
                      }
                      description
                        "The second name of SIP server.";
                    }
                  }  // case string-format
                }  // choice sip-server-format
              }  // container sip-server
    
              container sections {
                description
                  "List of the sections of the pool.";
                list section {
                  must
                    "(../../gateway and ../section) or (not(../section))";
                  key "section-index";
                  max-elements 256;
                  description
                    "Configure the section of the pool.";
                  leaf section-index {
                    type uint32 {
                      range "0..255";
                    }
                    description
                      "The section index.";
                  }
    
                  leaf start-ip {
                    type inet:ipv4-address-no-zone;
                    mandatory true;
                    description
                      "The start IP address of the section.";
                  }
    
                  leaf end-ip {
                    type inet:ipv4-address-no-zone;
                    mandatory true;
                    description
                      "The end IP address of the section.";
                  }
                }  // list section
              }  // container sections
    
              container dns-lists {
                description "List of DNS IPs.";
                list dns-list {
                  key "dns-ip";
                  max-elements 8;
                  description
                    "Configure a DNS IP instance.";
                  leaf dns-ip {
                    type inet:ipv4-address-no-zone;
                    description "DNS IP.";
                  }
                }  // list dns-list
              }  // container dns-lists
    
              container network-bios-ip-addresses {
                description
                  "List of NetBIOS IPs.";
                list network-bios-ip-address {
                  key "network-bios-ip";
                  max-elements 8;
                  description
                    "Configure a NetBIOS IP instance.";
                  leaf network-bios-ip {
                    type inet:ipv4-address-no-zone;
                    description
                      "NetBIOS IP address.";
                  }
                }  // list network-bios-ip-address
              }  // container network-bios-ip-addresses
    
              container excluded-ip-addresses {
                description
                  "List of excluded IP addresses.";
                list excluded-ip-address {
                  key "start-ip-address end-ip-address";
                  description
                    "Configure an excluded IP instance.";
                  leaf start-ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Excluded start IP address.";
                  }
    
                  leaf end-ip-address {
                    type inet:ipv4-address-no-zone;
                    description
                      "Excluded end IP address.";
                  }
                }  // list excluded-ip-address
              }  // container excluded-ip-addresses
    
              container static-binds {
                description
                  "List of static bind IPs.";
                list static-bind {
                  key "static-bind-ip";
                  unique "static-bind-mac";
                  max-elements 4096;
                  description
                    "Configure a static bind IP instance.";
                  leaf static-bind-ip {
                    type inet:ipv4-address-no-zone;
                    description
                      "Specify the IP address to be bound.";
                  }
    
                  leaf static-bind-mac {
                    type pub-type:mac-address {
                      length "0..255";
                    }
                    mandatory true;
                    description
                      "Specify the user MAC address.";
                  }
                }  // list static-bind
              }  // container static-binds
    
              container client-options {
                description
                  "List of the specified client options of the pool.";
                list client-option {
                  key "option-code cilent-string reply-code";
                  unique "cilent-string";
                  max-elements 16;
                  description
                    "Configure the specified client option of the pool.";
                  leaf option-code {
                    type uint8 {
                      range "60";
                    }
                    description
                      "The client option code.";
                  }
    
                  leaf cilent-string {
                    type string {
                      length "3..66";
                    }
                    description
                      "The client option value, the field must begin and end with double quotation marks.";
                  }
    
                  leaf reply-code {
                    type uint8 {
                      range
                        "2 | 4..5 | 7..14 | 16..43 | 45 | 47..49 | 56 | 60 | 62..81 | 83..118 | 120..254";
                    }
                    description
                      "The specified reply option code.";
                  }
    
                  container client-sub-options {
                    description
                      "List of specified reply suboptions.";
                    list client-sub-option {
                      key "sub-option-code";
                      min-elements 1;
                      max-elements 16;
                      description
                        "Configure the specified reply suboption.";
                      leaf sub-option-code {
                        type uint32 {
                          range "1..254";
                        }
                        description
                          "The specified reply suboption code.";
                      }
    
                      choice option-format {
                        mandatory true;
                        description
                          "The format of server suboption.";
                        case sub-ip-format {
                          description
                            "IP format.";
                          leaf sub-option-ip {
                            type inet:ipv4-address-no-zone;
                            description
                              "Suboption IP.";
                          }
                        }  // case sub-ip-format
    
                        case sub-ascii-format {
                          description
                            "ASCII string format.";
                          leaf ascii-string {
                            type string {
                              length "1..128";
                            }
                            description
                              "ASCII string.";
                          }
                        }  // case sub-ascii-format
    
                        case sub-hex-format {
                          description
                            "Hex string format.";
                          leaf hex-string {
                            type string {
                              length
                                "2 | 4 | 6 | 8 | 10 | 12 | 14 | 16 | 18 | 20 | 22 | 24 | 26 | 28 | 30 | 32 | 34 | 36 | 38 | 40 | 42 | 44 | 46 | 48 | 50 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 74 | 76 | 78 | 80 | 82 | 84 | 86 | 88 | 90 | 92 | 94 | 96 | 98 | 100 | 102 | 104 | 106 | 108 | 110 | 112 | 114 | 116 | 118 | 120 | 122 | 124 | 126 | 128";
                            }
                            description
                              "Hex string.";
                          }
                        }  // case sub-hex-format
                      }  // choice option-format
                    }  // list client-sub-option
                  }  // container client-sub-options
                }  // list client-option
              }  // container client-options
    
              container option121s {
                description
                  "List of the option121 attributes.";
                list option121 {
                  key "destination-ip mask gateway";
                  max-elements 8;
                  description
                    "Configure the option121 attributes.";
                  leaf destination-ip {
                    type inet:ipv4-address-no-zone;
                    description
                      "Destination IP address.";
                  }
    
                  leaf mask {
                    type uint32 {
                      range "0..32";
                    }
                    description "IP mask.";
                  }
    
                  leaf gateway {
                    type inet:ipv4-address-no-zone;
                    description
                      "Gateway address.";
                  }
                }  // list option121
              }  // container option121s
    
              container option33s {
                description
                  "List of the option33 attributes.";
                list option33 {
                  key "destination-ip gateway";
                  max-elements 8;
                  description
                    "Configure the option33 attributes.";
                  leaf destination-ip {
                    type inet:ipv4-address-no-zone;
                    description
                      "Destionnation IP address.";
                  }
    
                  leaf gateway {
                    type inet:ipv4-address-no-zone;
                    description
                      "Gateway IP address.";
                  }
                }  // list option33
              }  // container option33s
    
              container domain-lists {
                description
                  "List of the domain lists of the pool.";
                list domain-list {
                  key "domain-name";
                  max-elements 4;
                  description
                    "Configure the domain list of the pool.";
                  leaf domain-name {
                    type string {
                      length "1..32";
                    }
                    description "Domain name.";
                  }
                }  // list domain-list
              }  // container domain-lists
    
              container user-options {
                description
                  "List of configuring the user define options of the pool.";
                list user-option {
                  key "option-code";
                  max-elements 16;
                  description
                    "Configure a user define option of the pool.";
                  leaf option-code {
                    type uint32 {
                      range
                        "2 | 4..5 | 7..14 | 16..43 | 45 | 47..49 | 56 | 60 | 62..81 | 83..118 | 120..254";
                    }
                    description
                      "The user define option code.";
                  }
    
                  choice option-format {
                    mandatory true;
                    description
                      "The format of server option.";
                    case ip-format {
                      description "IP format.";
                      leaf option-ip1 {
                        type inet:ipv4-address-no-zone;
                        description
                          "The first IP of option.";
                      }
    
                      leaf option-ip2 {
                        type inet:ipv4-address-no-zone;
                        must "../option-ip1";
                        description
                          "The second IP of option.";
                      }
                    }  // case ip-format
    
                    case ascii-format {
                      description
                        "ASCII string format.";
                      leaf ascii-string {
                        type string {
                          length "1..255";
                        }
                        description
                          "The ASCII string of the option.";
                      }
                    }  // case ascii-format
    
                    case hex-format {
                      description
                        "Hex string format.";
                      leaf hex-string {
                        type string {
                          length "2..479";
                          pattern
                            '([0-9A-F]{2}( [0-9A-F]{2}){0,159})';
                        }
                        description
                          "Hex string.";
                      }
                    }  // case hex-format
    
                    case cipher-format {
                      description
                        "Cipher string format.";
                      leaf cipher-string {
                        type pub-type:password-extend {
                          length "1..432";
                        }
                        description
                          "The cipher string of the option.";
                      }
                    }  // case cipher-format
    
                    case sub-option-format {
                      description
                        "Suboptions format.";
                      container sub-user-options {
                        description
                          "List of the user define suboptions.";
                        list sub-user-option {
                          key "sub-option-code";
                          max-elements 16;
                          description
                            "Configure the user define suboption.";
                          leaf sub-option-code {
                            type uint32 {
                              range "1..254";
                            }
                            description
                              "The user define suboption code.";
                          }
    
                          choice option-format {
                            mandatory true;
                            description
                              "The format of server suboption.";
                            case sub-ip-format {
                              description
                                "IP format.";
                              leaf sub-option-ip {
                                type inet:ipv4-address-no-zone;
                                description
                                  "The IP address.";
                              }
                            }  // case sub-ip-format
    
                            case sub-ascii-format {
                              description
                                "ASCII string format.";
                              leaf ascii-string {
                                type string {
                                  length "1..64";
                                }
                                description
                                  "ASCII string.";
                              }
                            }  // case sub-ascii-format
                          }  // choice option-format
                        }  // list sub-user-option
                      }  // container sub-user-options
                    }  // case sub-option-format
                  }  // choice option-format
                }  // list user-option
              }  // container user-options
    
              container option-force-replys {
                description
                  "List of the force reply options of the pool.";
                list option-force-reply {
                  key "option-code";
                  max-elements 16;
                  description
                    "Configure the force reply option of the pool.";
                  leaf option-code {
                    type uint8 {
                      range "2..254";
                    }
                    description
                      "The force reply option code.";
                  }
                }  // list option-force-reply
              }  // container option-force-replys
    
              container ip-pool-usage {
                config false;
                description
                  "Statistics of the usage of the pool.";
                leaf pool-length {
                  type uint32;
                  description
                    "The length of the pool.";
                }
    
                leaf used-ip-count {
                  type uint32;
                  description
                    "The count of used IP address.";
                }
    
                leaf ratio {
                  type uint32;
                  description
                    "The ratio of the used IP address.";
                }
    
                leaf last-time {
                  type yang:date-and-time;
                  description
                    "The last time of allocating IP address.";
                }
              }  // container ip-pool-usage
    
              container ip-pool-max-usage {
                config false;
                description
                  "Statistics of the maximum use of IP pool in history.";
                leaf pool-length {
                  type uint32;
                  description
                    "The length of the pool.";
                }
    
                leaf used-ip-count {
                  type uint32;
                  description
                    "The count of used IP address.";
                }
    
                leaf last-time {
                  type yang:date-and-time;
                  description
                    "The last time of allocating IP address.";
                }
              }  // container ip-pool-max-usage
            }  // list global-ip-pool
          }  // container global-ip-pools
        }  // grouping dhcp-server-type
      }  // submodule huawei-dhcp-server
    

© 2023 YumaWorks, Inc. All rights reserved.