Pages

Jul 21, 2010

Configure vlan on catalyst 2960G switch


Displaying VLAN List.

Below is an example to display list of vlan and its associated port(s):

User Access Verification

Username: admin
Password:

SW03>enable
Password:
SW03#show vlan brief

VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
1 default active Gi0/22
2 DMZ active Gi0/15
3 Proxy active
4 Secured active Gi0/9
5 Calr active
6 Proc active
7 Test active
8 Center active
9 Apps
10 Users active
11 Backup active
12 VLAN0012 active
13 VLAN0013 active Gi0/7, Gi0/8, Gi0/10, Gi0/11
Gi0/12, Gi0/13, Gi0/14, Gi0/16
Gi0/17, Gi0/18
14 ipphone active
15 team active
100 TM_IPVPN active
110 TM active
999 Management active Gi0/1, Gi0/2, Gi0/3, Gi0/4
--More--
VLAN Name Status Ports
---- -------------------------------- --------- -------------------------------
Gi0/5, Gi0/6, Gi0/19, Gi0/20
Gi0/21
1002 fddi-default act/unsup
1003 trcrf-default act/unsup
1004 fddinet-default act/unsup
1005 trbrf-default act/unsup

Creating VLAN.

In order to create vlan, first note the the number of existing vlan. Vlan numbering must be unique. Example below describe the steps of creating a vlan 10 named security.

Switch>enable
Switch#config terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#vlan 10
Switch(config-vlan)#name security
Switch(config-vlan)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

Use show running-config command to verify that the vlan is successfully created.
Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

Associating port with VLAN.

To add port to vlan, there are two ways to do it. First, adding port one by one and second by adding using port range. The first method is useful to add a single port or to add ports that are not adjacent to each other (range cannot be used). The second one is for adding ports that are sequentially numbered eg: port 20 to 35. The example procedure for both methods are listed below. These procedure can also be used to reallocate port(s) between vlan.
a) Adding a single port

Switch#conf term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fa0/1
Switch(config-if)#switchport access vlan 10
Switch(config-if)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION

%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
Switch(config-if)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

b) Adding a range of port

Switch#conf term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fa0/20 – fa0/35
Switch(config-if-range)#switchport access vlan 10
Switch(config-if-range)#spanning-tree portfast
%Warning: portfast should only be enabled on ports connected to a single
host. Connecting hubs, concentrators, switches, bridges, etc... to this
interface when portfast is enabled, can cause temporary bridging loops.
Use with CAUTION

%Portfast has been configured on FastEthernet0/1 but will only
have effect when the interface is in a non-trunking mode.
Switch(config-if-range)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will perform the operation and display OK, before returning to the prompt.

Unassociate port(s) from vlan.

You need to unassociate port(s) from vlan before deleting the vlan. To do this, below are the examples.
a)Unassociate a port

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface fa0/1
Switch(config-if)#no switchport access vlan 10
Switch(config-if)#no spanning-tree portfast
Switch(config-if)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

b) Unassociate a range of port

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#interface range fa0/20 – fa0/35
Switch(config-if-range)#no switchport access vlan 10
Switch(config-if-range)#no spanning-tree portfast
Switch(config-if-range)#exit
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console

When you unassociate a port from its vlan, it will return back to its original vlan which is vlan 1. Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

Deleting a vlan.

procedure listed below is example to delete a vlan.

Switch#config term
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#no vlan 10
Switch(config)#exit

%SYS-5-CONFIG_I: Configured from console by console
Switch#exit
Save your configuration by using: copy running-config startup-config > enter. Press enter again to accept default destination filename (startup-config). The switch will performed the operation and display OK, before returning to the prompt.

INSTALLING IOS INTO THE CATALYST 2960G SWITCH

To install ios from TFTP server, the switch have to be connected to a TFTP server that has the Cisco IOS image for the switch.
Follow these steps to upgrade the device IOS image:

Verify the Current Cisco IOS Image

Step 1 Use the show version command to verify the image currently loaded in RAM.
switch#show version
Step 2 Use the show flash command to verify any images currently available in flash.
switch#show flash

Configure Access to the TFTP Server

Switch needs to establish a connection to a TFTP server that has the Cisco IOS image you need.

Step 1 Connect the Fa0/1 interface on switch to the TFTP server (or any unused interface).
Step 2 Configure the switch with IP address 192.168.20.1/24.
Step 3 Configure the TFTP server with IP address 192.168.20.254/24 and a default gateway.
Step 4 Test connectivity.

The switch should be able to successfully ping the TFTP server. If not, check your cabling and addressing.

Upload a New Cisco IOS Image

Step 1 Check the TFTP server for Cisco IOS images.
Check the TFTP server for the IOS image you needed, for example you will upload the c1841-ipbasek9-mz.124-12.bin image to switch. Below is the example of the command output. (For explaining the steps, these steps use c1841-ipbasek9-mz.124-12.bin ios image file for examle).

Step 2 Upload the c1841-ipbasek9-mz.124-12.bin image to the switch.
• On switch, begin the upload process with the copy tftp flash command.
• Enter the IP address for TFTP Server.
• Enter the entire filename of the Cisco IOS image.
switch#copy tftp flash

Address or name of remote host []? 192.168.20.254
Source filename []? c1841-ipbasek9-mz.124-12.bin
Destination filename [c1841-ipbasek9-mz.124-12.bin]? Enter
Accessing tftp://192.168.20.254/c1841-ipbasek9-mz.124-12.bin...
Loading c1841-ipbasek9-mz.124-12.bin from 192.168.20.254: !!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[OK - 16599160 bytes]

16599160 bytes copied in 13.047 secs (284682 bytes/sec)

Step 3 Verify that the new image is now in flash.
switch#show flash

Configure the boot system Command

By default, the switch bootup sequence loads the first Cisco IOS image listed in flash. One way to make sure that the router loads the new image is to configure the boot system flash command. On switch, enter the following command:

switch(config)#boot system flash c1841-ipbasek9-mz.124-12.bin

This command is now part of the running configuration. However, the running configuration must also be saved to NVRAM; otherwise, the configuration is overwritten the next time you reload the router.

switch(config)#end
switch#copy running-config startup-config

Test the New Image

Reload the switch and wait for it to reboot. When the switch reloads, verify that the new image is in RAM with the show version command.
switch#reload
Proceed with reload? [confirm][Enter]

switch#show version

Jul 6, 2010

reset port interface of switch


Steps for reset the interface Gix/x of switch.
1.       Telnet into switch using putty or cmd.
2.       Enter username and password
3.       Then type enable and enter
4.       Insert password If prompt again
5.       Type show interface gigabitethernet x/x and enter
6.       Check for the first line of the above command output, the statement line protocol . If its stated the line protocol is down, go to the next step. If the line protocol is up, you may exit the telnet by enter command exit .
7.       Type config terminal and enter
8.       Type interface gigabitethernet x/x and enter
9.       Type shutdown and enter
10.   Then type exit
11.   Enter the interface again by typing  interface gigabitethernet x/x
12.   Then type no shutdown
13.   Exit the interface.
14.   To verify that the port is reset and up, Exit the config and type show interface gigabitethernet x/x and check for the line protocol, if you follow this steps the line protocol should be up.

unix based: simple network command

These are simple network command when handling with unix based os:

1. ifconfig -a 

this command is simmilar to ipconfig in windows. It will shows the details of the interfaces exist on the machine, the ip address,netmask,gateway etc.

2. ifconfig eth0 up

to enable/disable certain interface , use this command. above command will enable eth0 interface. To disable it just enter command ifconfig eth0 down.

3. sudo ifconfig eth0 192.168.117.55 netmask 255.0.0.0

above is an example to assign ip address to interface eth0 with ip address 192.168.117.55 and it netmask 255.0.0.0.

4. ifconfig eth0

to show details of only certain interface, use this command. in this example only details of eth0 will be shown.

5. sudo route add default gateway 192.168.18.2

add a default gateway for the machine.

6. sudo nano /etc/resolv.conf

to add the dns, use this command to edit the ip address of the dns using nano text editor.

7. sudo apt-get update

this command use to update the local apt cache

8. sudo apt-cache

search for update package

9. sudo apt-get install {package name}

to install the package

10. sudo /etc /init.d /networking {start/stop/restart}

to start stop or restart the network

11. sudo nano /etc /network /interfaces

alternatively you can edit the network details using nano by using this command.

Jul 2, 2010

Setting bandwidth on switches port

Certain ports that assign to specific vlan that you want to control the bandwidth can be configure using below command: (Note: setting bandwidth can only be configure on layer 3 switches)

switch(config)#int gigabitethernet 0/5
switch(config-if)#bandwidth 10000
switch(config-if)#exit
switch(config)#exit
switch#sh int gigabitethernet 0/5


when show run you can verify the bandwidth that have been configured ( BW 100000Kbit).  The range of the bandwidth that can be configure is between <1-10000000> , Bandwidth in kilobits.
Related Posts with Thumbnails