You are on page 1of 6

Faculty of Information Technology

HANOI UNIVERSITY

CNE – Computer Networks


VLAN configuration and subnetting

VLAN configuration
What is VLAN (Virtual Local Area Network)?
A VLAN is a group of devices on one or more LANs that are configured to communicate as if they
were attached to the same wire, when in fact they are located on a number of different LAN
segments. Because VLANs are based on logical instead of physical connections, they are extremely
flexible.

How to do it?
When you have only one switch and you want to make more than one local area network, you can
share this switch.

Some commands on switch:

Create VLAN:
vlan 10
name FIT
where 10 is the VLAN number; FIT is the VLAN name

Delete a VLAN:
no vlan 10 name FIT

Show VLANs information:


show vlan

Assign Ports for VLAN:


interface fa0/2
switchport access vlan 10
where 10 is the VLAN number, fa0/2 is the port in the switch connecting to the computer which
belongs to VLAN 10.

Set Trunk mode:


interface fa0/1
switchport mode trunk
where fa0/1 is the switch port which connects to the router.

Some commands on router:

Configure IP (in Router):


interface fa0/1.10
encapsulation dot1Q 10
ip address 192.168.1.4 255.255.255.252
where 10 is the number of VLAN; dot1Q is the encapsulation type and 10 is the VLAN number.
Practice
Make 3 networks (2 VLANs (one having 14 hosts (network A) and one having 6 hosts (network B))
and 1 LAN (having 20 hosts(network C)) connect to together by 2 routers. Given IP block is
130.10.5.128/25. Please subnet for 3 networks.

Solution:
Given block : 130.10.5.128/25 includes 27= 128 Ips, from 130.10.5.128/25 - 130.10.5.255/25
Network A: 130.10.5.128/27 (from 130.10.5.128/27 - 130.10.5.159/27)
Network B: 130.10.5.160/28 (from 130.10.5.160/28 - 130.10.5.175/28)
Network C: 130.10.5.176/29 (from 130.10.5.176/29 - 130.10.5.183/29)
Network Router 0 – Router 1: 130.10.5.184/30 (from 130.10.5.184/29 - 130.10.5.187/30)

You might also like