{"id":28,"date":"2006-07-20T15:25:00","date_gmt":"2006-07-20T14:25:00","guid":{"rendered":"https:\/\/iddlesblog.wordpress.com\/2006\/07\/20\/useful-ios-commands\/"},"modified":"2006-07-20T15:25:00","modified_gmt":"2006-07-20T14:25:00","slug":"useful-ios-commands","status":"publish","type":"post","link":"https:\/\/iddles.co.uk\/index.php\/2006\/07\/20\/useful-ios-commands\/","title":{"rendered":"Useful IOS commands"},"content":{"rendered":"<p>Shamefully taken from\u00a0 <a href=\"https:\/\/www.eng.uwaterloo.ca\/twiki\/bin\/view\/Engcomp\/CommonCiscoCommands\">https:\/\/www.eng.uwaterloo.ca\/twiki\/bin\/view\/Engcomp\/CommonCiscoCommands<\/a><\/p>\n<h3><a name=\"To_enable_privileged_command_mod\"><\/a>To enable privileged command mode<\/h3>\n<pre>enable<\/pre>\n<hr \/>\n<h3><a name=\"To_enter_switch_configuration_mo\"><\/a>To enter switch configuration mode (from privileged command mode)<\/h3>\n<pre>configure terminal<\/pre>\n<hr \/>\n<h3><a name=\"To_enter_port_configuration_mode\"><\/a>To enter port configuration mode (from switch configuration mode)<\/h3>\n<pre>interface FastEthernet0\/5<\/pre>\n<hr \/>\n<h3><a name=\"To_return_from_one_mode_to_the_p\"><\/a>To return from one mode to the previous mode<\/h3>\n<pre>exit<\/pre>\n<hr \/>\n<h3><a name=\"To_show_the_mac_table\"><\/a>To show the mac table<\/h3>\n<pre>show mac-address-table<\/pre>\n<hr \/>\n<h3><a name=\"To_show_port_information\"><\/a>To show port information<\/h3>\n<pre>show interfaces<\/pre>\n<hr \/>\n<h3><a name=\"To_show_the_switch_version\"><\/a>To show the switch version<\/h3>\n<pre>show version<\/pre>\n<hr \/>\n<h3><a name=\"To_save_the_configuration\"><\/a>To save the configuration<\/h3>\n<pre>write memory<\/pre>\n<hr \/>\n<h3><a name=\"To_show_the_configuration\"><\/a>To show the configuration<\/h3>\n<pre>show running-config<\/pre>\n<hr \/>\n<h3><a name=\"To_set_the_port_description_of_F\"><\/a>To set the port description of FastEthernet0\/5 to &#8220;engmail&#8221;<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\ndescription engmail\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_remove_the_port_description_f\"><\/a>To remove the port description from FastEthernet0\/5<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno description\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_FastEthernet0_5_to_100_fu\"><\/a>To set FastEthernet0\/5 to 100\/full<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nspeed 100\nduplex full\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_FastEthernet0_5_to_auto_a\"><\/a>To set FastEthernet0\/5 to auto\/auto<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nspeed auto\nduplex auto\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_turn_FastEthernet0_5_into_a_d\"><\/a>To turn FastEthernet0\/5 into a dot1q trunk<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno switchport access vlan\nswitchport mode trunk\nswitchport trunk encapsulation dot1q\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_turn_FastEthernet0_5_into_a_n\"><\/a>To turn FastEthernet0\/5 into a non trunk<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno switchport mode trunk\nno switchport trunk encapsulation\nno switchport trunk allowed vlan\nno switchport trunk native vlan\nswitchport mode access\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_the_allowed_vlans_on_trun\"><\/a>To set the allowed vlans on trunk port FastEthernet0\/5 to 20,50,100<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nswitchport trunk allowed vlan 20,50,100\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_remove_the_allowed_vlans_from\"><\/a>To remove the allowed vlans from trunk port FastEthernet0\/5 (will default to all vlans in vlan database)<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno switchport trunk allowed vlan\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_restrict_the_number_of_mac_ad\"><\/a>To restrict the number of mac address on FastEthernet0\/5 to 1<\/h3>\n<p>2900\/3500 series&#8230;<\/p>\n<pre>configure terminal\ninterface FastEthernet0\/5\nport security max-mac-count 1\nexit<\/pre>\n<p>2950\/3550 series&#8230;<\/p>\n<pre>conf term\ninterface FastEthernet0\/5\nswitchport port-security\nswitchport port-security maximum 1\nswitchport port-security violation protect\nswitchport port-security mac-address sticky\nswitchport port-security aging static\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_remove_the_mac_address_restri\"><\/a>To remove the mac address restriction from FastEthernet0\/5<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno port security\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_the_vlan_on_FastEthernet0\"><\/a>To set the vlan on FastEthernet0\/5 to 150<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nswitchport access vlan 150\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_remove_the_vlan_from_FastEthe\"><\/a>To remove the vlan from FastEthernet0\/5 (port will default to vlan 1)<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno switchport access vlan\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_the_native_vlan_untagged\"><\/a><a name=\"To_set_the_native_vlan_untagged_\"><\/a>To set the native vlan (untagged vlan) on trunk FastEthernet0\/5 to 75<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nswitchport trunk native vlan 75\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_remove_the_native_vlan_untagg\"><\/a>To remove the native vlan (untagged vlan) from trunk FastEthernet0\/5<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno switchport trunk native vlan\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_FastEthernet0_5_to_portfa\"><\/a>To set FastEthernet0\/5 to portfast<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nspanning-tree portfast\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_set_FastEthernet0_5_to_not_be\"><\/a>To set FastEthernet0\/5 to not be portfast<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno spanning-tree portfast\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_disable_spanning_tree_on_vlan\"><\/a>To disable spanning tree on vlan 20<\/h3>\n<pre>configure terminal\nno span vlan 20\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_enable_spanning_tree_on_vlan\"><\/a><a name=\"To_enable_spanning_tree_on_vlan_\"><\/a>To enable spanning tree on vlan 20<\/h3>\n<pre>configure terminal\nspan vlan 20\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_disable_port_FastEthernet0_5\"><\/a>To disable port FastEthernet0\/5<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nshutdown\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_enable_port_FastEthernet0_5\"><\/a>To enable port FastEthernet0\/5<\/h3>\n<pre>configure terminal\ninterface FastEthernet0\/5\nno shutdown\nexit<\/pre>\n<hr \/>\n<h3><a name=\"To_get_a_GBIC_port_to_talk_to_a\"><\/a><a name=\"To_get_a_GBIC_port_to_talk_to_a_\"><\/a>To get a GBIC port to talk to a BayStack<\/h3>\n<pre>configure terminal\ninterface GigabitEthernet0\/2\nno negotiation auto\nexit<\/pre>\n<hr \/>\n<h3><a name=\"IOS_upgrade_general_procedure\"><\/a><a name=\"IOS_upgrade_general_procedure_\"><\/a>IOS upgrade (general procedure)<\/h3>\n<p><em>Important. Read the Cisco documentation. This procedure is minimal, and does not install the web management interface. Do not follow these instructions unless you are familliar with the procedure.<\/em><\/p>\n<pre>dir flash:<\/pre>\n<p><em>delete the html directory, and diag file (if any)<\/em><\/p>\n<pre>delete flash:html\/*<\/pre>\n<p><em>rename the existing image to the name of the new image<\/em><\/p>\n<pre>rename flash:c3500XL-c3h2s-mz.120-5.WC2.bin flash:c3500xl-c3h2s-mz.120-5.WC5a.bin\nconf term\nboot system flash:c3500xl-c3h2s-mz.120-5.WC5a.bin\nexit\ncopy tftp:\/\/129.97.x.y\/tmpdata\/c3500xl-c3h2s-mz.120-5.WC5a.bin flash:c3500xl-c3h2s-mz.120-5.WC5a.bin\ncopy flash:c3500xl-c3h2s-mz.120-5.WC5a.bin tftp:\/\/129.97.x.y\/tmpdata\/junk<\/pre>\n<p><em>check the md5 on junk compared to c3500xl-c3h2s-mz.120-5.WC5a.bin before doing the reload<\/em><\/p>\n<pre>write mem\nreload<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/iddles.co.uk\/aggbug.aspx?PostID=2257\" alt=\"\" width=\"1\" height=\"1\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Shamefully taken from\u00a0 https:\/\/www.eng.uwaterloo.ca\/twiki\/bin\/view\/Engcomp\/CommonCiscoCommands To enable privileged command mode enable To enter switch configuration mode (from privileged command mode) configure terminal To enter port configuration mode (from switch configuration mode) interface FastEthernet0\/5 To return from one mode to the previous mode exit To show the mac table show mac-address-table To show port information show interfaces [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[7],"tags":[27],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-networking","tag-cisco-ios","post-preview"],"_links":{"self":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=28"}],"version-history":[{"count":0,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/28\/revisions"}],"wp:attachment":[{"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iddles.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}