You are on page 1of 5

Created By Pawan Hulyalkar version 0.

How to Configure a Cisco Switch for Netlabs use

Note: The number of ports assigned to different VLANs can be changed.


This Document uses an example for configuring the first 8 ports to VLAN 427 and the rest 16 ports to
VLAN 2.

As seen in the configuration below, the line “switchport access vlan 2” configures a particular port to
VLAN2. Hence each individual interface can be assigned a different VLAN if required.

-------------------------------------------------------------------------------------------------------------

The configuration for a cisco switch to be configured from scratch is given below.

The device nvram must be erased before configuring the below.

To erase the nvram,


a. type the command “erase nvram:” at the console
b. Reload the device using “reload”
Once the switch boots up (and the “switch>” prompt is seen), the configuration below must be entered
in the same order as given below. Before the config can be entered, determine the below mentioned
information and replace the tags accordingly in the documents
1. Determine the type of interfaces on the Switch – Fast Ethernet or Gigabit Ethernet. The
following configs assume the interfaces are Gigabit Ethernet. For Fast Ethernet interfaces,
replace “int gi” with “int fa” .
2. Get the IP Addresses and subnets to be assigned to the vlans and replace accordingly in the
configuration below
3. Modify the hostname according to the convention: gnl-427-83-242 . gnl stands for Graduate
netlabs, 427 for the vlan number, 83 the subnet and 242 the last byte of the IP address.

Note: lines starting with an exclamation mark are comments.

!!!Start of configs
conf t
hostname gnl-427-83-242
line con 0
login
password(see password information file)
exit
Created By Pawan Hulyalkar version 0.1

enable secret B1wn2Rc3D4n!


exit
clock set 13:20:00 21 Jan 2008
conf t
int vlan1
ip address 152.14.83.242 255.255.255.0
exit
exit
vlan database
vlan 2 name private
exit

!!!! Configure the interfaces to VLAN 2


conf t
int gi0/9
switchport access vlan 2
int gi0/10
switchport access vlan 2
int gi0/11
switchport access vlan 2
int gi0/12
switchport access vlan 2
int gi0/13
switchport access vlan 2
int gi0/14
switchport access vlan 2
int gi0/15
switchport access vlan 2
int gi0/16
switchport access vlan 2
int gi0/17
switchport access vlan 2
int gi0/18
switchport access vlan 2
int gi0/19
switchport access vlan 2
int gi0/20
switchport access vlan 2
int gi0/21
switchport access vlan 2
int gi0/22
switchport access vlan 2
Created By Pawan Hulyalkar version 0.1

int gi0/23
switchport access vlan 2
int gi0/24
switchport access vlan 2
end

vlan database
vlan 427
vlan 427 state active
vlan 427 name public
exit

conf t
int vlan1
no ip address
end
conf t
int vlan427
ip address 152.14.83.242 255.255.255.0
no shut
end

!!!! Configure the interfaces to VLAN 427


conf t
int gi0/1
switchport access vlan 427
int gi0/2
switchport access vlan 427
int gi0/3
switchport access vlan 427
int gi0/4
switchport access vlan 427
int gi0/5
switchport access vlan 427
int gi0/6
switchport access vlan 427
int gi0/7
switchport access vlan 427
int gi0/8
switchport access vlan 427

end
Created By Pawan Hulyalkar version 0.1

!! Configure the STP - spanning tree protocol


conf t
spanning-tree mode pvst
spanning-tree vlan 427 prio 40960
service timestamps debug datetime localtime show-timezone
service timestamps log datetime msec localtime show-timezone
!!! Miscellaneous required config
ip default-gateway 152.14.83.1

ip name-server 152.1.1.206
ip name-server 152.1.1.208

clock timezone Eastern -5


clock summer-time EDT recurring

vtp mode transparent

ntp server 152.1.226.105 prefer

int vlan1
shut
int vlan427
no shut

int gi0/1
switchport mode access
int gi0/2
switchport mode access
int gi0/3
switchport mode access
int gi0/4
switchport mode access
int gi0/5
switchport mode access
int gi0/6
switchport mode access
int gi0/7
switchport mode access
int gi0/8
switchport mode access
Created By Pawan Hulyalkar version 0.1

end

!!configure vtp
vlan database
vtp transparent
vtp domain netlabs.ncsu.edu
exit

!!! Write configuration to memory (save)


wr