交换机 MAC地址动态绑定。

来源:本站原创 CISCO 超过573 views围观 0条评论

mac-address-table dynamic

To add dynamic addresses to the MAC address table, use the macaddresstable dynamic command in global configuration mode. Dynamic addresses are automatically added to the address table and dropped from it when they are not in use. To remove dynamic entries from the MAC address table, use the no form of this command.

Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers

mac-address-table dynamic hwaddress interface {fa | gi} [slot/port] vlan vlanid

no mac-address-table dynamic hwaddress vlan vlanid

Catalyst Switches

mac-address-table dynamic hwaddress interface [atm slot/port] [vlan vlanid]

no mac-address-table dynamic hwaddress [vlan vlanid]

Syntax Description

hwaddress

MAC address added to or removed from the table.

interface

Port to which packets destined for hw-address are forwarded.

fa

Specifies FastEthernet.

gi

Specifies GigabitEthernet.

slot

(Optional) The slot (slot 1 or slot 2) to which to add dynamic addresses.

port

(Optional) Port interface number. The ranges are based on type of Ethernet switch network module used:

0 to 15 for NM-16ESW
0 to 35 for NM-36ESW
0 to 1 for GigabitEthernet

atm slot/port

(Optional) Add dynamic addresses to the ATM module in slot 1 or 2. The port is always 0 for an ATM interface.

vlan vlanid

Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers

The interface and vlan parameters together specify a destination to which packets destined for hwaddress are forwarded.

The vlan keyword is optional if the port is a static-access or dynamic-access VLAN port. In this case, the VLAN assigned to the port is assumed to be that of the port associated with the MAC address.

The vlan keyword is required for multi-VLAN and trunk ports. This keyword is required on trunk ports to specify to which VLAN the dynamic address is assigned.

The vlan-id is the value of the ID of the VLAN to which packets destined for hwaddress are forwarded. Valid IDs are 1 to 1005; do not enter leading zeroes.

Catalyst Switches

(Optional) The interface and vlan parameters together specify a destination to which packets destined for hwaddressare forwarded.

The vlan keyword is optional if the port is a static-access or dynamic-access VLAN port. In this case, the VLAN assigned to the port is assumed to be that of the port associated with the MAC address.

Note When this command is executed on a dynamic-access port, queries to the VLAN Membership Policy Server (VMPS) do not occur. The VMPS cannot verify that the address is allowed or determine to which VLAN the port should be assigned. This command should be used only for testing purposes.

The vlan keyword is required for multi-VLAN and trunk ports. This keyword is required on trunk ports to specify to which VLAN the dynamic address is assigned.

The vlan-id is the value of the ID of the VLAN to which packets destined for hwaddress are forwarded. Valid IDs are 1 to 1005; do not enter leading zeroes.

Defaults

Dynamic addresses are not added to the MAC address table.

Command Modes

Global configuration

Command History Release Modification

11.2(8)SA

This command was first introduced.

11.2(8)SA3

The vlan keyword was added.

11.2(8)SA5

The atm keyword was added.

12.2(2)XT

This command was implemented on Cisco 2600 series, Cisco 3600 series, and Cisco 3700 series routers.

12.2(8)T

This command was integrated into Cisco IOS Release 12.2(8)T, on Cisco 2600 series, Cisco 3600 series, and Cisco 3700 series routers.

12.2(11)T

This command was integrated into Cisco IOS Release 12.2(11)T.

Usage Guidelines

If the vlanid argument is omitted and the no form of the command is used, the MAC address is removed from all VLANs.

Examples

The following example shows how to add a MAC address on port fa1/1 to VLAN 4:

Switch(config)# mac-address-table dynamic 00c0.00a0.03fa fa1/1 vlan 4Related Commands Command Description

clear macaddresstable

Deletes entries from the MAC address table.

macaddresstable agingtime

Sets the length of time that a dynamic entry remains in the MAC address table after the entry is used or updated.

macaddresstable static

Adds static addresses to the MAC address table.

show macaddresstable

Displays the MAC address table.

mac-address-table secure

To add secure addresses to the MAC address table, use the macaddresstable secure command in global configuration mode. To remove secure entries from the MAC address table, use the no form of this command.

Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers

mac-address-table secure hwaddress interface {fa | gi} slot/port vlan vlanid

no mac-address-table secure hwaddress vlan vlanid

Catalyst Switches

mac-address-table secure hwaddress interface [atm slot/port] [vlan vlanid]

no mac-address-table secure hwaddress [vlan vlanid]

Syntax Description

hwaddress

MAC address that is added to the table.

interface

Port to which packets destined for hwaddress are forwarded.

fa

Specifies FastEthernet.

gi

Specifies Gigabit Ethernet.

slot

(Optional) The slot (slot 1 or slot 2) to which to add dynamic addresses.

port

(Optional) Port interface number. The ranges are based on type of Ethernet switch network module used:

0 to 15 for NM-16ESW
0 to 35 for NM-36ESW
0 to 1 for GigabitEthernet

atm slot/port

(Optional) Add secure address to the ATM module in slot 1 or 2. The port is always 0 for an ATM interface.

vlan vlanid

Cisco 2600 Series, Cisco 3600 Series, and Cisco 3700 Series Routers

The interface and vlan parameters together specify a destination to which packets destined for hwaddress are forwarded.

The vlan keyword is optional if the port is a static-access VLAN port. In this case, the VLAN assigned to the port is assumed to be that of the port associated with the MAC address. This keyword is required for multi-VLAN and trunk ports.

The value of vlanid is the ID of the VLAN to which secure entries are added. Valid IDs are 1 to 1005; do not enter leading zeroes.

Catalyst Switches

(Optional) The interface and vlan parameters together specify a destination to which packets destined for hwaddressare forwarded.

The vlan keyword is optional if the port is a static-access VLAN port. In this case, the VLAN assigned to the port is assumed to be that of the port associated with the MAC address. This keyword is required for multi-VLAN and trunk ports.

The value of vlanid is the ID of the VLAN to which secure entries are added. Valid IDs are 1 to 1005; do not enter leading zeroes.

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=284转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
  • 相关文章
  • 为您推荐
  • 各种观点

暂时还木有人评论,坐等沙发!
发表评论

快捷键:Ctrl+Enter