VLAN stands for Virtual Local Area Network. It is usually configured on switches to divide a physical LAN into multiple broadcast domains.
For example, all teachers' computers in a school could be assigned to the "Teacher" VLAN, while all students' computers could be assigned to the "Student" VLAN. In this way, VLANs can improve the efficiency and flexibility of a local area network.
We need a device that can do routing to communicate the computers on separate VLANs. Inter-VLAN routing is a process to forward network traffic from one VLAN to another VLAN using a router.
In this lesson, we will demonstrate how to configure VLAN and setup a router to enable the inter-VLAN routing.
We have 3 VLANs: VLAN10, VLAN20 and VLAN30, as shown in figure below.
In this demonstration, Port Fa0/1 of S1 and S2 will be configured as access port and VLAN 10.
Port Fa0/6 of S1 and S2 will be configured as access port and VLAN 20.
Port Fa0/11 of S1 and S2 will be configured as access port and VLAN 30.
hostname R1
interface GigabitEthernet0/0
no shutdown
interface GigabitEthernet0/0.10
encapsulation dot1Q 10
ip address 192.168.10.1 255.255.255.0
interface GigabitEthernet0/0.20
encapsulation dot1Q 20
ip address 192.168.20.1 255.255.255.0
interface GigabitEthernet0/0.30
encapsulation dot1Q 30
ip address 192.168.30.1 255.255.255.0
interface FastEthernet0/1
switchport access vlan 10
switchport mode access
interface FastEthernet0/6
switchport access vlan 20
switchport mode access
interface FastEthernet0/11
switchport access vlan 30
switchport mode access
interface GigabitEthernet0/1
switchport trunk allowed vlan 10,20,30
switchport mode trunk
interface GigabitEthernet0/2
switchport trunk allowed vlan 10,20,30
switchport mode trunk
S2 Configurationinterface FastEthernet0/1
switchport access vlan 10
switchport mode access
interface FastEthernet0/6
switchport access vlan 20
switchport mode access
interface FastEthernet0/11
switchport access vlan 30
switchport mode access
interface GigabitEthernet0/2
switchport trunk allowed vlan 10,20,30
switchport mode trunk
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.