< Home

port-security mac-address

Function

The port-security mac-address command configures a static secure MAC address.

The undo port-security mac-address command deletes a static secure MAC address.

By default, a static secure MAC address is not configured.

Format

port-security mac-address mac-address vlan vlan-id

undo port-security mac-address mac-address vlan vlan-id

Parameters

Parameter

Description

Value

mac-address

Specifies a static secure MAC address.

The value is in H-H-H format. An H contains 1 to 4 hexadecimal digits. The MAC address cannot be The MAC address cannot be FFFF-FFFF-FFFF, 0000-0000-0000, or a multicast MAC address.

vlan vlan-id

Specifies the ID of a VLAN.

The value is an integer that ranges from 1 to 4094.

Views

Ethernet interface view, GE interface view, XGE interface view, 25GE interface view, MultiGE interface view, 40GE interface view, 100GE interface view, Eth-Trunk interface view

Default Level

2: Configuration level

Usage Guidelines

Usage Scenario

After the port-security enable command is used to configure port security, the learned MAC address becomes a dynamic secure MAC address.

When the interface becomes Down or the device is reset, static secure MAC addresses are not affected, and dynamic secure MAC addresses need to be learned again. Static secure MAC addresses are not aged out. Static secure MAC addresses have higher priority than dynamic secure MAC addresses.

Prerequisites

Port security has been enabled by using the port-security enable command on the interface.

Precautions

Yu can run the port-security mac-address mac-address vlan vlan-id command multiple times to configure multiple static secure MAC addresses.

The static secure MAC cannot be the virtual MAC address of the Virtual Router Redundancy Protocol (VRRP).

Example

# Configure a static secure MAC address on GE0/0/1.

<HUAWEI> system-view
[HUAWEI] interface gigabitethernet 0/0/1
[HUAWEI-GigabitEthernet0/0/1] port-security enable
[HUAWEI-GigabitEthernet0/0/1] port-security mac-address 286E-D488-B6FF vlan 10
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >