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

    Example: Configuring IPv6 Source Guard and Neighbor Discovery Inspection to Protect the Switch from IPv6 Address Spoofing

    Note: This example 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 Example: Configuring DHCP Snooping and DAI to Protect the Switch from ARP Spoofing Attacks. For ELS details, see Getting Started with Enhanced Layer 2 Software.

    This example describes how to enable IPv6 source guard and Neighbor Discovery inspection on a specified VLAN to protect the switch against IPv6 address spoofing attacks. When you enable either IPv6 source guard or Neighbor Discovery inspection, DHCPv6 snooping is automatically enabled on the same VLAN.

    Requirements

    This example uses the following hardware and software components:

    • One EX4300 switch
    • Junos OS Release 13.2X51-D20 or later for EX Series switches
    • A DHCPv6 server to provide IPv6 addresses to network devices on the switch

    Before you configure IPv6 source guard and Neighbor Discovery inspection to prevent IPv6 address spoofing attacks, be sure you have:

    Overview and Topology

    Ethernet LAN switches are vulnerable to attacks on security that involve spoofing (forging) of source MAC addresses or source IPv6 addresses. These spoofed packets are sent from hosts connected to untrusted access interfaces on the switch. For more information on IPv6 address spoofing attacks, see Understanding IPv6 Neighbor Discovery Inspection.

    IPv6 source guard and Neighbor Discovery inspection mitigate the risk of IPv6 spoofing attacks by using the DHCPv6 snooping table. Also known as the binding table, the DHCPv6 snooping table contains the valid bindings of IPv6 addresses to MAC addresses. When a packet is sent from a host attached to an untrusted access interface on the switch, IPv6 source guard verifies the source IPv6 address and MAC address of the packet against the DHCPv6 snooping table. If there is no match in the table, the switch does not forward the packet—that is, the packet is discarded. Neighbor Discovery inspection verifies neighbor discovery messages sent between IPv6 nodes on the same network link against the DHCPv6 snooping table, and also discards the packet if no match is found.

    This example shows how to configure these important port security features on a switch that is connected to a DHCPv6 server. The setup for this example includes the VLAN sales on the switch. Figure 1 illustrates the topology for this example.

    Note: The trunk interface connecting to the DHCPv6 server interface is a trusted port by default.

    Figure 1: Network Topology for Basic Port Security

    Network Topology for Basic Port Security

    The components of the topology for this example are shown in Table 1.

    Table 1: Components of the Port Security Topology

    PropertiesSettings

    Switch hardware

    One EX4300 switch

    VLAN name and ID

    sales, tag 20

    VLAN subnets

    192.0.2.16/28
    192.0.2.17 through 192.0.2.30
    192.0.2.31 is the subnet's broadcast address

    Interfaces in sales

    ge-0/0/1, ge-0/0/2, ge-0/0/3, ge-0/0/8

    Interface connecting to DHCPv6 server

    ge-0/0/8

    In this example, the switch has already been configured as follows:

    • All access ports are untrusted, which is the default setting.
    • The trunk port (ge-0/0/8) is trusted, which is the default setting.
    • The VLAN (sales) has been configured to include the specified interfaces.

    Configuration

    CLI Quick Configuration

    To quickly configure IPv6 source guard and Neighbor Discovery inspection (and thereby, also automatically configure DHCPv6 snooping), copy the following commands and paste them into the switch terminal window:

    [edit]
    set vlans sales forwarding-options dhcp-security ipv6-source-guard
    set vlans sales forwarding-options dhcp-security nd-inspection

    Step-by-Step Procedure

    Configure IPv6 source guard and Neighbor Discovery inspection (and thereby, also automatically configure DHCPv6 snooping) on the VLAN:

    1. Configure IPv6 source guard on the VLAN:
      [edit vlans sales forwarding-options dhcp-security]
      user@switch# set ipv6-source-guard
    2. Enable Neighbor Discovery inspection on the VLAN:
      [edit vlans sales forwarding-options dhcp-security]
      user@switch# set nd-inspection

    Results

    Check the results of the configuration:

    user@switch> show vlans sales forwarding-options
    dhcp-security {nd-inspection;ipv6-source-guard;}}

    Verification

    Confirm that the configuration is working properly.

    Verifying That DHCPv6 Snooping Is Working Correctly on the Switch

    Purpose

    Verify that DHCPv6 snooping is working on the switch.

    Action

    Send DHCPv6 requests from network devices (in this example, they are DHCPv6 clients) connected to the switch.

    Display the DHCPv6 snooping information when the port on which the DHCPv6 server connects to the switch is trusted. The following output results when requests are sent from the MAC addresses and the server has provided the IPv6 addresses and leases:

    IPv6 address             MAC address         Vlan     Expires State   Interface
    2001::10:10:0:1          00:10:94:00:55:0b   sales    86265   BOUND   ge-0/0/1.0 
    fe80::210:94ff:fe00:550b 00:10:94:00:55:0b   sales    86265   BOUND   ge-0/0/1.0 
    2000::10:10:0:2          00:10:94:00:00:34   sales    86265   BOUND   ge-0/0/2.0 
    fe80::210:94ff:fe00:0034 00:10:94:00:00:34   sales    86265   BOUND   ge-0/0/2.0 
    2000::10:10:0:3          00:10:94:00:00:55   sales    86265   BOUND   ge-0/0/3.0 
    fe80::210:94ff:fe00:0055 00:10:94:00:00:55   sales    86265   BOUND   ge-0/0/3.0 
    

    Meaning

    The output shows the assigned IPv6 addresses, the MAC address, the VLAN name, and the time, in seconds, remaining before the lease expires. Because IPv6 hosts usually have more than one IPv6 address assigned to each of their IPv6-enabled network interfaces, there are two entries added for each client: one with the link-local IPv6 address, which is used by the client for DHCP transactions, and another with the IPv6 address assigned by the server. The link-local address always has the prefix fe80::/10.

    Verifying That Neighbor Discovery Inspection Is Working Correctly on the Switch

    Purpose

    Verify that Neighbor Discovery inspection is working on the switch.

    Action

    Send Neighbor Discovery packets from network devices connected to the switch.

    Display the Neighbor Discovery information:

    ND inspection statistics:
    
    Interface ND Packets received ND inspection pass ND inspection failed ge-0/0/1.0 7 5 2 ge-0/0/2.0 10 10 0 ge-0/0/3.0 12 12 0

    Meaning

    The sample output shows the number of Neighbor Discovery packets received and inspected per interface, with a list of how many packets passed and how many failed the inspection on each interface. The switch compares the Neighbor Discovery requests and replies against the entries in the DHCPv6 snooping database. If a MAC address or IPv6 address in the Neighbor Discovery packet does not match a valid entry in the database, the packet is dropped.

    Published: 2014-04-22