DHCP Server

Configures, modifies, and retrieves DHCP server configuration. The URI to configure data for DHCP server is:

 /dhcp-server    

To create DHCP server configuration using PUT method:

dhcp-server/config/ipv4-config

To modify DHCP server configuration using PATCH method:

/dhcp-server/config/ipv4-config/dhcpv4-pool=mnop      

To delete DHCP server configuration in the system:

/data/dhcp-server   

Supported HTTP Operations

GET method

URL: https://<host>/restconf/data/dhcp-server
Request body: None
Response body:     {
   "icx-openconfig-dhcp-server:dhcp-server" : {
      "config" : {
         "ipv4-config" : {
            "enable" : false,
            "dhcpv4-pool" : [
               {
                  "lease-time" : {
                     "hour" : 2,
                     "minute" : 1,
                     "day" : 3
                  },
                  "dhcp-default-router" : [
                     "10.10.10.1"
                  ],
                  "subnet_network" : "10.10.10.0",
                  "prefix-length" : 24,
                  "name" : "abcd"
               },
               {
                  "excl-ip-address-range" : [
                     {
                        "end-ip" : "20.20.20.39",
                        "start-ip" : "20.20.20.30"
                     },
                     {
                        "end-ip" : "20.20.20.49",
                        "start-ip" : "20.20.20.40"
                     }
                  ],
                  "lease-time" : {
                     "hour" : 10,
                     "minute" : 20,
                     "day" : 3
                  },
                  "dhcp-default-router" : [
                     "20.20.20.11",
                     "20.20.20.12",
                     "20.20.20.13"
                  ],
                  "subnet_network" : "20.20.20.0",
                  "prefix-length" : 24,
                  "name" : "efgh",
                  "option" : {
                     "dhcp-option" : [
                        {
                           "option-num" : 6,
                           "ip-format" : "20.20.20.8"
                        },
                        {
                           "option-num" : 42,
                           "ip-format" : "20.20.20.100"
                        }
                     ]
                  },
                  "excl-ip-address" : [
                     "20.20.20.21",
                     "20.20.20.22",
                     "20.20.20.23",
                     "20.20.20.24",
                     "20.20.20.25"
                  ]
               }
            ]
         }
      },
      "state" : {
         "ipv6-state" : {},
         "ipv4-state" : {}
      }
   }
}

PUT method

URL: https://<host>/restconf/data/dhcp-server/config/ipv4-config
Request body:
 {
         "ipv4-config" : {
            "enable" : "false",
            "dhcpv4-pool" : [
               {
                  "name" : "qrst",
                  "subnet_network" : "50.50.50.0",
                  "prefix-length" : "24",
                  "excl-ip-address" : "50.50.50.21",
                  "excl-ip-address" : "50.50.50.22",
                  "excl-ip-address" : "50.50.50.23",
                  "excl-ip-address" : "50.50.50.24",
                  "excl-ip-address" : "50.50.50.25",
                  "excl-ip-address-range" : [
                     {
                        "start-ip" : "50.50.50.30",
                        "end-ip" : "50.50.50.39"
                     },
                     {
                        "start-ip" : "50.50.50.40",
                        "end-ip" : "50.50.50.49"
                     }
                  ],
                  "lease-time" : {
                     "day" : "3",
                     "hour" : "10",
                     "minute" : "50"
                  },
                  "dhcp-default-router" : "50.50.50.11",
                  "dhcp-default-router" : "50.50.50.12",
                  "dhcp-default-router" : "50.50.50.14",
                  "option" : {
                     "dhcp-option" : [
                        {
                           "option-num" : "6",
                           "ip-format" : "50.50.50.8"
                        },
                        {
                           "option-num" : "42",
                           "ip-format" : "50.50.50.100"
                        }
                     ]
                  }
               }
            ]
       }
}
Response body: None    

PATCH method

URL: https://<host>/restconf/data/dhcp-server/config/ipv4-config/dhcpv4-pool=mnop   
Request body:
{
            "dhcpv4-pool" : [
               {
                  "name" : "mnop",
                  "subnet_network" : "40.40.40.0",
                  "prefix-length" : "24",
                  "excl-ip-address" : "40.40.40.41",
                  "excl-ip-address" : "40.40.40.42",
                  "lease-time" : {
                     "day" : "4",
                     "hour" : "20",
                     "minute" : "50"
                  }
               }
            ]
}
Response body: None    

DELETE

URL: https://<host>/restconf/data/dhcp-server
Request body: None    
Response body: None