Switch system configuration experiment experience 1
VLAN configuration for single switch
【Basic Principle】VLAN(Virtual Local Area
Network, virtual LAN) refers to logical division within a physical network segment and divided into several VLANs. Each VLAN has the characteristics of a physical network segment, that is, user machines in the same VLAN can directly access each other, and user machines between different VLANs must be forwarded through routing devices. Broadcast data packets can only be propagated within this VLAN (such as ARP request packets) and cannot be transmitted to other VLANs. The settings of VLANs are not restricted by physical locations and can be divided flexibly. A switch is divided into multiple VLANs, logically multiple switches. Port
Vlan is one of the ways to implement VLANs. Port Vlan is a VLAN divided according to the ports of the switch. One port can only belong to one VLAN.
[Experimental Equipment] In Cisco Packet Tracer, each uses 1 switch and 3 computers, and 3 direct connections are used.
[Experimental Network Topology] Suppose that computers H1, H2 and H3 are connected to different ports of a switch, allowing H1 and H2 to communicate and are isolated from H3. At this time, it is necessary to divide the switch into two different VLANs, H1 and H2 in the same VLAN. H1H2
F0/5F0/8 VLAN 10 VLAN 10 2950-24 Switch S2 F0/15 H3 Figure 1
Experimental network topology (no network management machine included) Description: If this laboratory has a computer failure, H2 can be removed.
【Preparation before experiment】1.
Planning of user machine IP address: designed by yourself. The key point is that the network number of the user machine of the same network or VLAN is the same; suggestion: Do not use the network number of 192.168.200.0 in the experimental network. 2.
Planning which ports to use network equipment (switches); 3.
Plan the specific experimental network, draw the topology diagram, and mark the IP address of the user machine used, the port number of the switch and other parameters. The port number, VLAN number and name can also be selected by yourself. During the experiment, connect the network according to the topology diagram. 4.
Design a test form to facilitate recording of experimental processes and results.
[Experimental Steps] 1. Complete the physical connection of the experimental network, the configuration of the network management machine and the entry of the network management window. The process is the same as above. 2. User machine settings 1) Set the IP address according to your experimental plan 3.
The VLAN is not set for the time being. The user machine uses the Ping command to test: Which user machines can communicate between H1, H2, and H3? Why? Results: They can communicate with each other; Reason: Because it is not correctSwitch configurationWhen default all ports are in vlan1; 4.
The network management machine creates a VLAN and displays the VLAN configuration on the switch. (The number and name of the VLAN can be selected by yourself) S2#configureterminal!Enter global configuration mode
S2(config)#vlan 10 ! Create VLAN, number 10, and enter VLAN sub-mode S2(config-vlan)#name test10
!Configure the VLAN number 10 name to test10 S2(config-vlan)#exitS2 (config)#vlan 20! Create the VLAN number 20
S2(config-vlan)#name test20! The VLAN name with configuration number 20 is test20 S2 (config-vlan)#endS2#show
vlan!View VLAN configuration on the switch 5. In order to exclude the impact of the settings of the previous step or previous set of experiments on this experiment, do the following operations to delete vlan on the switch
All other vlan s2(config)#no vlan 10 !ID is VLAN number s2(config)#no vlan 20
Switch system configuration experiment experience 2
1. Master the basic usage methods of switches
【Basic Principles】1.
Switch management methods briefly describe the management methods of switches. Switch management methods are basically divided into two types: in-band management and out-of-band management. Out-of-band management is through the switchConsoleThe port management switch does not occupy the switch's network interface. Its characteristic is that it requires the use of configuration cables and close-range configuration. The first time you configure the switch, you must use the Console port to configure it. In-band management is a communication interface that occupies the switch. The switch is managed through telnet and can be configured remotely. Switch management is mainly done through the command line. The command line operation modes of the switch mainly include: user mode, privilege mode, global configuration mode, port mode, etc. Various modes provide a set of commands to implement a specific set of functions.
First level, user mode: the first operating mode obtained after entering the switch. In this mode, you can simply view the switch's soft andhardwareVersion information and simple testing. The second level, privileged mode: the next level mode entered by the user mode. In this mode, the switch configuration files can be managed, the switch configuration information can be viewed, network testing and debugging, etc. The third level, global configuration mode: the next level mode entered by the privileged mode, in which the switch can be configured (such as device name, description information at login, etc.). At the fourth level, there are multiple parallel sub-modes in the global configuration mode, which respectively configure the specific functions of the switch.
For example, port mode: configure the switch's port parameters. VLAN description: Configure the parameter of the VLAN of the switch. Suppose that the switch name is switch, and the prompts and entry methods for various modes are summarized as follows:
Exit command: Retrace back to the previous operation mode. The End command refers to the user returning directly to the privileged mode from the following levels below the privileged mode. Pay attention to distinguishing the types of commands that can be executed in each operating mode. The switch cannot execute commands across modes. 2.
The switch command line supports the following functions (see experimental steps) 1) Get help information: ?2) Abbreviation of the command: Enter the first few characters 3) Automatically fill the command: Press the Tab key 4)
Shortcut key functions of the command: Ctrl+z: Return to privileged mode Ctrl+c: Terminate the current operation, etc. [Experimental equipment] Cisco Packet
Tracer: 3 computers and 1 switch
【Experimental Steps】1. Enter privileged mode Switch>enSwitch#2. Display the VLAN configuration on the switch Switch#show vlan
!Show the existing VLAN configuration of the switch, which ports these VLANs contain 3. Enter global configuration mode Switch#configure
terminalSwitch(config)#4. Configure the name of the switch to S2 Switch (config)# hostname S2
!There are 22 valid characters for the switch name. 5. Setting S2 (config)#interface fasternet on the Ethernet port of the switch
0/1! Enter the port mode S2 (config-if) of switch F0/1# speed 10! Configure the port speed to 10MS2 (config-if)# duplex
half !Configure the duplex mode of the port to half duplex S2 (config-if)# no shutdown ! Turn on this port, and the port can forward data
S2(config-if)#exit! Return to the previous level of operation mode or S2(config-if)#end! Return to the privileged mode 6 directly.
When practicing command abbreviation or automatic filling of the switch command line usage techniques, the abbreviation letters must be able to uniquely distinguish the command. For example, conf can represent configure, but co cannot represent configure, because there are two copy and configure commands starting with co, and the device cannot be distinguished. S2>
!Show all executable commands in the current mode S2# co!Show all commands starting with CO in the current mode S2# copy !Show the executable parameters after the copy command S2# conf ter!
The abbreviation of the command, which represents S2(config)#configure terminal S2#conf (press the TAB key on the keyboard)! command.
S2#configure7. Exercise of the switch command line (note the command in which operating mode): S2#show version! Check the switch version information S2#show
interface fastethernet 0/6! View port information of Ethernet port 0/6 S2#show
mac-address-table! Check the switch's MAC address table
Switch system configuration experiment experience 3
Experimental experience
In this experiment, I have gained a new understanding of the basic configuration of the switch, and mastered the basic configuration steps of configuring the switch on the computer, the differences between various operating modes of the switch command line, and the switching between modes. In addition, we have a further understanding of the working principle of the switch. There has been some breakthrough in implementation. The commands used during the configuration process made me feel that I should learn more English, especially professional English, which is of great help to match switches!
Switch system configuration experiment experience 4
1. Experimental purpose
Master the differences in various operating modes of the switch command line, be able to use various help information, and use commands to make various configurations.
2. Experimental topology
3. Experimental equipment
RG2628G-I
IV. Experimental principle
The management methods of switches are basically divided into in-band management and out-band management. The switch is managed through the console port of the switch and is out of band management and does not occupy the switch's network interface. Its characteristic is that it requires the use of configuration cables and close-range configuration. When configuring a switch for the first time, you must use the console port to configure it.
The command operation modes of the switch mainly include: user mode, privilege mode, global configuration mode, port mode, etc.
Privileged mode: The next-level mode performed by user mode, which can manage the switch's configuration files, view the switch's configuration information, and conduct network testing and debugging. The privilege mode prompt is: switch#
User mode: The first operating mode you get after entering the switch, which can be viewed simply in this mode.softwareand hardware facilities and perform simple testing. The user mode prompt is: switch>
Global configuration mode: It belongs to the next level of the privileged mode. This mode can configure the switch's global parameters (such as host name, login information, etc.). In this mode, the next level mode can configure the specific functions of the switch. The prompt for global configuration mode is: switch(config)#
Port mode: belongs to the next level of global configuration mode, in which the switch port can be configured parameterly. The prompt for port mode is: switch(config-if)#
5. Experimental steps
Enter the switch and set the com1 attribute. Bits per second: 9600 Data bits: 8 Parity: None Stop bits: 1
Data flow control: None
1. Switching and command search of each mode of the switch
1. Switch to privileged mode: Enter enable in user mode, press Enter to enter the privileged mode, or you can enter the abbreviation en to switch.
2 Switch to the global configuration mode: In the privileged mode, enter configure terminal, press Enter to enter the global configuration mode, or you can also enter the abbreviation cont to switch.
3. Switch to port mode in global configuration mode: enter interface FastEthernet in global configuration mode
0/1, press Enter to enter port mode, or you can enter the abbreviation intreface Fa 0/1 to switch.
4 Enter exit, press Enter to return to the previous mode, enter end, press Enter to return to the port mode and global configuration mode to return to the privileged mode.
5 Enter in the current mode? You can get all the commands in the current mode.
6 When entering the first letter of the command, press the tab key to deliberately complete the current command.
2. Configure the system name and daily prompt information
(1) Configure the system name
In global configuration mode, enter hostname (host+tab key) and add the modified name, and press Enter to modify the system name.
(2) Daily prompt information
In global configuration mode, enter banner motd and press Enter, and the sentence appears: Enter TEXT with the character
‘ Press Enter key and the sentence appears: Enter TEXT with the character ‘’.
After that, write the message you want to download (must be in English). For example: Welcome to can config you are not
admin please EXIT.$ Press Enter.
Enter exit and return to user mode, the sentence above will appear.
3. Modify interface description and network speed
In port mode, enter description “This is a accessport.” Press Enter. Enter speed 10 on the next line Press Enter.
Press end to return to privileged mode, and enter show interface FastEthernet 0/1 Press Enter. You can see the following two sentences: interface’s
description:””This is a accessport.”” admin speed is speed is
Unknown
It proves that the configuration has been successfully completed.
4. Check the system configuration of the switch
In privileged mode, enter show version and press Enter to display system information. For example: system description, system start
time, system uptime, etc.
If you enter show running-config, all the system information is displayed.
Switch system configuration experiment experience 5
1. Experimental purpose
(1) Understand the method of switch configuration.
(2) Master the CLI configuration environment.
(3) Master the basic configuration of the switch.
2. Experimental equipment and environment
One switch, one computer, one configuration cable, one direct network cable.
3. Experimental steps
Establish an experimental environment
When the switch is powered off, connect the serial port of the computer to the Console port of the switch using a configuration cable (Console cable) with an RJ45 connector.
Use the console configuration method mentioned above to enter the command line (CLI) configuration mode, and first enter the user mode.
Configure the name and password of the switch
Switch>(User Mode Prompt)
Switch>enable(enter privilege mode)
Switch# (Privacy Mode Prompt)
Switch# config terminal (enter the global configuration mode)
Switch(config)#(Global Configuration Mode Prompt)
Switch(config)# hostname
SwitchA (set the host name SwitchA. Name the switch, which can uniquely identify each switch in the network, which helps manage the network)
SwitchA(config)# no hostname SwitchA(restore switch name)
Switch (config)# enable password
cisco (sets the enable password to enter privileged mode, the password is required to be set to 5 to 8 characters, and is case sensitive)
Switch(config)# enable secret cisco1 (set the encryption enable password, function and enable
password is the same, but is safer. Generally, you only need to set this password. )
Switch(config)# end(return to privileged mode)
Switch# show running-config (show the currently running configuration)
Switch# copy running-config startup-config (save configuration)
The switch has been configured, but the current running configuration has been modified. If you want the switch to restart, the configuration must be saved as a startup configuration.
1. Configure the switch IP address, default gateway, domain name, and domain name server
Setting up the switch's IP address, gateway, domain name and other information is just to be able to remotely manage the switch from anywhere on the network, and has no other purpose. When there is no VLAN division, the switch has VLAN1 by default. The IP of VLAN1 is the switch's management IP. Some switches (such as Catalyst
2950) Each VLAN can provide a management IP, and after entering the VLAN, the management IP within the VLAN can be set.
Switch(config)# int vlan1 (enter the configuration mode of VLAN1)
Switch(config-if)# ip address 192.168.1.1 255.255.255.0 (set switch IP address)
Switch(config-if)# exit(return to global configuration mode)
Switch(config)# ip default-gateway 192.168.1.254 (set default gateway)
Switch(config)# ip domain-name cisco.com (set domain name)
Switch(config)# ip name-server10.0.0.1 (set the domain name server)
Switch(config)# end(return to privileged mode)
Switch# show running-config (show current configuration)
2. ConfigurationtelnetRemote login session and password
Switch# config terminal (enter global configuration mode)
Switch (config)# line vty 0 4 (enter the configuration mode of virtual terminal port vty0~vty4, where 0 4
It is defined that 5 virtual terminal telnet sessions can be performed simultaneously. Catalyst2950 supports up to 0 15 16 telnet connections)
Switch (config-line)# password cisco (Specify the virtual terminal password for remote login for Telnet)
Switch(config-if)# exit(return to global configuration mode)
At this time, you can use a straight-through cable to connect the normal ports of the computer and the switch, and then log in to the switch using telnet to enter the switch's CLI configuration interface.
3. Configure the switch's port properties
In general, the switch's port properties do not need to be set to work normally. It only needs to configure its port properties in some cases. The configured objects mainly include speed, duplex mode, and port description.
Switch# config terminal (enter the global configuration mode)
Switch(config)# interface fastethernet0/1 (configuration mode of fastethernet0/1)
Switch(config-if)#?(View commands that can be used in interface configuration mode)
Use speed{10|100|1000|autoThe |nonegotiate} command configures the interface rate:
Switch(config-if)# speed?(View the subcommand of the speed command)
Switch(config-if)# speed 100 (set the port speed to 100Mb/s)
Among them, the "1000" keyword is only valid for 1000Base-T port; the 1000Base-SX port and GBIC module port can only work at 1000.
The Mbps;"nonegotiate" keyword is only valid for 1000Base-SX, 1000Base-LX and 1000Base-ZX GBIC ports.
Use duplex {auto|full|half} to configure interface duplex mode:
Switch (config-if )# duplex ?(View the subcommand of the duplex command)
Switch(config-if)# duplex full (set this port to full duplex)
Among them, 1000Base-SX and 1000Base-T can only work in full duplex mode; the "duplex" keyword is for GBIC ports and Catalyst
The 1000Base-T port of 2950T24 is invalid.
Switch(config-if) # description CON_TO_LAB (set the port description and identify the port)
Specifying description text for the port allows you to intuitively understand the devices connected to the port, making it easy to configure and manage.
Switch(config-if)# Ctrl+Z(return to privileged mode, same as end)
Switch# show interface fastethetnet0/1 (see the settings of port 0/1, the results are omitted)
Switch# show interface fastethetnet0/1 description (see the description of port 0/1, the result is omitted)
Switch# show interface fastethernet0/1 status(View port fastethernet
0/1 status, result omitted)
4. Configure the port group
When many ports have exactly the same configuration, we can define several ports as a port group, so that all ports included in the port group can have the same configuration.
Switch# configure terminal (enter global configuration mode)
Switch (config)# interface range
port-range (enters the interface configuration mode of the port group, port-range is the port group range to be configured)
Switch (config-if-range) #
According to configuration needs, enter the interface configuration command, and the input command will take effect on all ports in the port group.
Switch (config-if-range) # end (return to privileged mode)
Switch# show running-config (show the currently running configuration)
Switch# copy running-config startup-config (save configuration)
When using the interface range command, there are the following rules:
Valid group range:
vlan from 1 to 4094
fastethernet slot/{first port} - {last port}, slot is 0
gigabitethernet slot/{first port} - {last port}, slot is 0
port-channel port-channel-number -
port-channel-number. Port-channel numbers with continuous port numbers from 1 to 64 can be represented by hyphen between the start and end port numbers. However, a space must be added before and after the hyphen "-". For example: interface
range fastethernet 0/1 - 5 is valid, while interface range fastethernet 0/1-5 is invalid.
The interface range command can only configure existing interface vlans.
If you want to configure different types of interfaces at the same time, you can use the English "," to separate them:
Switch(config)# interface range fastethernet 0/1 - 3, gigabitethernet 0/1 -
2
Switch(config-if-range)#
5. Define port group macros
We can also predefined the interface-range macro, and use the macro name directly when configuring the interface, which is more convenient.
Switch# configure terminal (enter global configuration mode)
Define port group macro names for several specified ports:
Switch(config)# define interface-range macro_name f0/1 - 3, g0/1 - 2
The maximum macro name is 32 characters. A macro can use up to 5 English commas "," to specify the port range and does not require spaces between commas.
Use the macro name to configure the port group, and the command will take effect on all ports in the macro definition.
Switch(config)# interface range macro macro_name
Switch (config-if-range) # no shutdown (This mode can use all commands in port configuration mode)
Switch (config-if-range) # end (return to privileged mode)
Switch# show running-config (show the currently running configuration)
Switch# copy running-config startup-config (save configuration)
Switch system configuration experiment experience