I. Basic configurations of Cisco 2950 vswitches
- Switch>
-
- Switch> enable
-
- Switch #
-
- Switch # vlan database (entering vlan maintenance mode)
-
- Switch (vlan) # vlan 2 name vlan2 name vlan 2 vlan2)
-
- Switch (vlan) # vlan 4 name vlan4 name vlan 4 vlan4)
-
- Switch (vlan) # exit. Note that exit is valid only when exit is enabled. You cannot exit directly with ctrl + z or end because the configuration cannot take effect !)
-
- Switch # show vlan (vlan1 is used by default to view vlan configurations)
-
- Switch # configure terminal enters global configuration mode)
-
- Switch (config) # interface f0/1 enters the fastethernet0/1 interface Configuration Mode)
-
- Switch (config-if) # switchport mode access can be omitted)
-
- Switch (config-if) # switchport access vlan 2 divides this interface into vlan2. Remember that there is a space between vlan2)
-
- Switch (config-if) # no shutdown (activation port)
-
- Switch (config-if) # exit
-
- Switch (config) # interface f0/2
-
- Switch (config-if) # switchport mode access
-
- Switch (config-if) # switchport access vlan 4
-
- Switch (config-if) # no shutdown
-
- Switch (config-if) # exit
-
- Switch (config) # interface f0/3
-
- Switch (config-if) # switchport mode trunk sets this port to relay mode)
-
- Switch (config-if) # no shutdown
-
- Witch (config-if) # exit. You can directly use ctrl + z or end to exit the privileged mode)
2. Configure single-arm routing on vrocisco Cisco 2611)
- Router # configure terminal
-
- Router (config) # interface f0/0.1 enters the subinterface Mode)
-
- Router (config-subif) # encapsulation dot1q 2 sets the encapsulation type to dot1q, which is owned by Scott. In addition, there are isl encapsulation, depending on the device support is not supported. Number 2 is the vlan number)
-
- Router (config-subif) # ip address 192.168.1.1 255.255.0
-
- Router (config-subif) # exit
-
- Router (config) # interface f0/0.2
-
- Router (config-subif) # encapsulation dot1q 4
-
- Router (config-subif) # ip address 192.168.3.1 255.255.255.0
-
- Router (config-subif) # exit
-
- Router (config) # interface f0/0
-
- Router (config-if) # no shutdown
-
- Router (config-if) # ^ z
-
- Router # show running-config
-
- Router # copy running-config startup-config
3. Set IP addresses for PC1 and PC2, and then use the ping command to test the IP address!
1. Configure the IP address
To be able to be managed by a network management switch, a management IP address must be identified for it. By default, VLAN 1 of a CISCO switch is a management VLAN, Which is configured with an IP address. Then the switch can be managed. The command is as follows:
A. Go to global mode: Switch # configure terminal
B. Enter VLAN 1 interface mode: Switch (config) # interface vlan 1
C. Configuration Management ip address: Switch (config-if) # ip address [A. B .C.D] [mask]
If the current VLAN is not a management VLAN, you only need to replace the vlan number in the command section B above with the number in the management VLAN.
2. Enable the SNMP protocol
A. Go to global mode: Switch # configure terminal
B. Configure the read-only Community. The default value of the product's read-only Community is public.
Switch (config) # snmp-server community public ro
C. Configure writable Community. The default product writable Community name is private.
Switch (config) # snmp-server community private rw
3. Change the SNMP Community password.
A. Group devices and enable various Supported SNMP versions
- Switch(config)#snmp-server group qycx123 v1
-
- Switch(config)#snmp-server group qycx 123 v2c
-
- Switch(config)#snmp-server group qycx123 v3 noauth
B. Configure read-only and writable community respectively, for example:
- Switch(config)#snmp-server community qycx123 ro
-
- Switch(config)#snmp-server community qycx123 rw
4. Save vswitch configurations
Switch # copy run start
If you do not understand common Switch configuration commands, read: Summary of common Cisco switch commands