Network Engineering Training _5 Switch configuration

Source: Internet
Author: User

Lab 5: Switch configuration. Includes: switch basic configuration, partition VLAN, single-arm routing

Switch Overview: Cisco switches have not only 2-layer switching capabilities, but also features such as VLANs.
VLAN technology allows us to easily control the size of broadcast domains. With VLANs, the cascade link between switches requires Trunk technology to ensure that the link can transmit data from multiple VLANs at the same time.
VTP is also introduced to facilitate the management of VLAN information on each switch. Cascade link Bandwidth between switches if not enough, we can bundle multiple links together to form a logical link.

Trunk Description: When a VLAN crosses different switches, it needs to use trunks on the same VLAN but on computers that are on different switches.
Trunk technology allows multiple VLANs to be transmitted on a physical line, the switch receives data from a port belonging to a VLAN (for example, VLAN3), and a token is added to the trunk link before transmission, indicating that the data is VLAN3; to the other side of the switch, Exchange opportunity to remove the tag and send it only to the port that belongs to VLAN3.
Single-Arm routing description: Computers in different VLANs even if they are on the same switch, communication between them must also use a router.
You can have an Ethernet port and a router connection on each VLAN. In this way, if you want to implement communication between the N VLANs, the router needs n Ethernet interfaces, and also consumes the Ethernet interfaces on n interchanges.
One-arm routing provides another solution. The router requires only one Ethernet interface and a switch connection, and this interface of the switch is set to the Trunk interface. Create multiple sub-interfaces and different VLAN connections on the router, and the subinterfaces are logical interfaces on the physical interface of the router.

First, the purpose of the experiment

1. Learn the basic knowledge of the switch, and master the switch commands frequently;

2. Learn how to create and partition switch VLANs.

3. Master the method of configuring the Switch interface trunk.

4. Master the use of single-arm routing.

Second, the experimental equipment and environment

Experimental hardware: Microcomputer, Cisco Real machine (including two routers, one two-layer switch, one three-tier switches)

Lab Software: Cisco Packet Tracer

Third, the experimental steps

(i) VLAN partitioning

1. The experimental topology diagram is as follows:

2. Configure the IP address of the 4 PC to the address shown.

3. Divide the ports into VLANs:

(1) First create the VLAN using the following command:

S1 (config) #vlan 1

S1 (Config-vlan) #name VLAN1

S1 (Config-vlan) #exit

S1 (config) #vlan 2

S1 (Config-vlan) #name VLAN2

(2) partition the VLAN on the switch S1:

(Step 2: Divide the ports in the VLAN
S1 (config) #interface F0/1
S1 (config-if) #switch mode access
Change the switch port mode to access mode, indicating that the port is used to connect to the computer instead of the trunk
S1 (config-if) #switch Access VLAN 2
Then divide the port F0/1 into VLAN 2.
S1 (config) #interface F0/2
S1 (config-if) #switch mode access
S1 (config-if) #switch Access VLAN 3)

Verify with show VLAN and the results are as follows:

(3) partition the VLAN on the switch S1:

Verify with show VLAN and the results are as follows:

Ping PC2 with PC1, because they are VLAN1, so the ping is:

Ping PC3 with PC1, because it is not the same VLAN, so the ping does not pass:

(4) Testing on the real machine:

Switch S1:

Switch S2:

The test is as follows:

(ii) Trunk configuration

1. The experimental topology diagram is as follows:

2. Configure Trunk

(Step: Configure Trunk
S1 (config) #int F0/13
S1 (config-if) #switchport trunk encanpsulation dot1q
The above is the package type that configures the trunk link, and the two ends of the same link are packaged the same way. Some switches, such as 2,950, can only encapsulate dot1q, so there is no need to execute the command.
S1 (config-if) #switch mode trunk
The above is to configure the interface as Trunk
S2 (config) #int F0/13
S2 (config-if) #switchport trunk encanpsulation dot1q
S2 (config-if) #switch mode trunk)

(1) Configure trunk on switch S1

Verify with "S1#show interface F0/13 switchport":

(2) Configure the trunk on the switch S2:

Verify with "S2#show interface F0/13 switchport":

(iii) Single-arm routing

1. The experimental topology diagram is as follows:

2. Divide the VLAN on the S1:

(Step 1: Divide the VLAN on the S1
S1 (config) #vlan 2
S1 (Config-vlan) #exit
S1 (config) #int F0/5
S1 (config-if) #switchport mode access
S1 (config-if) #switchport access VLAN 1
S1 (config-if) #int F0/6
S1 (config-if) #switchport mode access
S1 (config-if) #switchport Access VLAN 2)

3. Configure the Ethernet interface on the switch to be the Trunk interface first

(Step 2: Configure the Ethernet interface on the switch to the Trunk interface first
S1 (config) #int F0/1
S1 (config-if) #switch trunk encap dot1q
S1 (config-if) #switch mode trunk)

4. Create a sub-interface under the physical Ethernet interface of the router and define the package type

(Step 3: Create sub-interfaces under the physical Ethernet interface of the router and define the package type
R1 (config) #int g0/0
R1 (config-if) #no shutdown
R1 (config) #int g0/0.1
R1 (config-subif) #encapture dot1q 1 native
The above is the definition of which VLAN traffic is hosted on this subinterface, because the native VLAN on the switch is VLAN 1, so let us also indicate that the VLAN is the native VLAN. In fact, the native VLAN is VLAN 1 by default.

R1 (config-subif) #ip address 172.16.1.254 255.255.255.0
Configure the IP address on the subinterface, this address is the gateway to VLAN 1.

R1 (config) #int g0/0.2
R1 (config-subif) #encapture dot1q 2
R1 (config-subif) #ip address 172.16.2.254 255.255.255.0

5. Testing on the real machine:

Switch configuration:

Router configuration:

The test results are as follows:

Iv. errors and analysis in the experiment

1. The switch should be replaced with a three-layer switch in a real-computer experiment with one-arm routing

Five, experimental experience and summary

1. The experiment was completed on time and in quantity.

2. Through this experiment, I have mastered the method of creating the Switch VLAN, and mastered the method of configuring the Switch interface trunk and the use of single-arm routing.

3. Through this experiment, I have deepened my understanding of computer network virtual LAN knowledge. Also has a deeper understanding to the work steps of the computer network.

Network Engineering Training _5 Switch configuration

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.