Static VLANs
VLANs Creation
Switch> enable
Switch# configure terminal
Switch(config)# vlan 10
Switch(config-vlan)# name ENGINEER
Switch(config-vlan)# exit
Switch(config)# //similarly to vlan 20 &30
Static VLANs (port-centric)
Switch(config)# interface range f0/2-9
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# exit
Switch(config)# //similarly to vlan 20 & 30
Trunking Configuration
Switch(config)# interface f0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# end //or Ctrl – Z
Switch# write memory
Switch# show vlan
Inter VLAN Routing
Router(config)# interface f0/0
Router(config-if)# no shutdown
Router(config-if)# interface f0/0.10
Router(config-subif)# encapsulation dot1q 10
Router(config-subif)# ip address 192.168.10.1 255.255.255.0
Router(config-subif)# interface f0/0.20
Router(config-subif)# encapsulation dot1q 20
Router(config-subif)# ip address 192.168.20.1 255.255.255.0
//similarly to F0/0.30
DHCP Configuration
Router(config)# ip dhcp pool YUI_HATANO_FOR_VLAN_10
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
dns-server 8.8.8.8
exit
//similarly to DHCP for VLAN 20 & 30
Dynamic VLANs
Dynamic VLANs
Creating VLANs and Enabling VTP Server Configuring VTP Client
Server(config)# vlan 10 Client(config)# vtp mode client
Server(config-vlan)# name MARS Client(config)# vtp domain planet
Server(config-vlan)# exit Client(config)# vtp password solar
Server(config)# vlan 20 Client(config)# interface range f0/3-24
Server(config-vlan)# name VENUS Client(config-if-range)# switchport access
Server(config-vlan)# exit vlan 20
Server(config)# vtp mode server
Server(config)# vtp domain planet
Server(config)# vtp password solar
Server(config)# interface range f0/3-24
Server(config-if-range)# switchport access
vlan 10
VLAN Database transferred via Trunking
Server(config)#interface range f0/1-2 Client(config)#interface range f0/1-2
Server(config-if)# switchport mode trunk Client(config-if)# switchport mode trunk
VLAN Subnetting
6969 <= 2^(32 – 16 – n) – 2 2^(16 – n) >= 6971
Let 2^(16 – n) = 8192 IPs = 2^13 > 6971 n = 3 /16 (+n) /19
SM: 255.255.224.0 & S = 2^n = 8 (subnets)
Sub 0: 172.16.0.0 172.16.31.255/19 VLAN 10
Hosts/vlan 10: 172.16.0.1 172.16.31.254/19
DG: 172.16.0.1/19 (Router F0/0.10) & Remaining for hosts: 172.16.0.2
Sub 1: 172.16.32.0 172.16.63.255/19 VLAN 20
Router F0/0.20 (DG): 172.16.32.1/19 & Remaining for hosts: 172.16.32.2
How to check dynamic VLANs
configuration?
Server# show vlan //right if displays vlan 10 and 20
//vlan 10 accessing f0/3 – 24
Server# show vtp status //right if vtp mode is server
Client# show vlan //right if displays vlan 10 and 20
//vlan 20 accessing f0/3 – 24
Client# show vtp status //right if vtp mode is client
* Assign static IPs to PCs in each vlan then ping them
//right if successfully