交换机 MAC地址动态绑定。
To add dynamic addresses to the MAC address table, use the mac–address–table 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 hw–address interface {fa | gi} [slot/port] vlan vlan–id
no mac-address-table dynamic hw–address vlan vlan–id
Catalyst Switches
mac-address-table dynamic hw–address interface [atm slot/port] [vlan vlan–id]
no mac-address-table dynamic hw–address [vlan vlan–id]
hw–address
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 vlan–id
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 hw–address 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 hw–address are forwarded. Valid IDs are 1 to 1005; do not enter leading zeroes.
(Optional) The interface and vlan parameters together specify a destination to which packets destined for hw–addressare 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 hw–address are forwarded. Valid IDs are 1 to 1005; do not enter leading zeroes.
Dynamic addresses are not added to the MAC address table.
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.
If the vlan–id argument is omitted and the no form of the command is used, the MAC address is removed from all VLANs.
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 mac–address–table
Deletes entries from the MAC address table.
mac–address–table aging–time
Sets the length of time that a dynamic entry remains in the MAC address table after the entry is used or updated.
mac–address–table static
Adds static addresses to the MAC address table.
show mac–address–table
Displays the MAC address table.
To add secure addresses to the MAC address table, use the mac–address–table 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 hw–address interface {fa | gi} slot/port vlan vlan–id
no mac-address-table secure hw–address vlan vlan–id
Catalyst Switches
mac-address-table secure hw–address interface [atm slot/port] [vlan vlan–id]
no mac-address-table secure hw–address [vlan vlan–id]
hw–address
MAC address that is added to the table.
interface
Port to which packets destined for hw–address 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 vlan–id
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 hw–address 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 vlan–id is the ID of the VLAN to which secure entries are added. Valid IDs are 1 to 1005; do not enter leading zeroes.
(Optional) The interface and vlan parameters together specify a destination to which packets destined for hw–addressare 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 vlan–id is the ID of the VLAN to which secure entries are added. Valid IDs are 1 to 1005; do not enter leading zeroes.
暂时还木有人评论,坐等沙发!