CISCO switch configuration commands and definitions

CISCO switch configuration commands and interpretation
1. Set the switch name
Switch (config) #hostname DSHD
DSHD (config) #

Open and close ports 2
// default, the port is closed

Switch(config)#interface fastethernet 0/1

Switch (config-if) #shutdown // close the port

Switch(config)#interface fastethernet 0/1

Switch (config-if)) # no shutdown // open port

3 Set duplex status of port
Switch (config) #interface FastEthernet 0/1
Switch (config-IF) {# Duplex half | Full | Auto}
// half where half-duplex, full full-duplex, auto auto negotiation .

4 port speed settings (set flow rate)
Switch (config) #interface FastEthernet 0/1

Switch(config-if)# speed { 10 | 100 | 1000 | auto}

// 10 being 10M, 100 for the 100M, 1000 to 1000M, auto to auto-negotiate.

Switch(config-if)#no speed

// Restore the default rate configuration.

5 set the operating mode of the Ethernet ports (access and trunk)

// specified ports operate in access mode

Switch(config-if)#switchport mode access

// specified port operates in trunk mode

Switch (config-if) #switchport mode trunk
Description:
Ethernet port has two operating modes: Access and Trunk.

1, the working port in the Access mode can only belong to one VLAN, and then the user port of the computer is generally used;

2, operating in Trunk port can belong to more than one VLAN mode, can receive and transmit packets of a plurality of VLAN, ports between switches generally used;

3, you can use the switchport access vlan vlan_number specified port belongs to what vlan.

6. Set the link aggregation (an EtherChannel)

switch(config)#interface fastethernet 0/1

switch(config-if)# channel- group channel-group-number mode {auto [non-silent] | desirable [non-silent] | on}
注意 :

1, all ports on Fast Ethernet channel link must be members of the same VLAN, or you must be a Trunk port.

2, Fast Ethernet ports if the channel link is a trunk port, these ports must have the same range vlan.

3, all port speed and duplex mode within the Fast Ethernet link channel must be the same.

7.trunk configuration and package
switch (config) #interface GigabitEthernet1 / 0 /2

switch(config-if)# switchport trunk encapsulation dot1q

Switch (config-IF) # switchport MODE Trunk
. 1, the access link (access): an access link is only a member of the VLAN. This VLAN is called native VLAN port. Device connected to this port had no idea exists a VLAN. The apparatus is arranged only on the device layer 3 information that it is part of the network or subnet. In order to ensure that it does not need to know the existence of VLAN, the switch is responsible for end before being sent to the device is not removed from the VLAN information to frames in the frame. It is a part of the access links, to one and only one VLAN ports, the port can not receive information from another VLAN, unless this information has been selected through the route. The port can not send messages to another VLAN, unless the port can access the router.

2, roads (Trunk) Link: trunk link may carry a plurality of VLAN. Named the trunk link from telephone system trunk (trunk), which can transmit a plurality of telephone conversation. Trunk link is typically used to connect the switch to another switch, or to connect the switch to the router. Cisco supports a trunk link on Fast Ethernet and Gigabit Ethernet ports.

 目前Cisco所使用的有两种标识技术如下:

 a, Cisco switches between link (ISL): used to interconnect multiple switches cisco proprietary encapsulation protocol. The agreement that is supported on Catalyst switches and routers

 b, IEEE802.1Q standard: it is identified by inserting a VLAN identifier VLAN header.

8. Configure story, three VLAN
// create vlan

switch#vlan database

switch(config-vlan)# vlan valn_id name vlan_name

switch(config-vlan)# no vlan vlan_id

// Create three vlan

switch(config)# interface vlan_id

switch(config-vlan)# ip address 172.168.1.1 255.255.255.0

switch(config-vlan)# no shutdown

// port to vlan

switch(config)# interface g1/0/10

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan vlan_id

Switch(config-if)#no shutdown

9. static route
configuration examples of static routes:
ip route 0.0.0.0 0.0.0.0 172.18.128.49
delete Static Routes
no ip route 0.0.0.0 0.0.0.0 172.18.128.49

Guess you like

Origin blog.51cto.com/14449563/2427868