06-mac address table management commands

16
Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches Table of Contents Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd i Table of Contents Chapter 1 MAC Address Table Management Commands ......................................................... 1-1 1.1 MAC Address Table Management Commands ................................................................. 1-1 1.1.1 display mac-address ............................................................................................... 1-1 1.1.2 display mac-address aging-time ............................................................................. 1-2 1.1.3 display mac-limit ...................................................................................................... 1-2 1.1.4 mac-address............................................................................................................ 1-2 1.1.5 mac-address max-mac-count.................................................................................. 1-2 1.1.6 mac-address max-mac-count enable...................................................................... 1-2 1.1.7 mac-address max-mac-count max-mac-num ......................................................... 1-2 1.1.8 mac-address timer .................................................................................................. 1-2 1.1.9 mac-limit .................................................................................................................. 1-2 1.1.10 reset mac-address ................................................................................................ 1-2 1.1.11 source-mac............................................................................................................ 1-2 Chapter 2 Static Multicast MAC Address Group Configuration Commands .......................... 2-2 2.1 Static Multicast MAC Address Group Configuration Commands ...................................... 2-2 2.1.1 display mac-address multicast static....................................................................... 2-2 2.1.2 mac-address multicast ............................................................................................ 2-2 2.1.3 reset mac-address multicast ................................................................................... 2-2

Upload: randy-dookheran

Post on 27-Dec-2015

369 views

Category:

Documents


4 download

DESCRIPTION

MAC Address Table Management Commands

TRANSCRIPT

Page 1: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches Table of Contents

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

i

Table of Contents

Chapter 1 MAC Address Table Management Commands......................................................... 1-1 1.1 MAC Address Table Management Commands ................................................................. 1-1

1.1.1 display mac-address ............................................................................................... 1-1 1.1.2 display mac-address aging-time ............................................................................. 1-2 1.1.3 display mac-limit...................................................................................................... 1-2 1.1.4 mac-address............................................................................................................ 1-2 1.1.5 mac-address max-mac-count.................................................................................. 1-2 1.1.6 mac-address max-mac-count enable...................................................................... 1-2 1.1.7 mac-address max-mac-count max-mac-num ......................................................... 1-2 1.1.8 mac-address timer .................................................................................................. 1-2 1.1.9 mac-limit .................................................................................................................. 1-2 1.1.10 reset mac-address ................................................................................................ 1-2 1.1.11 source-mac............................................................................................................ 1-2

Chapter 2 Static Multicast MAC Address Group Configuration Commands .......................... 2-2 2.1 Static Multicast MAC Address Group Configuration Commands ...................................... 2-2

2.1.1 display mac-address multicast static....................................................................... 2-2 2.1.2 mac-address multicast ............................................................................................ 2-2 2.1.3 reset mac-address multicast ................................................................................... 2-2

Page 2: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-1

Chapter 1 MAC Address Table Management Commands

Note:

For details of the commands mac-address static vsi and display mac-address vsi, refer to the MPLS-VPLS Commands in the MPLS VPN Volume.

1.1 MAC Address Table Management Commands

1.1.1 display mac-address

Syntax

display mac-address [ mac-addr [ vlan vlan-id ] | [ static | dynamic ] [ interface interface-type interface-number ] [ vlan vlan-id ] [ count ] ]

View

Any view

Parameters

mac-addr: Specifies a MAC address.

vlan-id: Specifies a VLAN ID.

static: Specifies static MAC address entries. Once being saved, the static entries can survive reboot and unless being removed manually, will never age out.

dynamic: Specifies dynamic MAC address entries. Dynamic entries will age out.

interface-type interface-number: Interface type and interface number.

count: Specifies to display the total number of MAC addresses in the MAC address table.

Description

Use the display mac-address command to display MAC address table entries.

When managing the Layer-2 addresses of the switch, you can perform this command to display Layer-2 address entries, whether they are dynamic or static, which ports they belong to, which VLANs they belong to, and whether they have been aged out.

Related commands: mac-address, mac-address timer.

Page 3: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-2 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Examples

# Display the entry for MAC address 00e0-fc01-0101.

<Quidway> display mac-address 00e0-fc01-0101

MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s)

00e0-fc01-0101 1 Learned Ethernet1/1/1 AGING

Table 1-1 Description on the fields of the display mac-address command

Field Description

MAC ADDR MAC address

VLAN ID The VLAN that the MAC address belongs to

STATE State of the MAC address, which can be Learned for dynamic, or Config static for static

PORT INDEX The forwarding port

AGING TIME(s) The aging time

1.1.2 display mac-address aging-time

Syntax

display mac-address aging-time

View

Any view

Parameters

None

Description

Use the display mac-address aging-time command to display the aging time of the dynamic entry in the MAC address table.

Related commands: mac-address, mac-address timer, display mac-address.

Examples

# Display the aging time of the dynamic entry in the MAC address table.

<Quidway> display mac-address aging-time

mac-address aging-time: 300s

The above information indicates that the aging time of the dynamic entry in the MAC address is 300 seconds.

Page 4: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-3

1.1.3 display mac-limit

Syntax

display mac-limit

View

Any view

Parameters

None

Description

Use the display mac-limit command to display the bindings between MAC addresses and aggregation groups.

Related commands: mac-limit.

Examples

# Display the bindings between MAC addresses and aggregation groups in the system.

<Quidway> display mac-limit

MAC Address Group-ID

0000-0000-0001 2

0000-0000-0001 1

0000-0000-0002 3

Total : 3 mac-limit entries

The above information indicates that MAC address 0000-0000-0001 is assigned to aggregation groups 1 and 2, and MAC address 0000-0000-0002 is assigned to aggregation group 3.

1.1.4 mac-address

Syntax

mac-address { static | dynamic } mac-addr interface interface-type interface-number vlan vlan-id

undo mac-address [ static | dynamic ] [ mac-addr [ interface interface-type interface-number vlan vlan-id | interface interface-type interface-number | vlan vlan-id ]

View

System view

Page 5: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-4 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Parameters

static: Static table entry, lost after resetting switch.

dynamic: Dynamic table entry, which will be aged.

mac-addr: MAC address.

interface-type interface-number: Interface type and interface number.

vlan-id: VLAN ID.

Description

Use the mac-address command to add/modify the MAC address table entry.

Use the undo mac-address command to cancel the MAC address table entry.

Note that:

If you entered an existing MAC address, you are actually editing the entry. If the MAC address is a dynamic one, you can change it to static. If it is a static one, you cannot change it.

In addition to deleting all the addresses on a port, you can choose to delete just the dynamic or static addresses.

If you do not save your configuration, both the static and dynamic entries will be lost after the device resets. If you save the configuration, only the dynamic entries will be lost.

Related commands: display mac-address.

Examples

# Configure a static MAC address entry for MAC address 00e0-fc01-0101, setting its corresponding port to Ethernet 2/1/1.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] mac-address static 00e0-fc01-0101 interface ethernet 2/1/1 vlan 2

1.1.5 mac-address max-mac-count

Syntax

mac-address max-mac-count count

undo mac-address max-mac-count

View

Ethernet port view

Page 6: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-5

Parameters

count: Maximum number of MAC addresses learned by a port, ranging from 0 to 14,336, the value of 0 means that address learning is disabled.

Description

Use the mac-address max-mac-count command to set the maximum number of MAC addresses learned by an Ethernet port.

Use the undo mac-address max-mac-count command to remove the limit on the maximum number of MAC addresses learned by an Ethernet port.

By default, a port can learn as many MAC addresses as a board can have. You can change the default value by using this command: if you set the value to count, and when the number of MAC addresses learned by the port reaches this value, this port will no longer learn any more MAC addresses; and you can use the undo mac-address max-mac-count command to remove the limit on the number.

Note:

The maximum number of MAC addresses of a board ranges from 12 K to 16 K depending on various software versions and board types.

The aforementioned number of MAC addresses includes only the MAC addresses learned by the switch dynamically, and excludes those configured by the user.

When executing the mac-address max-mac-count command, if the current number of MAC addresses exceeds the threshold value, the switch neither delete the present MAC address entries nor learn new MAC address until the number of entries less than the threshold value after some entries are aged out.

Related commands: mac-address, mac-address timer.

Examples

Set the maximum number of MAC addresses learned by Ethernet port Ethernet 3/1/3 to 600.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] interface Ethernet 3/1/3

[Quidway-Ethernet3/1/3] mac-address max-mac-count 600

1.1.6 mac-address max-mac-count enable

Syntax

mac-address max-mac-count enable { alarm | forward } *

Page 7: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-6 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

undo mac-address max-mac-count enable { alarm | forward } *

View

Ethernet port view

Parameters

None

Description

Use the mac-address max-mac-count enable { alarm | forward } * command to enable the switch to send alarms to the network administrator and forward the packets whose source MAC addresses are not learned by the port when the number of MAC addresses automatically learned by the port reaches the threshold value.

Use the undo mac-address max-mac-count enable { alarm | forward } * command to disable the function.

Use the mac-address max-mac-count enable forward command to enable the switch to forward the packets whose source MAC addresses are not learned by the port when the number of MAC addresses automatically learned by the port reaches the threshold value.

Use the undo mac-address max-mac-count enable forward command to enable the switch to drop the packets whose source MAC addresses are not learned by the port when the number of MAC addresses automatically learned by the port reaches the threshold value.

Use the mac-address max-mac-count enable alarm command to enable the switch to send alarms to the network administrator when the number of MAC addresses automatically learned by the port reaches the threshold value.

Use the undo mac-address max-mac-count enable alarm command to remove this configuration.

By default, the switch forwards the packets whose source MAC addresses are not learned by the port when the number of MAC addresses automatically learned by the port reaches the threshold value.

After the mac-address max-mac-count enable { alarm | forward } * command is executed, if the MAC addresses learned by a port reach the maximum number of MAC addresses that the port can learned, the port will send an alarm to network administrator to prompt that the port will no longer learn any MAC addresses.

Related commands: mac-address, mac-address timer.

Page 8: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-7

Note:

The maximum number of MAC addresses of a board ranges from 12 K to 16 K depending on various software versions and board types.

The aforementioned number of MAC addresses includes only the MAC addresses learned by the switch dynamically, and excludes those configured by the user.

When executing the mac-address max-mac-count command, if the current number of MAC addresses exceeds the threshold value, the switch neither delete the present MAC address entries nor learn new MAC address until the number of entries less than the threshold value after some entries are aged out.

Examples

# Set the maximum number of MAC addresses learned by Ethernet port Ethernet 3/1/3 to 600, and the switch will give an alarm to the network administrator and forward the packets when the number of MAC addresses learned exceeds 600.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] interface Ethernet 3/1/3

[Quidway-Ethernet3/1/3] mac-address max-mac-count 600

[Quidway-Ethernet3/1/3] mac-address max-mac-count enable forward alarm

# Set the maximum number of MAC addresses learned by Ethernet 3/1/3 to 600. When the number of MAC addresses exceeds this value, the switch drops the packets whose MAC addresses are not learned by the port.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] interface Ethernet 3/1/3

[Quidway-Ethernet3/1/3] mac-address max-mac-count 600

[Quidway-Ethernet3/1/3] undo mac-address max-mac-count enable forward

# Cancel the alarm function

[Quidway-Ethernet3/1/3] undo mac-address max-mac-count enable alarm

1.1.7 mac-address max-mac-count max-mac-num

Syntax

mac-address max-mac-count max-mac-num

undo mac-address max-mac-count

View

VLAN view

Page 9: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-8 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Parameters

max-mac-num: Maximum number of MAC addresses that can be learned in a VLAN. This argument ranges from 0 to 65535. Value of 0 disables MAC address learning.

Description

Use the mac-address max-mac-count command to set the maximum number of MAC addresses that can be learned in VLAN.

Use the undo mac-address max-mac-count command to cancel the configuration.

If you have set the maximum number, MAC addresses will not be learned in the VLAN when the maximum number is reached.

By default, the number of learned MAC addresses is not limited in a VLAN.

Note:

If you execute this command with the max-mac-num argument less than the current number of MAC addresses learned, the switch does not remove the existing MAC address entries, neither does it learns new MAC addresses. The switch resumes MAC address learning when the number of MAC addresses learned is less than the value specified by the max-mac-num argument.

Related commands: mac-address, mac-address timer.

Examples

# Set the maximum number of learned MAC addresses in a VLAN 100 to 600.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] vlan 100

[Quidway-vlan100] mac-address max-mac-count 600

1.1.8 mac-address timer

Syntax

mac-address timer { aging age | no-aging }

undo mac-address timer aging

View

System view

Page 10: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-9

Parameters

aging age: Specifies the aging time (measured in seconds) of the Layer-2 dynamic address table entry, ranging from 10 to 630. By default, the aging time is 300 seconds.

no-aging : No aging time.

Description

Use the mac-address timer command to configure the aging time of the Layer-2 dynamic address table entry.

Use the undo mac-address timer command to restore the default value.

If aging time is too short, the MAC address might be deleted before the switch gets the address information. That way the switch broadcasts the received packets to all the ports within the VLAN. This will affect the switch operation performance.

If aging time is too long, the switch will store a great number of out-of-date MAC address tables. This will consume MAC address table resources and the switch will not be able to update MAC address table according to the network change.

Caution:

The aging of dynamic MAC address is completed during the second aging cycle that has been configured.

Examples

# Configure the entry aging time of Layer 2 dynamic address table to be 500 seconds.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] mac-address timer aging 500

1.1.9 mac-limit

Syntax

mac-limit mac-address restrict to group groupid

undo mac-limit [ mac-address restrict to group groupid ]

View

System view

Page 11: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-10 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Parameters

mac-address: MAC address.

groupid: ID of the aggregation group to which the MAC address is assigned. The valid value range for this argument is 1 to 31. The aggregation group here cannot be a dynamic aggregation group.

Description

Use the mac-limit command to assign a MAC address to an aggregation group.

Use the undo mac-limit command to remove the binding between a MAC address and an aggregation group.

After a MAC address is assigned to an aggregation group, the MAC address can only be learned in this aggregation group.

By default, no MAC address is assigned to any aggregation group.

Note:

The system supports a maximum of 32 MAC-address-to-aggregation-group bindings.

A MAC address can be assigned to different aggregation groups. When this command and a static MAC address are both configured in the system,

the static MAC address takes effect preferentially. If you use the undo mac-limit command without specifying any parameters, this

command removes all the MAC-address-to-aggregation-group bindings in the system. Otherwise, this command only removes the specified binding.

Related commands: display mac-limit.

Examples

# Assign MAC address 0000-0000-0001 to aggregation group 1.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] mac-limit 0-0-1 restrict to group 1

1.1.10 reset mac-address

Syntax

reset mac-address { all | dynamic | static | interface { interface-type interface-number} | vlan vlan-id }

Page 12: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 1 MAC Address Table Management Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

1-11

View

User view

Parameters

all: Clears all of the MAC address entries.

dynamic: Clears all dynamic MAC address entries.

static: Clears all static MAC address entries.

interface-type interface-number: Interface type and interface number.

vlan vlan-id: Clears all of the MAC address entries in the specified VLAN.

Description

Use the reset mac-address command to clear MAC address entries.

Related commands: mac-address, display mac-address aging time.

Examples

# Clear all MAC address entries.

<Quidway> reset mac-address all

1.1.11 source-mac

Syntax

source-mac mac-address

undo source-mac

View

Ethernet port view

Parameters

mac-address: Source MAC address to be set for the port.

Description

Use the source-mac command to set a source MAC address for the port.

Use the undo source-mac command to remove the source MAC address setting.

By default, the source MAC address of a port is the same as the MAC address of the VLAN interface.

After a source MAC address is set for a port, the MAC address will be used for Layer 3 packet forwarding on the port. When a packet is forwarded through the port, the least significant byte of the source MAC address of the packet is the corresponding byte of the source MAC address set for the port.

Page 13: 06-MAC Address Table Management Commands

Chapter 1 MAC Address Table Management Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

1-12 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Examples

# Set the source MAC address of Ethernet 3/1/1 to 000F-E201-0101

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] interface Ethernet 3/1/1

[Quidway-Ethernet3/1/1] source-mac 00e0-fc01-0101

Page 14: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 2 Static Multicast MAC Address Group Configuration Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

2-1

Chapter 2 Static Multicast MAC Address Group Configuration Commands

2.1 Static Multicast MAC Address Group Configuration Commands

2.1.1 display mac-address multicast static

Syntax

display mac-address multicast static [ [ mac-addr ] vlan vlan-id ]

View

Any view

Parameters

mac-addr: Specifies the multicast MAC address.

vlan-id: Specifies the VLAN ID.

Description

Use the display mac-address multicast static command to display static multicast MAC address group information, which includes multicast MAC address, VLAN ID, address status, port name, and aging time.

If all the ports in the static multicast MAC address group you have configured are not in the position (the corresponding card is plugged out after the configuration), then the PORT INDEX field is displayed as N/A.

Related commands: mac-address multicast.

Examples

# Display all static multicast MAC address group information.

<Quidway> display mac-address multicast static

MAC ADDR VLAN ID STATE PORT INDEX AGING TIME(s)

0100-5e01-0101 3 Config static Ethernet0/1/23 N/A

Ethernet0/1/24

--- 1 mac address(es) found ---

Page 15: 06-MAC Address Table Management Commands

Chapter 2 Static Multicast MAC Address Group Configuration Commands

Command Manual – MAC Address Table ManagementQuidway S8500 Series Routing Switches

2-2 Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

Table 2-1 Description on the fields of the display mac-address multicast static command

Field Description

MAC ADDR The destination MAC address

VLAN ID The VLAN of the MAC address

STATE The state of the MAC address, which is always Config static for a static multicast MAC address.

PORT INDEX Port index, which is displayed as N/A if no valid port is in the position.

AGING TIME(s) The aging time, which is always N/A for a static multicast MAC address.

2.1.2 mac-address multicast

Syntax

mac-address multicast mac-addr interface { { interface-type interface-number } [ to { interface-type interface-number } ] } &<1-10> vlan vlan-id

undo mac-address multicast [ [mac-addr] vlan vlan-id ]

undo mac-address multicast mac-addr interface { { interface-type interface-number } [ to { interface-type interface-number } ] } &<1-10> vlan vlan-id

View

System view

Parameters

mac-addr: Multicast MAC address.

interface-type interface-number: Interface type and interface number.

to: Specifies a port range, the value before this keyword specifies the starting interface and the value after this keyword specifies the ending interface.

vlan-id: VLAN ID.

Description

Use the mac-address multicast command to add multiple ports to a static multicast MAC address group.

Use the undo mac-address multicast command to remove the static multicast MAC address group or the ports from the static multicast MAC address group.

Note that:

Page 16: 06-MAC Address Table Management Commands

Command Manual – MAC Address Table Management Quidway S8500 Series Routing Switches

Chapter 2 Static Multicast MAC Address Group Configuration Commands

Huawei Proprietary and Confidential Copyright (c) Huawei Technologies Co., Ltd

2-3

The ports to be configured must be Ethernet ports and cannot belong to any aggregation group or configured with the Link Aggregation Control Protocol (LACP).

The configured multicast MAC address cannot be the same with the multicast MAC address used by the known protocols, for example 0100-5E00-0005 for the Open Shortest Path First (OSPF) protocol.

Related commands: display mac-address multicast static.

Examples

# Configure a static multicast MAC address group with the MAC address 0100-5E01-0101, and add ports Ethernet 1/1/1 through Ethernet 1/1/5 which belong to VLAN 2 to the static multicast MAC address group.

<Quidway> system-view

System View: return to User View with Ctrl+Z.

[Quidway] mac-address multicast 0100-5e01-0101 interface Ethernet 1/1/1 to

Ethernet 1/1/5 vlan 2

2.1.3 reset mac-address multicast

Syntax

reset mac-address multicast

View

User view

Parameters

None

Description

Use the reset mac-address multicast command to clear all static multicast MAC address groups.

Related commands: mac-address multicast.

Examples

# Clear all static multicast MAC address groups.

<Quidway> r

eset mac-address multicast