Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Configuring the DHCP Server and TFTP Server for Compute Nodes

    Note: As of Junos OS Release 12.3, JunosV App Engine deployed applications will install only if the Junos OS release and the release of the backing sandbox used to package the application match. For example, an application built with Release 12.3R2 will only install on Junos OS Release 12.3R2 and will not install on Junos OS Release 12.3R1 or Junos OS Release 12.3R3 or Junos OS Release 13.1R1.

    A compute node is the VSE device that runs the host operating system (OS) in the virtual plane—it connects the router or other device running Junos to the hardware device.

    The VSE device does not have its own operating system. The only way to boot the compute node is through the network interface. The network interface, configured as a boot device, uses a protocol called Preboot eXecution Environment (PXE) to boot the compute node.

    To boot the VSE device, you need to do the following:

    • Install the JunosV App Engine Host Base OS package (jvae package).
    • Configure the compute-cluster statement.
    • Configure the TFTP server.
    • Configure the DHCP server.

    The Host Base OS package has the boot file and boot server as well as the entire Linux CentOS system. When the Host Base OS package is installed and the DHCP server is configured, the DHCP server sends the IP address of the interface, the boot filename, and the boot server to the VSE device. The VSE device can then boot and download the host operating system (CentOS) and the compute cluster configuration.

    This topic details how to configure the TFTP server and the DHCP server. Installing the Host Base OS package and configuring the compute-cluster statement are covered in other steps in the Deploying an Application tutorial.

    TFTP Server Configuration

    The TFTP server is run on the Junos router, where the boot images are stored.

    To enable the TFTP server on Junos:

    • Use the following set command:
      user@router# set system services tftp-server

    DHCP License

    Depending on the router, the VSE is connected to, here are the additional SKUs you will need to buy. Once you purchase the SKU you will need to load the license on Juniper router.

    For Juniper Networks M Series and MX Series routers a license is required for DHCP. See Table 1.

    Table 1: DHCP Licenses for Juniper Routers

    Router Series

    Platforms

    DHCP SKU Needed *

    MX Series

    MX-80 MX-5, MX-10, MX-40

    S-MX80-SA-FP S-MX80-SSM-FP

    MX-240, 480, 960, …

    S-SA-FP

    M-Series

    M7i, M10i, M320, M120

    S-SA-FP

    T-Series

    T640, T320

    No License required.

    * Also would need a scale license (if number of clients > 1000)

    To add the license key:

    1. Type the following CLI operational command at the prompt:
      user@host> request system license add terminal key
    2. Paste the license key for key. Then press Ctril+d.

    General DHCP Configuration

    You can configure and use any DHCP server in the network. But you must configure the DHCP server as a PXE server to respond to the PXE clients.

    Note: If the compute node receives multiple DHCP responses (which is possible if there are multiple DHCP servers configured in the network), it is up to the compute node to choose any DHCP response. In the case that the compute node chooses a DHCP response that is not the one the administrator has configured for PXE boot to work, the compute node will not boot with the host OS.

    Because any router can be used as the DHCP server, the procedure to configure the DHCP server to send the appropriate DHCP reply to the network interface is specific to each deployment.

    Whichever device you use as the DHCP server, you need to do the following:

    1. Add the following two fields in the DHCP response:
      • tftp boot server—This is the tftp boot server field. Set it to the IP address of the network interface connected to the network boot interface of the compute node.
        • In the case of a Linux DHCP server, this field’s name is next-server in /etc/dhcpd.conf.
        • In the case of a Junos DHCP server, this field’s name is tftp-server at the [access address-assignment pool poolname family inet dhcp-attributes] hierarchy level.
      • boot filename—This is the filename of the boot file on the tftp boot server. Set boot filename to pxelinux.0.
        • In the case of a Linux DHCP server, this field’s name is filename in /etc/dhcpd.conf.
        • In the case of a Junos DHCP server, this field’s name is boot-file at the [access address-assignment pool poolname family inet dhcp-attributes] hierarchy level.
    2. Configure the forwarding-options configuration statement on the router to which DHCP server is connected.

      Note: The forwarding-options configuration in this step is required if and only if the compute node management network and DHCP network (assuming that DHCP is not running on Junos OS) are different. It is only in this case that the router needs to forward DHCP traffic (which are broadcast in nature) to another network where the DHCP server is running. For example, your VSE device may be in a different network than your DHCP server. If the DHCP server is in the same network as the compute node, then this configuration is not required.

      [edit]
      user@host# show interfaces
      ge-4/2/0 {
          unit 0 {
              family inet {
                  address 192.168.1.3/24;
              }
          }
      }
       
      [edit]
      user@host# show forwarding-options
      dhcp-relay {
          server-group {
              bng-vee;
          }
          active-server-group bng-vee;
          group all {
              interface ge-4/2/0.0;
          }
      }
      

    Following are a few example configurations.

    Configuring DHCP on Junos

    To configure a Junos router as a DHCP server:

    1. Configure the dhcp-local-server group statements at the [edit system services] hierarchy level.
      [edit]user@router# set system services dhcp-local-server group group-name interface interface-name

      For example:

      user@router# set system services dhcp-local-server group dhcp-group1 interface ge-4/2/0.0
    2. Configure the DHCP attributes. For example, use these set commands:
      set access address-assignment pool dhcp-pool family inet network 192.168.1.0/24
      set access address-assignment pool dhcp-pool family inet dhcp-attributes boot-file pxelinux.0
      set access address-assignment pool dhcp-pool family inet dhcp-attributes boot-server 192.168.1.20
      set access address-assignment pool dhcp-pool family inet dhcp-attributes tftp-server 192.168.1.20
      
    3. Configure the host interface MAC address and IP address. For example:
      set access address-assignment pool dhcp-pool family inet host sdk-proto-bm2 hardware-address 00:e0:81:ca:5a:76
      # Mac address of interface on VSE tethered to router.
      set access address-assignment pool dhcp-pool family inet host sdk-proto-bm2 ip-address 192.168.1.251
    4. Commit, and verify your configuration with the show command.
      [edit]
      user@router# show interfaces
      ge-4/2/0 {
          unit 0 {
              family inet {
                  address 192.168.1.20/24;
              }
          }
      }
       
      [edit]
      user@router# show system services
      tftp-server;
      dhcp-local-server 
          group dhcp-group1 {
              interface ge-4/2/0.0;
          }
      }
      [edit]
      user@router# show access 
      address-assignment {
          pool dhcp-pool {
              family inet {
                  network 192.168.1.0/24;
                  dhcp-attributes {
                      router {
                          192.168.1.20;
                      }
                      boot-file pxelinux.0;
                      boot-server 192.168.1.20;
                      tftp-server 192.168.1.20;
                  }
                  host sdk-proto-bm2 {
                      hardware-address 00:e0:81:ca:5a:76;
                      ip-address 192.168.1.251;
                  }
              }
          }
      }
      

    Configuring forwarding-options for DHCP:

    This example uses an external Linux machine as the DHCP server.

    To configure forwarding-options on a Junos router for DHCP:

    1. Configure the following settings:
      • Configure the router’s interfaces:
        [edit]set interfaces ge-0/1/3 unit 0 family inet address 10.5.5.254/24;set interfaces ge-0/1/6 unit 0 family inet address 10.1.1.254/24;
      • Configure the forwarding-options dhcp-relay statements:
        [edit]set forwarding-options dhcp-relay server-group vee 10.5.5.10 set forwarding-options dhcp-relay active-server-group vee set forwarding-options dhcp-relay group all interface ge-0/1/6.0
      • Configure the compute cluster and compute node.
        [edit]set services app-engine compute-cluster dhcp-cluster local-management family inet address 10.1.1.254 set services app-engine compute-cluster dhcp-cluster compute-node dhcp-node mac-address 00:e0:81:ca:5a:74 set services app-engine compute-cluster dhcp-cluster compute-node dhcp-node interfaces bridge mgmt management set services app-engine compute-cluster dhcp-cluster compute-node dhcp-node interfaces bridge mgmt family inet address 10.1.1.50/24 set services app-engine compute-cluster dhcp-cluster compute-node dhcp-node interfaces bridge mgmt interface eth1
      • Configure TFTP server.
        [edit]set system services tftp-server
    2. Commit, and verify the settings.
      user@router# show interfaces
      ge-0/1/3 {
          unit 0 {
              family inet {
                  address 10.5.5.254/24;
              }
          }
      }
      ge-0/1/6 {
          unit 0 {
              family inet {
                  address 10.1.1.254/24;
              }
          }
      }
      
      [edit]
      user@router# show forwarding-options dhcp-relay
      server-group {
          vee {
              10.5.5.10;
          }
      }
      active-server-group vee;
      group all {
          interface ge-0/1/6.0;
      }
      
      [edit]
      user@router# show services
      app-engine {
          compute-cluster dhcp-cluster {
              local-management {
                  family inet {
                      address 10.1.1.254;
                  }
              }
              compute-node dhcp-node {
                  mac-address 00:e0:81:ca:5a:74;
                  interfaces {
                      bridge mgmt {
                          management;
                          family inet {
                              address 10.1.1.50/24;
                          }
                          interface eth1;
                      }
                  }
              }
          }
      }
      
      [edit]
      user@router# show system
      services {
          tftp-server;
          
      }
      
      

    Configuring DHCP on Linux

    To install and configure DHCP on a Linux machine:

    Make sure yum updatedd is running on the Linux machine.

    1. Run the yum install dhcpd command on the Linux machine. The dhcp package is installed.
    2. Update the dhcp.conf file. See the following sample file:
      [root@host ~]# cat /etc/dhcpd.conf
      #
      # Sample DHCP Server Configuration file.
      #
      ddns-update-style ad-hoc;
      subnet 10.1.1.0 netmask 255.255.255.0 {
        group {
          option subnet-mask 255.255.255.0;
          host node {
             hardware ethernet 00:e0:81:ca:5a:74;
             fixed-address 10.1.1.50;
             next-server 10.1.1.254;
             filename "pxelinux.0";
          }
        }
      }
      
      subnet 10.5.5.0 netmask 255.255.255.0
      
    3. Issue the service dhcpd restart command so that the machine restarts with the new configuration.

    The following configuration is a different example DHCP server configuration in Linux:

    subnet 192.168.1.0 netmask 255.255.255.0 {group {option subnet-mask 255.255.255.0;host cn2 {hardware ethernet 00:E0:81:CA:5A:77;fixed-address 192.168.1.20;next-server 192.168.1.3;filename "pxelinux.0";}}

    This list gives a description of the configured parameters:

    subnet 192.168.1.0 netmask 255.255.255.0

    This is the subnet to which the compute node’s network boot interface is connected.

    hardware ethernet 00:E0:81:CA:5A:77

    This is the MAC address of the network boot interface. This should be same as the mac-address option we configure for compute node on the router.

    fixed-address 192.168.1.20

    This is the IP address to be given in the DHCP response.

    next-server 192.168.1.3

    This is the boot server IP address. Should be set to the IP address or the router connected to the network boot interface of compute node.

    filename "pxelinux.0"

    This is the boot filename.

    Published: 2014-03-31