How to configure VLAN partitioning on a switch

Source: Internet
Author: User
Tags command line config

We know that the traditional LAN Ethernet uses a carrier-monitored multi-channel access (CSMA/CD) method with conflicting detection. In CSMA/CD networks, nodes can use the network at any time they have data to send. Before the node transmits data, it "listens" to see if the network is busy. If not, the node begins to transfer the data. If the network is in use, the node waits. If two nodes are listening, without hearing anything, and starting to use the line at the same time, there will be a conflict. When sending data, if it uses a broadcast address, then all PCs on this segment will receive packets, which can easily cause a broadcast storm if the segment has a large number of PCs. Conflict and broadcast storms are important factors that affect the performance of the network. To solve this problem, the concept of virtual local area network (VLAN) is introduced.

A virtual network is a virtual workgroup that is built over a network-switched device across the network. The virtual network logically equals the broadcast domain of the second layer of the OSI model, regardless of the physical network and geographical location. A virtual workgroup can contain departments and workgroups in different locations, without having to physically reconfigure any ports to actually implement network users regardless of their physical location. The virtual network technology divides the traditional broadcast domain into each independent sub broadcast domain, restricts the broadcast to the virtual workgroup, because of the reduction of broadcast domain, the proportion of broadcast packet consumption bandwidth is greatly reduced, and the performance of the network is significantly improved. Let's take a look at the following picture. Figure 1 shows that the same department of two floors is divided into one VLAN, so that the accounting data does not broadcast to the market machine, nor does the data conflict with the market machine. So the VLAN effectively splits the conflict domain and the broadcast domain.

We can define VLANs on one port of the switch, all terminals connected to this particular port are part of the virtual network, and the entire network can support multiple VLANs. VLAN can reduce unnecessary data traffic to the minimum by establishing network firewall, isolate the transmission between each VLAN and the possible problems, increase the network throughput greatly, and decrease the network latency. In a virtual network environment, you can control the communication between users in the same physical network segment by dividing different virtual networks. This effectively implemented the data confidentiality, and configuration is not cumbersome, network administrators can logically reconfigure the network, rapid, simple, efficient balance load flow, easy to add, delete and modify users, without physically adjusting the network configuration. Since the VLAN has so many advantages, why don't we understand it so that we can apply VLAN technology to our real-world network management. Ok let's take a look at how to configure VLANs on a switch by actually configuring the static VLAN on the Catalyst1900 switch.

After you set up HyperTerminal, connect the 1900 switch, the following main configuration interface 1user (s) nowactiveonmanagementconsole will appear.
Userinterfacemenu
M Menus
K CommandLine
Ipconfiguration
Enterselection:

Let's briefly introduce the three options shown here, [M]menus is the main menu, primarily the initial configuration of the switch and the monitoring of the switch's health. K CommandLine is a command line, much like a router that uses commands to configure and monitor routers, mainly through commands. Ipconfiguration is an option for configuring IP addresses, subnet masks, and default network management. This is the first time to connect to the switch display interface, if you have configured the Ipconfiguration, then the next login will not have this option. Because the command configuration is concise and straightforward, so we use [k]commandline to implement the VLAN configuration.

We select [K]commandline, enter the command line configuration:

ENTERSELECTION:K Carriage return

Clisessionwiththeswitchisopen.

Toendtheclisession,enter[exit].

>

Now we are in the normal user mode of the switch, like a router, which only looks at the current configuration, cannot change the configuration, and has limited commands to use. We enter the Enable and enter privileged mode:

>enable

#configt

Enterconfigurationcommands,oneperline. Endwithcntl/z

(config) #

For the sake of safety and convenience, we give the switch a name and set the login password.

(config) #hostname1900Switch

1900Switch (config) #enablepasswordlevel15goodwork

1900Switch (config) #

Note: The password must be a 4-8-bit character. The switch password settings and routers are slightly different, and the switch uses the level size to determine the password permissions. Level1 is to enter the command line interface password, that is, set the Level1 password, the next time you connect the switch, and enter K, you will enter the password, the password is level1 set the password. And Level15 is the privileged mode password that you entered after you typed the Enable command. Inside the router, use Enablepassword and enablescreet to make this distinction.

Well, we've set the name and the password so it's safe enough for us to set up the VLAN. VLAN settings are divided into the following 2 steps:

Set VLAN name

Apply to Port

Let's set the name of the VLAN first. Use the Vlanvlan number Namevlan name. To configure in privileged configuration mode:

1900Switch (config) #vlan2nameaccounting

1900Switch (config) #vlan3namemarketing

We have a new 2 VLAN, why is the VLAN number starting from 2? This is because, by default, all ports are placed on the VLAN1, so the configuration starts at 2. 1900-Series switches can be configured with up to 1024 VLANs, but only 64 work at the same time, of course, theoretically, we should plan the number of VLANs according to the actual needs of our own network. Once the VLAN name is configured, we have to go to each port to set up the VLAN. In the switch, to enter a port, such as the 4th port, to use INTERFACEETHERNET0/4, OK, combined with the above diagram we let ports 2, 3, 4 and 5 belong to VLAN2, port---22 belong to VLAN3. The command is the Vlan-membershipstatic/dynamicvlan number. Static or dynamic both must be selected, followed by the VLAN number just configured. Okay, let's see the results:

1900Switch (config) #interfaceethernet0/2
1900Switch (config-if) #vlan-membershipstatic2
1900Switch (config-if) #inte0/3
1900Switch (config-if) #vlan-membershipstatic2
1900Switch (config-if) #inte0/4
1900Switch (config-if) #vlan-membershipstatic2
1900Switch (config-if) #inte0/5
1900Switch (config-if) #vlan-membershipstatic2
1900Switch (config-if) #inte0/17
1900Switch (config-if) #vlan-membershipstatic3
............
1900Switch (config-if) #inte0/22
1900Switch (config-if) #vlan-membershipstatic3
1900Switch (config-if) #好的, we have already defined the VLAN on the switch port. Here, we just configure the static, about the dynamic, and we'll have a reference later. So far, we've configured the VLAN for the switch, so it's not as complicated as you think. To verify our configuration, we use the Showvlan command in privileged mode. The output is as follows: 1900Switch (config) #showvlan

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.