Switch – Configure VLANs and Trunk

Switch – VLAN names:

Switch>en

Switch#conf t

Switch(config)#vlan 10

Switch(config-vlan)#name students

Switch(config-vlan)#vlan 20

Switch(config-vlan)#name faculty

Switch(config-vlan)#vlan 30

Switch(config-vlan)#name administration

Switch(config-vlan)#vlan 55

Switch(config-vlan)#name native

Switch(config-vlan)#vlan 77

Switch(config-vlan)#name mgt

Switch(config-vlan)#

Switch#show vlan

Default Gateway:

Switch#conf t

Switch(config)#int vlan 77

Switch(config-if)#ip address 192.168.77.2 255.255.255.0

Switch(config-if)#

Switch#conf t

Switch(config)#ip default-gateway 192.168.77.1

Switch(config)#

Configure VLAN:

Switch#conf t

Switch(config)#int fa0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk allowed vlan 1,10,30,40,50,77

Switch(config-if)#switchport trunk native vlan 55

Switch(config-if)#int fa0/2

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 10

Switch(config-if)#int fa0/3

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 20

Switch(config-if)#int fa0/4

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 30

Switch(config-if)#int fa0/5

Switch(config-if)#switchport mode access

Switch(config-if)#switchport access vlan 77

Switch(config-if)#

Switchport Trunk Allowed Vlan:

Switch#conf t

Switch(config)#int fa0/1

Switch(config-if)#switchport mode trunk

Switch(config-if)#switchport trunk allowed vlan 1,10,30,40,55,77

Switch(config-if)#switchport trunk native vlan 55

Switch(config-if)#

Router – Configure Sub-interfaces and Encapsulation

Router

  1. Configure sub-interfaces
  2. Encapsulation dot1q
  3. Native VLAN (192.168.55.1)

 

Sub-interfaces:

Fa0/0.10 – 192.168.10.1

Fa0/0.20 – 192.168.20.1

Fa0/0.30 – 192.168.30.1

Fa0/0.55 – 192.168.55.1

Fa0/0.77 – 192.168.77.1

 

Configure Sub-interfaces

Router#conf t

Router(config)#int fa0/0

Router(config-if)#no shut

Router(config-if)#int fa0/0.10

Router(config-subif)#encapsulation dot1q 10

Router(config-subif)#ip address 192.168.10.1 255.255.255.0

Router(config-subif)#int fa0/0.20

Router(config-subif)#encapsulation dot1q 20

Router(config-subif)#ip address 192.168.20.1 255.255.255.0

Router(config-subif)#int fa0/0.30

Router(config-subif)#encapsulation dot1q 30

Router(config-subif)#ip address 192.168.30.1 255.255.255.0

Router(config-subif)#int fa0/0.55

Router(config-subif)#encapsulation dot1q 55 native

Router(config-subif)#ip address 192.168.55.1 255.255.255.0

Router(config-subif)#

Router(config-subif)#int fa0/0.77

Router(config-subif)#encapsulation dot1q 77

Router(config-subif)#ip address 192.168.77.1 255.255.255.0

Router#sho ip route

Codes: C – connected, S – static, I – IGRP, R – RIP, M – mobile, B – BGP

D – EIGRP, EX – EIGRP external, O – OSPF, IA – OSPF inter area

N1 – OSPF NSSA external type 1, N2 – OSPF NSSA external type 2

E1 – OSPF external type 1, E2 – OSPF external type 2, E – EGP

i – IS-IS, L1 – IS-IS level-1, L2 – IS-IS level-2, ia – IS-IS inter area

* – candidate default, U – per-user static route, o – ODR

P – periodic downloaded static route

 

Gateway of last resort is not set

 

C    192.168.10.0/24 is directly connected, FastEthernet0/0.10

C    192.168.20.0/24 is directly connected, FastEthernet0/0.20

C    192.168.30.0/24 is directly connected, FastEthernet0/0.30

C    192.168.55.0/24 is directly connected, FastEthernet0/0.55

C    192.168.77.0/24 is directly connected, FastEthernet0/0.77

Router#