Port-based VLAN Configuration Guide

Source: Internet
Author: User

VLANThe typical configuration process is as follows:

Networking Diagram

Figure 1-1 port-based VLAN networking

Application Requirements

As shown in Figure 1-1, Switch A and Switch B connect Host1/Host2 and Server1/Server2 used by different departments.

To ensure data isolation between departments, you must divide Host1 and Server1 into VLAN100 and Host2 into VLAN200. Set the description characters for the two VLANs to "Dept1" and "Dept2" respectively ".

Configure the VLAN Interface on SwitchA to forward data sent from Host1 to server2.

Applicable products and versions

Table 1-1 configure the relationship between applicable products and software and hardware versions

Configuration process and Explanation

Configure Switch

 
 
  1. # Create a VLAN100 and configure the VLAN100 description string as "Dept1". Add the port GigabitEthernet1/0/1 to the VLAN100.
  2.  
  3. <SwitchA> system-view
  4.  
  5. [SwitchA] vlan 100
  6.  
  7. [SwitchA-vlan100] description Dept1
  8.  
  9. [SwitchA-vlan100] port GigabitEthernet 1/0/1
  10.  
  11. [SwitchA-vlan100] quit
  12.  
  13. # Create a VLAN200 and configure the VLAN200 description string as "Dept2 ".
  14.  
  15. [SwitchA] vlan 200
  16.  
  17. [SwitchA-vlan200] description Dept2
  18.  
  19. [SwitchA-vlan200] quit
  20.  
  21. # Create VLAN100 and VLAN200 interfaces. The IP addresses are configured as 192.168.1.1 and 192.168.2.1 respectively to forward packets sent from Host1 to server2.
  22.  
  23. [SwitchA] interface Vlan-interface 100
  24.  
  25. [SwitchA-Vlan-interface100] ip address 192.168.1.1 24
  26.  
  27. [SwitchA-Vlan-interface100] quit
  28.  
  29. [SwitchA] interface Vlan-interface 200
  30.  
  31. [SwitchA-Vlan-interface200] ip address 192.168.2.1 24

Configure Switch B

 
 
  1. # Create a VLAN100 and configure the VLAN100 description string as "Dept1". Add the port GigabitEthernet1/0/13 to the VLAN100.
  2.  
  3. <SwitchB> system-view
  4.  
  5. [SwitchB] vlan 100
  6.  
  7. [SwitchB-vlan100] description Dept1
  8.  
  9. [SwitchB-vlan100] port GigabitEthernet 1/0/13
  10.  
  11. [SwitchB-vlan100] quit
  12.  
  13. # Create a VLAN200 and configure the VLAN200 description string as "Dept2". Add the ports GigabitEthernet1/0/11 and GigabitEthernet1/0/12 to the VLAN200.
  14.  
  15. [SwitchB] vlan 200
  16.  
  17. [SwitchB-vlan200] description Dept2
  18.  
  19. [SwotchB-vlan200] port GigabitEthernet1/0/11 GigabitEthernet 1/0/12
  20.  
  21. [SwitchB-vlan200] quit

Configure the link between Switch A and Switch B

Because the links between Switch A and Switch B need to transmit data from both VLAN100 and VLAN200 at the same time, you can configure the ports at both ends as the Trunk port and allow packets from the two VLANs to pass through.

 
 
  1. # Configure the GigabitEthernet1/0/2 port of Switch.
  2.  
  3. [SwitchA] interface GigabitEthernet 1/0/2
  4.  
  5. [SwitchA-GigabitEthernet1/0/2] port link-type trunk
  6.  
  7. [SwitchA-GigabitEthernet1/0/2] port trunk permit vlan 100 200
  8.  
  9. # Configure the GigabitEthernet1/0/10 port of Switch B.
  10.  
  11. [SwitchB] interface GigabitEthernet 1/0/10
  12.  
  13. [SwitchB-GigabitEthernet1/0/10] port link-type trunk
  14.  
  15. [SwitchB-GigabitEthernet1/0/10] port trunk permit vlan 100 200

Complete Configuration

Configurations on SwitchA

 
 
  1. #  
  2. vlan 100  
  3. description dept1  
  4. #  
  5. vlan 200  
  6. description dept2  
  7. #  
  8. interface Vlan-interface 100  
  9. ip address 192.168.1.1 255.255.255.0  
  10. #  
  11. interface Vlan-interface 200  
  12. ip address 192.168.2.1 255.255.255.0  
  13. #  
  14. interface GigabitEthernet1/0/1  
  15. port access vlan 100  
  16. #  
  17. interface GigabitEthernet1/0/2  
  18. port link-type trunk  
  19. port trunk permit vlan 1 100 200 

Configurations on SwitchB

 
 
  1. #  
  2. vlan 100  
  3. description dept1  
  4. #  
  5. vlan 200  
  6. description dept2  
  7. #  
  8. interface GigabitEthernet1/0/10  
  9. port link-type trunk  
  10. port trunk permit vlan 1 100 200  
  11. #  
  12. interface GigabitEthernet1/0/11  
  13. port access vlan 100  
  14. #  
  15. interface GigabitEthernet1/0/12  
  16. port access vlan 200  
  17. #  
  18. interface GigabitEthernet1/0/13  
  19. port access vlan 100 

The typical VLAN configuration process is over here. I hope you have mastered it. We will continue to introduce you to relevant knowledge in future articles.

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.