Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Example: Configuring IP Source Guard and Dynamic ARP Inspection on a Specified Bridge Domain to Protect the Devices Against Attacks

This example describes how to enable IP source guard and Dynamic ARP inspection (DAI) on a specified bridge domain to protect the device against spoofed IP/MAC addresses and ARP spoofing attacks. When you enable either IP source guard or DAI, the configuration automatically enables DHCP snooping for the same bridge domain.

Requirements

This example uses the following hardware and software components:

  • One MX Series router

  • Junos OS Release 14.1

  • A DHCP server to provide IP addresses to network devices on the device

Before you configure IP source guard to prevent IP/MAC spoofing or DAI to mitigate ARP spoofing attacks, be sure you have:

Overview and Topology

Ethernet LAN devices are vulnerable to attacks on security that involve spoofing (forging) of source MAC addresses or source IP addresses. These spoofed packets are sent from hosts connected to untrusted access interfaces on the device. IP source guard checks the IP source address and MAC source address in a packet sent from a host attached to an untrusted access interface on the device against entries stored in the DHCP snooping database. If IP source guard determines that the packet header contains an invalid source IP address or source MAC address, it ensures that the device does not forward the packet—that is, the packet is discarded.

Another type of security attack is ARP spoofing (also known as ARP poisoning or ARP cache poisoning). ARP spoofing is a way to initiate man-in-the-middle attacks. The attacker sends an ARP packet that spoofs the MAC address of another device on the bridge domain. Instead of the device sending traffic to the proper network device, it sends it to the device with the spoofed address that is impersonating the proper device. If the impersonating device is the attacker's machine, the attacker receives all the traffic from the device that should have gone to another device. The result is that traffic from the device is misdirected and cannot reach its proper destination.

Note:

When DAI is enabled, the device logs the number of invalid ARP packets that it receives on each interface, along with the sender’s IP and MAC addresses. You can use these log messages to discover ARP spoofing on the network.

This example shows how to configure these important port security features on a device that is connected to a DHCP server. The setup for this example includes the bridge domain employee-bdomain on the switching device. Figure 1 illustrates the topology for this example.

Note:

The trunk interface connecting to the DHCP server interface is a trusted port by default.

Topology

Figure 1: Switching Device Network Topology for Basic Port SecuritySwitching Device 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
Properties Settings

Device hardware

One MX Series router

Bridge domain name and ID

employee-bdomain, tag 20

Bridge domain subnets

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

Interfaces in employee-bdomain

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

Interface connecting to DHCP server

ge-0/0/8

In this example, the device 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 bridge-domain (employee-bdomain) has been configured to include the specified interfaces.

Configuration

Procedure

CLI Quick Configuration

To quickly configure IP source guard and DAI (and thereby, also automatically configure DHCP snooping to protect the device against IP spoofing and ARP attacks), copy the following commands and paste them into the device terminal window:

Step-by-Step Procedure

To configure IP source guard and DAI (and thereby, also automatically configure DHCP snooping) on the bridge domain:

  1. Configure IP source guard on the bridge domain:

  2. Enable DAI on the bridge domain:

Results

Check the results of the configuration:

Verification

Confirm that the configuration is working properly.

Verifying That DHCP Snooping Is Working Correctly on the Device

Purpose

Verify that DHCP snooping is working on the device.

Action

Send some DHCP requests from network devices (here they are DHCP clients) connected to the device.

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

Meaning

When the interface on which the DHCP server connects to the device has been set to trusted, the output (see the preceding sample) shows, for the assigned IP address, the device’s MAC address, the VLAN name, and the time, in seconds, remaining before the lease expires.

Verifying That IP Source Guard Is Working on the Bridge Domain

Purpose

Verify that IP source guard is enabled and working on the bridge domain.

Action

Send some DHCP requests from network devices (here they are DHCP clients) connected to the device. View the IP source guard information for the data bridge domain.

Meaning

The IP source guard database table contains the VLANS and bridge domains enabled for IP source guard.

Verifying That DAI Is Working Correctly on the Device

Purpose

Verify that DAI is working on the device.

Action

Send some ARP requests from network devices connected to the device.

Display the DAI information:

Meaning

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