Sunday, August 16, 2026

Inter VLAN configuration

 



PC configuration

PC0 

IP address: 192.168.10.1

subnet mask: 255.255.255.0

Default gateway: 192.168.10.254

PC1

IP address: 192.168.10.2

subnet mask: 255.255.255.0

Default gateway: 192.168.10.254

PC2

IP address: 192.168.20.1

subnet mask: 255.255.255.0

Default gateway: 192.168.20.254

PC3

IP address: 192.168.20.2

subnet mask: 255.255.255.0

Default gateway: 192.168.20.254

PC4

IP address: 192.168.30.1

subnet mask: 255.255.255.0

Default gateway: 192.168.30.254

PC5

IP address: 192.168.30.2

subnet mask: 255.255.255.0

Default gateway: 192.168.30.254

Switch configuration

Create 3 Vlans. 

Vlan 10(interface range fa0/1-5)

Switch(config)#interface range fastEthernet 0/1-5

Switch(config-if-range)#switchport mode access 

Switch(config-if-range)#switchport access vlan 10

wr

Vlan 20(interface range fa0/6-10) 

Switch(config)#interface range fastEthernet 0/6-10

Switch(config-if-range)#switchport mode access 

Switch(config-if-range)#switchport access vlan 20

wr

Vlan30(interface range fa0/11-15).

Switch(config)#interface range fastEthernet 0/10-15

Switch(config-if-range)#switchport mode access 

Switch(config-if-range)#switchport access vlan 30

wr


Switch#show vlan brief


VLAN Name Status Ports

---- -------------------------------- --------- -------------------------------

1 default active Fa0/16, Fa0/17, Fa0/18, Fa0/19

Fa0/20, Fa0/21, Fa0/22, Fa0/23

Gig0/1, Gig0/2

10 VLAN0010 active Fa0/1, Fa0/2, Fa0/3, Fa0/4

Fa0/5

20 VLAN0020 active Fa0/6, Fa0/7, Fa0/8, Fa0/9

Fa0/10

30 VLAN0030 active Fa0/11, Fa0/12, Fa0/13, Fa0/14

Fa0/15

 Trunk port configuation on switch

Switch(config)#interface fastEthernet 0/24

Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk allowed vlan all

Switch(config-if)#Switch(config-if)#switchport mode trunk

Switch#wr

Router configuration


R1(config)#interface gigabitEthernet 0/0

R1(config-if)#no ip ad

R1(config-if)#no ip address

R1(config-if)#no shu

R1(config-if)#no shutdown 

wr


R1(config)#interface gigabitEthernet 0/0.10

R1(config-subif)#encapsulation dot1Q 10

R1(config-subif)#ip address 192.168.10.254 255.255.255.0

R1(config-subif)#no shutdown

wr


R1(config)#interface gigabitEthernet 0/0.20

R1(config-subif)#encapsulation dot1Q 20

R1(config-subif)#ip address 192.168.20.254 255.255.255.0

R1(config-subif)#no shutdown

wr


R1(config)#interface gigabitEthernet 0/0.30

R1(config-subif)#encapsulation dot1Q 30

R1(config-subif)#ip address 192.168.30.254 255.255.255.0

R1(config-subif)#no shutdown

wr


Ping TEST 


PC0-PC2


Ping 192.168.20.1


C:\>ping 192.168.20.1


Pinging 192.168.20.1 with 32 bytes of data:


Request timed out.

Reply from 192.168.20.1: bytes=32 time<1ms TTL=127

Reply from 192.168.20.1: bytes=32 time<1ms TTL=127

Reply from 192.168.20.1: bytes=32 time=1ms TTL=127


Ping statistics for 192.168.20.1:

Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms


PC0-PC4


C:\>ping 192.168.30.1


Pinging 192.168.30.1 with 32 bytes of data:


Request timed out.

Reply from 192.168.30.1: bytes=32 time<1ms TTL=127

Reply from 192.168.30.1: bytes=32 time<1ms TTL=127

Reply from 192.168.30.1: bytes=32 time=1ms TTL=127


Ping statistics for 192.168.30.1:

Packets: Sent = 4, Received = 3, Lost = 1 (25% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms


Now we are able to ping between Vlan 10, Vlan 20 and Vlan 30 IPs.

No comments:

Post a Comment

Inter VLAN configuration