Skip to content

Instantly share code, notes, and snippets.

@molcay
Last active November 13, 2016 22:22
Show Gist options
  • Save molcay/d9aba72e8896981bd017b3c47838e884 to your computer and use it in GitHub Desktop.
Save molcay/d9aba72e8896981bd017b3c47838e884 to your computer and use it in GitHub Desktop.
CENG 4541 Advanced Computer Network Course Assignment 4 Codes
  • Topology drawn
  • Subnetting

to set up VTP Server and Clients

  • In SW2 (vtp server):

     enable
     conf t
     vtp mode server
     vtp domain netseclab.local
     vtp password netseclab
    
  • In other switches (SW1, SW3)

     enable
     conf t
     vtp mode client
     vtp domain netseclab.local
     vtp password netseclab
    

Create all VLANs in only SW2.

It serves the information to its clients.

  • In SW2 (vtp server):
     enable
     conf t
     vlan 1
     exit
     vlan 10
     exit
     vlan 20
     exit
     vlan 30
     exit
    
  • to check creation of the VLANs (in privilege_exec or exec mode):
     show vlan
    

Trunk Configuration:

Every ports in switches' switchport mode must be trunk

  • in SW2:

     enable
     conf t
     int fastEthernet 0/24
     switchport mode trunk
     switchport access vlan 1
     exit
     int fastEthernet 0/23
     switchport mode trunk
     switchport access vlan 1
     exit
     int gigabitEthernet 0/1
     switchport mode trunk
     switchport access vlan 1
     exit
    
  • in SW1, SW3::

     enable
     conf t
     int fastEthernet 0/24
     switchport mode trunk
     switchport access vlan 1
     exit
    

Supply Access for the end devices to ports of the Switches

  • in SW1:

     enable
     conf t
     int fastEthernet 0/1
     switchport access vlan 10
     exit
     int fastEthernet 0/2
     switchport access vlan 20
     exit
     int fastEthernet 0/3
     switchport access vlan 30
     exit
    
  • in SW2:

     enable
     conf t
     int fastEthernet 0/1
     switchport access vlan 30
     exit
     int fastEthernet 0/2
     switchport access vlan 20
     exit
    
  • in SW3:

     enable
     conf t
     int fastEthernet 0/1
     switchport access vlan 10
     exit
    
  • In GATEWAY(Router)

     enable
     conf t
     int gigabitEthernet 0/0
     no ip address
     no shut
     exit
     int gigabitEthernet 0/0.1
     encapsulation dot1Q 1
     ip address 192.168.2.193 255.255.255.192
     no shut
     exit
     int gigabitEthernet 0/0.10
     encapsulation dot1Q 10
     ip address 192.168.2.1 255.255.255.192
     no shut
     exit
     int gigabitEthernet 0/0.20
     encapsulation dot1Q 20
     ip address 192.168.2.65 255.255.255.192
     no shut
     exit
     int gigabitEthernet 0/0.30
     encapsulation dot1Q 30
     ip address 192.168.2.129 255.255.255.192
     no shut
     exit
    

Security (ssh connection, encrypted passwords, enable secret etc.)

  • in SW1, SW2, SW3, GATEWAY:

     enable
     conf t
     ip domain name netseclab
     crypto key generate rsa
     1024
     line vty 0 15
     password netseclab
     transport input ssh
     login
     exit
     ip ssh version 2
     exit
     conf t
     line console 0
     password netseclab
     login
     exit
     enable password netseclab
     enable secret netsec
     service password-encryption 
    
  • !!! in SW1, SW2, SW3, GATEWAY (to save for all switches & routers' changes) !!!

     enable
     copy running-config startup-config
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment