Product Documentation

Using DHCP for Initial Access

Jul 15, 2013

For the initial configuration of a NetScaler Gateway appliance, Dynamic Host Configuration Protocol (DHCP) can eliminate dependency on the console by providing an IP address at which you can access the appliance to configure it remotely. You can also use DHCP after the initial configuration if, for example, you want to move an appliance to a different subnet.

To use DHCP, you must first specify the NetScaler Gateway vendor class identifier on a DHCP server. Optionally, you can also specify the pool of IP addresses from which your appliance can acquire an IP address. If a pool is not specified, the address is acquired from the general pool.

A new NetScaler Gateway appliance does not have a configuration file. When you connect a NetScaler Gateway appliance without a configuration file to the network, its DHCP client automatically polls the DHCP server for an IP address. If you have specified the vendor class identifier on the DHCP server, the server returns an address. You can also enable the DHCP client on a previously configured NetScaler Gateway appliance.

Prerequisites

To use DHCP, you must:
  1. Note the system ID (sysid) on the serial number sticker on the back panel of the appliance.
  2. Set up a DHCP server and configure it with the vendor class identifier.

To configure a Linux or UNIX DHCP server for NetScaler Gateway

  1. Specify "citrix-NS" as the vendor class identifier for the appliance by adding the following configuration to the server's dhcpd.conf file:
    subclass "citrix-1" "citrix-NS"{ 
    vendor-option-space auto; 
    option auto.key "citrix-NS";
    Note: The location of the dhcpd.conf file can be different in different versions and flavors of the Linux/UNIX-based operating system (for example, in FreeBSD 6.3 the file is present in the /etc/ folder). For the location, see the dhcpd man page of the DHCP server.
  2. If you do not want NetScaler Gateway to use IP addresses from the general pool, specify a pool of addresses for the appliance. For example, adding the following configuration to the dhcpd.conf file specifies a pool of IP addresses ranging from 10.102.33.246 to 10.102.33.249.
    pool { 
    allow members of "citrix-1"; 
    range 10.102.33.246 10.102.33.249; 
    option subnet-mask 255.255.255.0; 
    }
  3. Terminate the DHCP process and restart it to reflect the change to the configuration file. At the shell command prompt, type:

    killall dhcpd

    dhcpd&

Implementing an Initial NetScaler Gateway Configuration from a Remote Computer

When a new NetScaler Gateway (or any appliance that does not have a configuration file) starts, it automatically polls the DHCP server for an IP address and provides the DHCP server with its sysid. The DHCP server includes this sysid with the IP address that it assigns to the appliance in the server's dhcpd.leases file. To find the IP address currently assigned to your NetScaler Gateway, look in the dhcpd.leases file for the last entry with the sysid of your appliance in the uid or client-hostname field. Verify that the binding state in this entry is active. If the binding state is not active but free, the IP address is not yet associated with the appliance.

You can use this address to connect to NetScaler Gateway and remotely configure the initial settings. For example, you can change the IP address, subnet mask, and gateway settings that were fetched from the DHCP server. After completing the initial configuration, you can manually return the DHCP IP address to the server pool. Alternatively, restarting the appliance automatically releases the DHCP IP address back to the server pool. A restart also saves the NetScaler Gateway configuration file.

Example

The following code example shows an entry in a DHCP server’s dhcpd.leases file. This entry verifies the binding state of the appliance with a sysid of 45eae1a8157e89b9314f.

 
lease 10.102.33.248 { 
  starts 3 2009/08/19 00:40:37; 
  ends 3 2009/08/19 06:40:37; 
  cltt 3 2009/08/19 00:40:37; 
  binding state active; 
  next binding state free; 
  hardware ethernet 00:d0:68:11:f4:d6; 
  uid "45eae1a8157e89b9314f"; 
  client-hostname "45eae1a8157e89b9314f"; 

In the preceding example, the binding state is ACTIVE and the IP address assigned to the NetScaler is 10.102.33.248.

The following table describes DHCP-related command-line interface commands that you might want to use when configuring a new NetScaler Gateway.

Table 1. Command-line interface commands for using DHCP with a new NetScaler Gateway

Task

At the command prompt, type:

To verify the DHCP fetched details, such as IP address, subnet mask, and gateway on the appliance.

> sh dhcpParams

To release the DHCP IP address and return it to the IP address pool on the DHCP server when the appliance configuration is complete.

> release dhcpIP

Using DHCP When a Configuration File Is Present

If you need to move a NetScaler Gateway appliance to a different subnet, such as from a testing environment to a production environment, you can use DHCP to access a NetScaler Gateway that already has a configuration file. Before moving the appliance, enable its DHCP client and save the configuration. As a result, when the appliance restarts, it automatically polls the DHCP server for an IP address. If you did not enable the DHCP client and save the configuration before shutting down the appliance, you will need to connect to the appliance through the console and dynamically run the DHCP client on the appliance. The DHCP server will then provide an IP address, a gateway, and a subnet mask. You can use the IP address to access the appliance and configure the other settings remotely.

If the DHCP client is enabled in the configuration file, you should disable it and then save the configuration file. If the DHCP client is enabled, the appliance will poll the DHCP server again for an IP address when it restarts.

The following table lists the command-line interface commands associated with each task.

Table 2. Command-line interface commands for using DHCP with a previously configured NetScaler Gateway

Task

At the command prompt, type:

To dynamically run the DHCP client to fetch an IP address from the DHCP server

> set dhcpParams dhcpClient on

To configure the DHCP client to run when the appliance restarts

> set dhcpParams dhcpClient on

> save config

To prevent the DHCP client from running when the appliance restarts

> set dhcpParams dhcpClient off

> save config

Note: This is required only if the ON setting was saved.

The initial configuration of your appliance is complete.