Sunday, 14 April 2013

Basic Inter-VLAN routing

Router on a stick

Objectives;

  • Cable the network
  • Assign IP addresses to PCs
  • Create VLANs
  • Configure trunks and switchports 
  • Create Sub-interfaces

 

Assign IP addresses to PCs


PC 1 - 192.168.1.1 GW - .254
PC 2 - 192.168.2.1 GW - .254
PC 3 - 192.168.1.2 GW - .254
PC 4 - 192.168.2.2 GW - .254

Create VLANs

The configuration will be the same on both switches

SW1(config)#vlan 2 
SW1(config-vlan)#name LOCAL_USERS 
SW1(config-vlan)#vlan 3 
SW1(config-vlan)#name GUEST_USERS

Configure Access and Trunk ports

The configuration will be the same on both switches, except for the second switch trunk port to the router.

SW1(config)#int fa0/
SW1(config-if)#switchport mode acces
SW1(config-if)#switchport access vlan 2

SW1(config-if)#int fa0/2 
SW1(config-if)#switchport mode access 
SW1(config-if)#switchport access vlan 3

SW1(config-if)#int fa0/24
SW1(config-if)#switchport mode trunk
SW1(config-if)#do wr me
Building configuration...
[OK]

SW2(config-if)#int fa0/23
SW2(config-if)#switchport mode trunk
SW2(config-if)#do wr me
Building configuration...
[OK]

 

Configure Sub-interfaces

Router(config)#int fa0/0.1
Router(config-subif)#encapsulation dot1q 2
Router(config-subif)#ip add 192.168.1.254 255.255.255.0

Router(config-subif)#int fa0/0.2
Router(config-subif)#encapsulation dot1q 3

Router(config-subif)#ip add 192.168.2.254 255.255.255.0

Router(config-subif)#int fa0/0
Router(config-if)#no shut

Router(config-if)#do wr me
Building configuration...
[OK]


Complete


Everything should now be able to ping each other.

No comments:

Post a Comment