nonegotiate cisco что за команда
О режиме switchport
Я новичок в сетевой инженерии. Я считаю, что трудно различить и понять различные настройки switchport.
Почему у меня есть switchport, установленный для доступа, авто или динамический? Для чего они используются? Эти функции используются только для хоста для переключения соединения?
Для чего используется «switchport nonnegotiate»?
Добро пожаловать в область сетевого проектирования!
DTP расшифровывается как Dynamic Trunking Protocol и имеет решающее значение для приведенных ниже команд. Это также собственность Cisco.
Порт роли доступа обычно используется для одного хоста или устройства. Вы также должны указать, с какой VLAN вы хотите, чтобы он был связан, в противном случае он будет по умолчанию VLAN 1 в мире Cisco. например)
интерфейс gig0 / 1
switchport mode access доступ
switchport доступ vlan 10
Кроме того, если у вас есть VLAN для VoIP трафика. Вы также можете установить голосовой VLAN, как требуется, добавив
switchport voice vlan 20
Магистральный порт обычно используется только тогда, когда вы хотите соединить два коммутатора вместе, чтобы передать несколько VLAN между двумя коммутаторами. В этом примере коммутаторы будут использовать тегирование Dot1Q и позволят передавать vlans 10, 20 и 30 между двумя коммутаторами. Vlan 10, однако, будет пропущен без тегов, так как он установлен как нативный vlan. например)
Switch1 # интерфейс gig0 / 1
инкапсуляция switchport dot1q
режим
switchport транк switchport магистраль native vlan 10
транк portport разрешен vlan 10,20,30
Switch2 # интерфейс gig0 / 1
инкапсуляция switchport dot1q
режим
switchport транк switchport магистраль native vlan 10
транк portport разрешен vlan 10,20,30
Посмотрите на Реализовать магистральные и транковые протоколы для большего количества примеров и узнать больше о маркировке ISL или dot1q вместе с некоторыми дополнительными командами и информацией отладки.
Nonegotiate cisco что за команда
Note ● For complete syntax and usage information for the commands used in this chapter, see these publications:
Tip For additional information about Cisco Catalyst 6500 Series Switches (including configuration examples and troubleshooting information), see the documents listed on this page:
Prerequisites for Layer 2 LAN Interfaces
Restrictions for Layer 2 LAN Interfaces
Information About Layer 2 Switching
Information about Layer 2 Ethernet Switching
Layer 2 Ethernet Switching Overview
Layer 2 Ethernet ports on Cisco switches support simultaneous, parallel connections between Layer 2 Ethernet segments. Switched connections between Ethernet segments last only for the duration of the packet. New connections can be made between different segments for the next packet.
Layer 2 LAN switching (hardware-supported bridging) avoids congestion by assigning each connected device to its own collision domain. Because each LAN port connects to a separate Ethernet collision domain, attached devices in a properly configured switched environment achieve full access to network bandwidth.
Building the MAC Address Table
Overview of the MAC Address Table
When stations connected to different LAN ports need to communicate, the switch forwards frames from one LAN port to the other at wire speed to ensure that each session receives full bandwidth.
To switch frames between LAN ports efficiently, the switch maintains a MAC address table. When a frame enters the switch, it associates the MAC address of the sending network device with the LAN port on which it was received.
The MAC address table is built by using the source MAC address of the frames received. When the switch receives a frame for a destination MAC address not listed in its MAC address table, it floods the frame to all LAN ports of the same VLAN except the port that received the frame. When the destination station replies, the switch adds its relevant source MAC address and port ID to the MAC address table. The switch then forwards subsequent frames to a single LAN port without flooding to all LAN ports.
The MAC address table can store at least 128,000 address entries without flooding any entries. The switch uses an aging mechanism, configured by the mac address-table aging-time command, so if an address remains inactive for a specified number of seconds, it is removed from the address table.
Synchronization and Sharing of the Address Table
With distributed switching, each DFC-equipped switching module learns MAC addresses, maintains an address table, and ages table entries. MAC address table synchronization over the Ethernet Out of Band Channel ( EOBC) synchronizes address tables among the PFC and all DFCs, eliminating the need for flooding by a DFC for an address that is active on another module. MAC synchronization is enabled by default.
Notification of Address Table Changes
You can configure the switch to maintain a history of dynamic additions and removals of address table entries associated with a particular LAN port. The change history can be sent as an SNMP trap notification or it can be read manually from the SNMP MIB.
Information about VLAN Trunks
Note For information about VLANs, see Chapter26, “Virtual Local Area Networks (VLANs)”
A trunk is a point-to-point link between the switch and another networking device. Trunks carry the traffic of multiple VLANs over a single link and allow you to extend VLANs across an entire network.
802.1Q, an industry-standard trunking encapsulation, is available on all Ethernet ports.
You can configure a trunk on a single Ethernet port or on an EtherChannel. For more information about EtherChannel, see Chapter23, “EtherChannels”
Ethernet trunk ports support several trunking modes (see Table 21-1).
The Dynamic Trunking Protocol (DTP) manages trunk autonegotiation on LAN ports.
To autonegotiate trunking, the LAN ports must be in the same VTP domain. Use the trunk or nonegotiate keywords to force LAN ports in different domains to trunk. For more information on VTP domains, see Chapter25, “VLAN Trunking Protocol (VTP)”
Layer 2 LAN Port Modes
Table 21-1 Layer 2 LAN Port Modes
switchport mode access
Puts the LAN port into permanent nontrunking mode and negotiates to convert the link into a nontrunk link. The LAN port becomes a nontrunk port even if the neighboring LAN port does not agree to the change.
switchport mode dynamic desirable
Makes the LAN port actively attempt to convert the link to a trunk link. The LAN port becomes a trunk port if the neighboring LAN port is set to trunk, desirable, or auto mode. This is the default mode for all LAN ports.
switchport mode dynamic auto
Makes the LAN port willing to convert the link to a trunk link. The LAN port becomes a trunk port if the neighboring LAN port is set to trunk or desirable mode.
switchport mode trunk
Puts the LAN port into permanent trunking mode and negotiates to convert the link into a trunk link. The LAN port becomes a trunk port even if the neighboring port does not agree to the change.
Puts the LAN port into permanent trunking mode but prevents the port from generating DTP frames. You must configure the neighboring port manually as a trunk port to establish a trunk link.
Note DTP is a point-to-point protocol. However, some internetworking devices might forward DTP frames improperly. To avoid this problem, ensure that LAN ports connected to devices that do not support DTP are configured with the access keyword if you do not intend to trunk across those links. To enable trunking to a device that does not support DTP, use the nonegotiate keyword to cause the LAN port to become a trunk but not generate DTP frames.
Default Settings for Layer 2 LAN Interfaces
Layer 3 (unconfigured)
switchport mode dynamic desirable
Allowed VLAN range
VLANs 1 to 4094, except reserved VLANs (see Table 26-1)
VLAN range eligible for pruning
Default access VLAN
Native VLAN (for 802.1Q trunks)
Spanning Tree Protocol (STP)
Enabled for all VLANs
How to Configure LAN Interfaces for Layer 2 Switching
Note Use the default interface < fastethernet| gigabitethernet | tengigabitethernet> slot/port command to revert an interface to its default configuration.
Configuring a LAN Port for Layer 2 Switching
To configure a LAN port for Layer 2 switching, perform this task:
Router(config)# interface type slot/port
Selects the LAN port to configure.
(Optional) Shuts down the interface to prevent traffic flow until configuration is complete.
Configures the LAN port for Layer 2 switching.
Note You must enter the switchport command once without any keywords to configure the LAN port as a Layer 2 port before you can enter additional switchport commands with keywords.
Router(config-if)# no shutdown
Activates the interface. (Required only if you shut down the interface.)
Exits configuration mode.
After you enter the switchport command, the default mode is switchport mode dynamic desirable. If the neighboring port supports trunking and is configured to allow trunking, the link becomes a Layer 2 trunk when you enter the switchport command.
Note When using the switchport command, if a port configured for Layer 3 is now configured for Layer 2, the configuration for Layer 3 is retained in the memory but not in the running configuration and is applied to the port whenever the port switches back to Layer 3. Also, if a port configured for Layer 2 is now configured for Layer 3, the configuration for Layer 2 is retained in the memory but not in the running configuration and is applied to the port whenever the port switches back to Layer 2. To restore the default configuration of the port in the memory and in the running configuration, use the default interface command. To avoid potential issues while changing the role of a port using the switchport command, shut down the interface before applying the switchport command.
Enabling Out-of-Band MAC Address Table Synchronization
To enable the out-of-band MAC address table synchronization feature, perform this task:
Router(config)# mac address-table synchronize [ activity-time seconds ]
Enables out-of-band synchronization of MAC address tables among DFC-equipped switching modules.
When configuring out-of-band MAC address table synchronization, note the following information:
This example shows how to enable out-of-band MAC address table synchronization:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# mac address-table synchronize activity-time 320
Configuring MAC Address Table Notification
Note ● Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the MAC address table notification feature, perform this task:
Router(config)# mac address-table notification change [ interval value ]
Enables sending notification of dynamic changes to MAC address table.
(Optional) Sets the minimum change-sending interval in seconds.
Note The no form of the command reverts to the default without sending any change information.
Router(config)# mac address-table notification change [ history size ]
Enables sending notification of dynamic changes to MAC address table.
(Optional) Sets the number of entries in the history buffer.
Note The no form of the command reverts to the default without sending any change information.
Router(config)# interface type slot/port
Selects the LAN port to configure.
Router(config-if)# snmp trap mac-notification change [ added | removed ]
For MAC addresses that are associated with this LAN port, enable SNMP trap notification when MAC addresses are added to or removed from the address table.
(Optional) To notify only when a MAC address is added to the table, use the added option. To notify only when a MAC address is removed, use the removed option.
Exits interface configuration mode.
When configuring the notification parameters, note the following information:
This example shows how to configure the SNMP notification of dynamic additions to the MAC address table of addresses on the Gigabit Ethernet ports 5/7 and 5/8. Notifications of changes will be sent no more frequently than 5 seconds, and up to 25 changes can be stored and sent in that interval:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# mac address-table notification change interval 5 Router(config)# mac address-table notification change history 25 Router(config)# interface gigabitethernet 5/7 Router(config-if)# snmp trap mac-notification change added Router(config-if)# end Router(config)# interface gigabitethernet 5/8 Router(config-if)# snmp trap mac-notification change added Router(config-if)# end Router# exit
Configuring a Layer 2 Switching Port as a Trunk
Configuring the Layer 2 Switching Port as an 802.1Q Trunk
Note ● Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the Layer 2 switching port as an 802.1Q trunk, perform this task:
Router(config-if)# switchport trunk encapsulation dot1q
(Optional) Configures the encapsulation as 802.1Q.
To support the switchport mode trunk command, you must configure the encapsulation as 802.1Q.
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the Layer 2 Trunk to Use DTP
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the Layer 2 trunk to use DTP, perform this task:
Router(config-if)# switchport mode dynamic < auto| desirable >
(Optional) Configures the trunk to use DTP.
Note The no form of the command reverts to the default trunk trunking mode ( switchport mode dynamic desirable).
When configuring the Layer 2 trunk to use DTP, note the following information:
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the Layer 2 Trunk Not to Use DTP
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the Layer 2 trunk not to use DTP, perform this task:
Router(config-if)# switchport mode trunk
(Optional) Configures the port to trunk unconditionally.
Router(config-if)# switchport nonegotiate
(Optional) Configures the trunk not to use DTP.
Note The no form of the command enables DTP on the port.
When configuring the Layer 2 trunk not to use DTP, note the following information:
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the Access VLAN
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the access VLAN, perform this task:
Router(config-if)# switchport access vlan vlan_ID
(Optional) Configures the access VLAN, which is used if the interface stops trunking. The vlan_ID value can be 1 through 4094, except reserved VLANs (see Table 26-1).
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the 802.1Q Native VLAN
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the 802.1Q native VLAN, perform this task:
Router(config-if)# switchport trunk native vlan vlan_ID
(Optional) Configures the 802.1Q native VLAN.
Note If VLAN locking is enabled, enter the VLAN name instead of the VLAN number. For more information, see the “VLAN Locking” section.
When configuring the native VLAN, note the following information:
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the List of VLANs Allowed on a Trunk
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the list of VLANs allowed on a trunk, perform this task:
Router(config-if)# switchport trunk allowed vlan [ add | except | none | remove ] vlan [, vlan [, vlan [. ]]
(Optional) Configures the list of VLANs allowed on the trunk.
When configuring the list of VLANs allowed on a trunk, note the following information:
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Configuring the List of Prune-Eligible VLANs
Note Complete the steps in the “Configuring a LAN Port for Layer 2 Switching” section before performing the tasks in this section.
To configure the list of prune-eligible VLANs on the Layer 2 trunk, perform this task:
Router(config-if)# switchport trunk pruning vlan < none| << add| except | remove > vlan [, vlan [, vlan [. ]]>>
(Optional) Configures the list of prune-eligible VLANs on the trunk (see the “VTP Pruning” section).
Note The no form of the command reverts to the default value (all VLANs prune-eligible).
When configuring the list of prune-eligible VLANs on a trunk, note the following information:
Note Complete the steps in the “Completing Trunk Configuration” section after performing the tasks in this section.
Completing Trunk Configuration
To complete Layer 2 trunk configuration, perform this task:
Router(config-if)# no shutdown
Activates the interface. (Required only if you shut down the interface.)
Exits configuration mode.
Verifying Layer 2 Trunk Configuration
To verify Layer 2 trunk configuration, perform this task:
Router# show running-config interface type slot/port
Displays the running configuration of the interface.
Router# show interfaces [ type slot/port ] switchport
Displays the switch port configuration of the interface.
Router# show interfaces [ type slot/port ] trunk
Displays the trunk configuration of the interface.
Configuration and Verification Examples
This example shows how to configure the Gigabit Ethernet port 5/8 as an 802.1Q trunk. This example assumes that the neighbor port is configured to support 802.1Q trunking:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# interface gigabitethernet 5/8 Router(config-if)# shutdown Router(config-if)# switchport Router(config-if)# switchport mode dynamic desirable Router(config-if)# switchport trunk encapsulation dot1q Router(config-if)# no shutdown Router(config-if)# end Router# exit
This example shows how to verify the configuration:
Configuring a LAN Interface as a Layer 2 Access Port
Note If you assign a LAN port to a VLAN that does not exist, the port is shut down until you create the VLAN in the VLAN database (see the “Creating or Modifying an Ethernet VLAN” section).
To configure a LAN port as a Layer 2 access port, perform this task:
Router(config)# interface type slot/port
Selects the LAN port to configure.
(Optional) Shuts down the interface to prevent traffic flow until configuration is complete.
Configures the LAN port for Layer 2 switching.
Note You must enter the switchport command once without any keywords to configure the LAN port as a Layer 2 port before you can enter additional switchport commands with keywords.
Router(config-if)# switchport mode access
Configures the LAN port as a Layer 2 access port.
Router(config-if)# switchport access vlan vlan_ID
Places the LAN port in a VLAN. The vlan_ID value can be 1 through 4094, except reserved VLANs (see Table 26-1).
Note If VLAN locking is enabled, enter the VLAN name instead of the VLAN number. For more information, see the “VLAN Locking” section.
Router(config-if)# no shutdown
Activates the interface. (Required only if you shut down the interface.)
Exits configuration mode.
This example shows how to configure the Gigabit Ethernet port 5/6 as an access port in VLAN 200:
Router# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)# interface gigabitethernet 5/6 Router(config-if)# shutdown Router(config-if)# switchport Router(config-if)# switchport mode access Router(config-if)# switchport access vlan 200 Router(config-if)# no shutdown Router(config-if)# end Router# exit
This example shows how to verify the configuration:
Configuring a Custom IEEE 802.1Q EtherType Field Value
You can configure a custom EtherType field value on a port to support network devices that do not use the standard 0x8100 EtherType field value on 802.1Q-tagged or 802.1p-tagged frames.
To configure a custom value for the EtherType field, perform this task:
Router(config-if)# switchport dot1q ethertype value
Configures the 802.1Q EtherType field value for the port.
When configuring a custom EtherType field value, note the following information:
This example shows how to configure the EtherType field value to 0x1234:
Router (config-if)# switchport dot1q ethertype 1234 Router (config-if)#
Tip For additional information about Cisco Catalyst 6500 Series Switches (including configuration examples and troubleshooting information), see the documents listed on this page: