Skip Navigation Links
Exit Print View
| Sun Ethernet Fabric Operating System ### DHCP Administration Guide

Search Scope:

- This Document
- Entire Library

## Configure an Interface to Acquire a Dynamic IP Address

In this example, switch 1 is the DHCP server, and switch 2 is the DHCP client. `vlan1` of switch 2 must be allocated with a dynamic IP. In addition, the address pool is `pool 1`, the network address is `12.0.0.0`, and the mask option is `255.255.0.0`.

1. Enable the DHCP server in switch 1.

       SEFOS# configure terminal
       SEFOS(config)# service dhcp-server

2. Create the address pool.

       SEFOS(config)# ip dhcp pool 1

3. Configure the network and mask.

       SEFOS(dhcp-config)# network 12.0.0.0 255.0.0.0
       SEFOS(dhcp-config)# end

4. View the configuration.

       SEFOS# show ip dhcp server pools
       Pool Id                             : 1
       -------------------------------------------
       Subnet                               : 12.0.0.0
       Subnet Mask                          : 255.0.0.0
       Lease time                          : 3600 secs
       Utilization threshold               : 75%
       Start Ip                            : 12.0.0.1
       End Ip                              : 12.255.255.255

       Subnet Options
       --------------
       Code        :    1, Value      : 255.255.0.0

5. View additional configuration details.

   Note that DHCP does not cross the subnet.

       SEFOS# show ip dhcp server information

       DHCP server status                  : Enable
       Send Ping Packets                   : Disable
       Debug level                         : None
       Server Address Reuse Timeout        : 5 secs
       Next Server Address                 : 0.0.0.0
       Boot file name                      : NULL

6. Instead of using port 1 as shown in the topologies presented in this guide, use port 41 of both switches as follows. The DHCP server must be enabled and there must be a pool available in the server for the client's subnet.
   1. Connect a cable between port 41 of switch 1 and 2.
   2. Activate interface 41.

          SEFOS# configure terminal
          SEFOS(config)# interface ex 0/41
          SEFOS(config-if)# no shutdown
          SEFOS(config-if)# exit

   3. Define a VLAN using port 41.

          SEFOS(config)# vlan 41
          SEFOS(config-vlan)# port ex 0/41
          SEFOS(config-vlan)# exit

   4. Assign IP `12.0.0.1` to `vlan 41`.

          SEFOS(config)# interface vlan 41
          SEFOS(config-if)# no shutdown
          SEFOS(config-if)# ip address 12.0.0.1 255.255.255.0
          SEFOS(config-if)# end
          SEFOS#

7. Execute the following commands in switch 2 to acquire a dynamic IP for `vlan1` (note that DHCP does not cross the subnet).
   1. Activate interface 41.

          SEFOS# configure terminal
          SEFOS(config)# interface ex 0/41
          SEFOS(config-if)# no shutdown
          SEFOS(config-if)# exit

   2. Create the same VLAN.

          SEFOS(config)# vlan 41
          SEFOS(config-vlan)# port ex 0/41
          SEFOS(config-vlan)# exit

   3. Change the IP allocation mode to dynamic.

          SEFOS(config)# interface vlan 41
          SEFOS(config-if)# no shutdown
          SEFOS(config-if)# ip address dhcp
          SEFOS(config-if)# end
          SEFOS#

   4. Wait for the protocol operation to complete (approximately 20 seconds).
   5. View the dynamic IP allocated to the client in switch 2.

          SEFOS# show ip interface

      The output in the switch 2 is:

          vlan41 is up, line protocol is up
          Internet Address is 12.0.0.2/8
          Broadcast Address  12.255.255.255
          IP address allocation method is dynamic
          IP address allocation protocol is dhcp

   6. View the DHCP server binding table to observe the allocated IP addresses in switch 1.

          SEFOS# show ip dhcp server binding

          Ip          Hw                Hw               Binding       Expire
          Address     Type            Address            State         Time
          ---------   -------    ---------------        ----------    ----------
          12.0.0.2    Ethernet    00:02:02:03:04:01      Assigned       Jan 7  11:22:37 2007

   7. View the DHCP packets statistics in switch 1.

          SEFOS# show ip dhcp server statistics

          Address pools : 1

          Message             Received
          -------             --------
          DHCPDISCOVER         1
          DHCPREQUEST          1
          DHCPDECLINE          0
          DHCPRELEASE          0
          DHCPINFORM           0

          Message              Sent
          -------              ----
          DHCPOFFER            1
          DHCPACK              1
          DHCPNAK              0

Copyright © 2010, 2012, Oracle and/or its affiliates. All rights reserved. Legal Notices |