Вы находитесь на странице: 1из 5

Switch Commands

How to change switch Vlans?


conf t configure terminal, need to enter this so you can edit a particular port, using the command below. If you don't enter conf t or config t, you won't be able to edit any ports or most switch settings. But you can run the show commands in section 2 this tells the switch to access the configuration area for port 46. Configure multiple ports by typing int range fa0/01-46

int fa0/46

Now you can make changes that will affect port 46, not the other ports e.g. switchport access vlan 10 this will change port 46, which you logged into above, to be on vlan 10 this will enable power to the port, which you need for n IP Phone to work this sets the port to the voice vlan, so the IP Phone can have voice traffic set to it, there are different VLANs depending on which site you're on Shutdown the port, make sure you are in the port config area of the switch e.g. after doing config t then int fa0/46 etc. for port 46 Bring the port back up before writing to memory This saves your settings. You should use this after you make a change e.g. changing a port to a different VLAN. This will overwrite the switch config file with the one running in memory.

pow inline auto

switchport voice vlan 95

shutdown

no shutdown Press Ctrl+Z Wr mem

To show any configuration data about the ports or switches, you have to be in the root menu, so you can hold down Ctrl and press Z and this will take you straight to the root menu. Show vlan list what ports are on what vlan

Show run

Shows the current configuration file running in memory

Any changes you make to a switch will be written to this file, but if the switch reboots (which it shouldnt) and you havent saved it, your changes will be lost because when the switch reboots it loads its saved log file into memory

How to view Port Status


Show int status Shows the status of ports (interfaces) on the switch, what VLAN they are on and whether they have something connected to them

Show run int fa0/46

This searches through the running config and tells you details about a particular port, in this case port 46

Show port-security

This will give you a list of any ports that have security violations on them. If you want to temporarily turn off port security on a port, you can log into the port, using the commands listed at the start. Then type no switchport port-security and this will turn off portsecurity. To turn on port security type switchport port-security Shows all the vlans on the network

Show vlan

How to search for a Mac Addresses on a Switch


Show mac-addr addr 000.000.000 This command searches for the mac address entered. It will display which port the mac address is on (it can also show which switch it is on if it is nearby.

This shows the mac address 0022.049b.098f is connected to port Gi1/0/1 (which means it is on another switch)

Show cdp nei

Shows all the ports which have more than one device connected i.e. phone and PC

This shows which devices are connected to the switch. In this case it refers to another switch.

Show mac-addr int fa0/11

Shows the mac address on the port fa0/11

This shows the mac address connected to the port Fa0/11, there is more than one mac address as there is a phone connected.

Show cdp nei | inc Gi

Shows what is connected to the switch Gig ports (case sensitive) Remember to press Shift+\ keys and not :

Show mac add

Shows all the mac addresses connected to that switch and others

Show mac-add | inc Fa

Shows the mac address for the switch including the ports (case sensitive)

Show mac-add | inc Fa0/11

Shows the mac address on port 11 (case sensitive)

Вам также может понравиться