---
title: RA Guard Configuration
slug: enterprise-v6p1/ra-guard-configuration
createdAt: 2025-12-05T07:57:08.007Z
---

#

RA Guard functionality is used on Layer 2 access devices to prevent Router Advertisement (RA) message spoofing attacks.

When a Layer 2 access device receives an RA message with a unicast or multicast MAC address, the RA Guard functionality processes the RA message as follows:

- If the port is not configured with a port role, the RA message is directly forwarded.
- If the port role is a router, the RA message is directly forwarded.
- If the port role is a user, the RA message is directly discarded.
- If the port role is hybrid, the port's RA Guard policy is matched.
- If the RA Guard policy has configured matching rules, the RA message must match all rules successfully to be forwarded. Otherwise, the message is discarded.
- If the RA Guard policy does not have matching rules configured, all RA messages are discarded.

# <font color="#1d50a2">Configuration Example</font>

<font color="#1d50a2">**Network requirements**</font>

To prevent Route Announcement Message (RA message) spoofing attack, you need to configure RA Guard policy rules on the Device.

Interface Ethernet 2 is connected to an unknown device, and the user wants the interface to match and filter RA messages according to RA Guard policy rules.

Interface Ethernet 1 is connected to a user who wants the RA messages received on this interface to be discarded directly.

Interface Ethernet 3 is connected to a Device and the user wants the interface to fully trust RA messages to be forwarded directly.

::Image[]{src="https://app.archbee.com/api/optimize/zl-MD6bX0o2Ab3p8w66u1/WhhOVTvgCA9Kw6DWvnFll-20251203-104032.png" size="50" width="265" height="275" position="center" showCaption="false"}

<font color="#1d50a2">**Procedure**</font>

1. Create a VLAN and add an interface

```text
sonic(config)# vlan 100
sonic(config)# port-group ethernet 1-3
sonic(config-port-group 1-3)# switchport access vlan 100
```

2. Configure the interface role

```text
sonic(config)# interface ethernet 1
sonic(config-if-1)# raguard role user 
sonic(config)# interface ethernet 2
sonic(config-if-1)# raguard role hybrid
sonic(config)# interface ethernet 3
sonic(config-if-1)# raguard role router 
```

3. Configure RA Guard policy

```text
sonic(config)# vlan 100
sonic(config-vlan-100)# raguard policy src-ip fe80::1a17:25ff:fe37:6722
```

##

