Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Security Services Administration Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configuring Static DHCP IP Addresses

date_range 24-Nov-23

Configuring Static DHCP IP Addresses for DHCP snooping (ELS)

Note:

This task uses Junos OS for EX Series switches with support for the Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that does not support ELS, see Configuring Static DHCP IP Addresses for DHCP snooping (non-ELS). For ELS details, see Using the Enhanced Layer 2 Software CLI.

You can add static (fixed) IP addresses and bind them to fixed MAC addresses in the DHCP snooping database. These bindings are labeled static in the database, while those bindings that have been added through the process of DHCP snooping are labeled dynamic. Static IPv6 address assignment is also available for DHCPv6. This feature is supported on aggregated Ethernet interfaces.

Before you can perform this procedure, you must configure the VLAN. See Configuring VLANs for EX Series Switches with ELS Support (CLI Procedure).

To configure a static IP address to MAC address (IP-MAC) binding in the DHCP snooping database, you must first create a group of access interfaces under the [edit vlans vlan-name forwarding-options dhcp-security] hierarchy. Creating this group automatically enables DHCP snooping, which is a prerequisite for creating the DHCP snooping database. On switches that support DHCPv6, creating the group of interfaces will automatically enable both DHCP and DHCPv6 snooping. Then you can configure a specific interface within the group to have one or more static IP-MAC address bindings.

To configure a static IP-MAC address binding in the DHCP snooping database:

  • content_copy zoom_out_map
    [edit vlans vlan-name forwarding-options dhcp-security]
    user@switch# set group group-name interface interface-name static-ip ip-address mac mac-address 

To configure a static IPv6-MAC address binding in the DHCPv6 snooping database:

  • content_copy zoom_out_map
    [edit vlans vlan-name forwarding-options dhcp-security]
    user@switch# set group group-name interface interface-name static-ipv6 ip-address mac mac-address 

In the following example, a device with static IP allocation is connected to the ge-0/0/1 interface, which belongs to vlan-A. To configure this device to connect to the external network:

content_copy zoom_out_map
[edit]
user@switch# set vlans vlan-A forwarding-options dhcp-security group static-group interface ge-0/0/1 static-ip 10.1.1.6 mac 00:00:00:44:44:06 

To verify that the configuration is configured on the device:

content_copy zoom_out_map
user@switch> show configuration vlans vlan-A                    
vlan-id 100;
forwarding-options {
    dhcp-security {
        ip-source-guard;
        group static-group {
            interface ge-0/0/1 {
                static-ip 10.1.1.6 mac 00:00:00:44:44:06
            }
        }
    }
}

To verify that a binding entry is created for the static client:

content_copy zoom_out_map
user@switch> show dhcp-security binding
    IP address        MAC address         Vlan     Expires State   Interface
    10.1.1.6          00:00:00:44:44:06   vlan-A   0       STATIC  ge-0/0/1

Configuring Static DHCP IP Addresses for DHCP snooping (non-ELS)

You can add static (fixed) IP addresses and bind them to fixed MAC addresses in the DHCP snooping database. These bindings are labeled static in the database, while those bindings that have been added through the process of DHCP snooping are labeled dynamic.

Note:

This task uses Junos OS for EX Series switches that do not support Enhanced Layer 2 Software (ELS) configuration style. If your switch runs software that does support ELS, see Configuring Static DHCP IP Addresses for DHCP snooping (ELS). For ELS details, see Using the Enhanced Layer 2 Software CLI.

To configure a static IP-MAC address binding in the DHCP snooping database:

content_copy zoom_out_map
[edit ethernet-switching-options secure-access-port]
user@switch# set interface interface-name  static-ip ip-address  vlan data-vlan mac mac-address 

To configure a static IP-MAC address binding in the DHCPv6 snooping database:

content_copy zoom_out_map
[edit ethernet-switching-options secure-access-port]
user@switch# set interface interface-name static-ipv6 ip-address vlan data-vlan mac mac-address 

To view results of the configuration steps before committing the configuration, type the show command at the user prompt.

To commit these changes to the active configuration, type the commit command at the user prompt.

Configuring Static DHCP IP Addresses for DHCP snooping (MX routers)

You can add static (fixed) IP addresses and bind them to fixed MAC addresses in the DHCP snooping database. These bindings are labeled as static in the database, while those bindings that have been added through the process of DHCP snooping are labeled dynamic.

To configure a static IP address/MAC address binding in the DHCP snooping database, you must first create a group of access interfaces under [edit bridge-domains bridge-domain-name forwarding-options dhcp-security]. Creating this group automatically enables DHCP snooping, which is a prerequisite for creating the DHCP snooping database. The following procedure shows the configuration in two steps, but it can be done in one. You can then configure a specific interface within the group to have one or more static IP-MAC address bindings.

To configure a static IP address and MAC address binding in the DHCP snooping database:

  1. Create a group by including an access interface:
    content_copy zoom_out_map
    [edit bridge-domains bd-name forwarding-options dhcp-security]
    user@device# set group group-name interface interface-name
    
  2. Configure a static IP address:
    content_copy zoom_out_map
    [edit bridge-domains bd-name forwarding-options dhcp-security]
    user@device# set group group-name interface interface-name static-ip ip-address mac mac-address 
    
footer-navigation