{"id":888,"date":"2008-10-07T21:58:00","date_gmt":"2008-10-07T13:58:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=888"},"modified":"2023-11-07T22:13:40","modified_gmt":"2023-11-07T14:13:40","slug":"ios-device-command","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/888","title":{"rendered":"IOS Device Command"},"content":{"rendered":"\n<p>\u8a2d\u5b9a\u8a2d\u5099\u540d\u7a31<br>(config)#hostname &lt; name&gt;<br>ex:\u8a2d\u5b9a\u6b64\u8a2d\u5099\u70bataiwan<br>(config)hostname taiwan<\/p>\n\n\n\n<p>\u65b0\u589e\u4f7f\u7528\u8005<br>(config)#username &lt; username&gt; password &lt; password&gt; [level &lt; value&gt;]<br>ex:\u8a2d\u5b9a\u4f7f\u7528\u8005raymond\u7684\u5bc6\u70bacisco<br>(config)#username raymond password cisco<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u767b\u5165\u8a0a\u606f<br>(config)#banner motd #&lt; free type&gt;#<br>\u767b\u5165\u8a2d\u5099\u6642\u6703\u770b\u5230\u7684\u8a0a\u606f,\u4e0d\u8ad6\u662ftelnet,console,aux,&#8230;\u7b49\u90fd\u770b\u5f97\u5230<br>\u4e5f\u53ef\u4ee5\u6253\u7b2c\u4e00\u500b#\u5c31\u6309enter<br>ex:<br>(config)#banner motd #<br>Enter TEXT message. End with the character &#8216;#&#8217;.<br>haha<br>#<br>(config)#<br>ps:#\u53ef\u63db\u6210\u5176\u4ed6\u5b57\u5143,\u4f46\u524d\u5f8c\u8981\u76f8\u540c<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u903e\u6642\u767b\u51fa<br>(config-line)#exec-timeout &lt; minute&gt; [sec]<br>\u53ef\u8a2d\u5b9aconsole\u53catelnet\u8d85\u904e\u6642\u9593\u6c92\u8f38\u5165\u6307\u4ee4\u81ea\u52d5\u8df3\u51fa<br>ps:\u5728\u6307\u4ee4\u524d\u52a0no\u6216exec-timeout 0 0\u53ef\u53d6\u6d88\u6b64\u529f\u80fd<br>ex:\u8a2d\u5b9a1\u520610\u79d2\u5f8c\u767b\u51fa<br>(config-line)#Exec-timeout 1 10<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&nbsp;<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u6642\u9593<br><strong>#clock set &lt; time&gt;<br><\/strong><br>\u8a2d\u5b9a\u6642\u5340<br><strong>(config)#clock timezone &lt; zone &gt;<\/strong><br><br>\u8a2d\u5b9a\u65e5\u5149\u7bc0\u7d04\u6642\u9593\u751f\u6548\u8207\u7d50\u675f<br><strong>(config)#clock summer-time &lt; parameter &gt;&nbsp;<\/strong><br><br>\u8a2d\u5b9antp<br><strong>(config)#ntp server &lt; ntp ip&gt; [prefer]<\/strong><br>\u5728\u8a2d\u5b9a\u591a\u500bntpserver\u6642,\u6703\u5148\u4f7f\u7528\u6709prefer\u9078\u9805\u7684ntp<br>ex:10.1.1.2\u7684ntp server\u512a\u5148\u4f7f\u7528&nbsp;<br>(config)#ntp server 10.1.1.1<br>(config)#ntp server 10.1.1.2 prefer<\/p>\n\n\n\n<p>\u986f\u793a\u6642\u9593<br><strong>&gt;show clock<\/strong><\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>\u986f\u793a\u6700\u5f8c\u8f38\u5165\u7684\u524d10\u7b46\u547d\u4ee4<br>&gt;show history<\/p>\n\n\n\n<p>\u8a2d\u5b9a\u6b77\u53f2\u7de9\u885d\u5340\u5927\u5c0f<br>&gt;terminal history size &lt; num&gt;<\/p>\n\n\n\n<p>\u5217\u51fa\u7d42\u7aef\u6a5f\u7d44\u614b<br>&gt;show terminal<br>\u53ef\u78ba\u4efb\u6b77\u53f2\u7de9\u885d\u5340\u5927\u5c0f<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Line 0, Location: &#8220;&#8221;, Type: &#8220;&#8221;<br>Length: 24lines, Width: 80 columns<br>Status: PSI Enabled, Ready, Active, Automore On<br>Capabilities: none<br>Modem state: Ready<br>Group codes: 0<br>Special Chars: Escape Hold Stop Start Disconnect Activation<br>\u3000\u3000\u3000^^x none &#8211; &#8211; none<br>Timeouts: Idle EXEC Idle Session Modem Answer Session Dispatch<br>\u3000\u3000\u300000:10:00 never none not set<br>\u3000\u3000\u3000\u3000\u3000Idle Session Disconnect Warning<br>\u3000\u3000\u3000\u3000\u3000never<br>\u3000\u3000\u3000\u3000\u3000Login-sequence User Response<br>\u3000\u3000\u3000\u3000\u300000:00:30<br>\u3000\u3000\u3000\u3000\u3000Autoselect Intial Wait<br>\u3000\u3000\u3000\u3000\u3000not set<br>Modem type is unknown<br>Session limit is not set<br>Time since activation: 00:01:32<br>Editing is enabled<br>History size is enabled, history size is 10<br>DNS resolution in show commands is enabled<br>Full user help is disabled<br>Allowed input transports are none<br>Allowed output transports are lat pad v120 mop telnet rlogin nasi<br>Preferred transport is lat<br>No output characters are padded<br>No special data dispatching characters<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>\u8a2d\u5b9alog\u7de9\u885d<br><strong>(config)#logging buffered 4096 warnings<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9a\u50c5\u986f\u793a\u8a72\u7b49\u7d1a\u4ee5\u4e0a\u7684log<br><strong>(config)#logging console &lt; level&gt;<\/strong><br>ex:\u986f\u793aemergency,alert,critical,error,warning\u7684log&nbsp;<br>(config)#logging console warnings<\/p>\n\n\n\n<p>level name\u5982\u4e0b,\u7b2c0\u7d1a\u6700\u56b4\u91cd\uff0c\u7b2c7\u7d1a\u6700\u8f15\u5fae<br>0 Emergencies \u7dca\u6025<br>1 Alerts \u8b66\u6212<br>2 Critical \u7dca\u8981<br>3 Errors \u932f\u8aa4<br>4 Warnings \u8b66\u544a<br>5 Notifications \u901a\u77e5<br>6 Informational \u8cc7\u8a0a<br>7 Debugging \u5075\u932f&nbsp;<\/p>\n\n\n\n<p>\u6aa2\u8996log\u7de9\u885d<br><strong>#show logging history<\/strong><br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Syslog History Table:1 maximum table entries,<br>saving level warnings or higher<br>\u30004 messages ignored, 0 dropped, 0 recursion drops<br>\u30007473 table entries flushed<br>\u3000SNMP notifications not enabled<br>\u3000\u3000entry number 7474 : CDP-4-NATIVE_VLAN_MISMATCH<br>\u3000\u3000\u3000Native VLAN mismatch discovered on GigabitEthernet8\/38 (131), with Switch FastEthernet0\/8 (1).<br>\u3000\u3000\u3000timestamp: 44733696<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>\u555f\u52d5syslog<br><strong>(config)#logging on<\/strong><\/p>\n\n\n\n<p>\u50b3\u9001\u8a0a\u606f\u5230syslog\u4f3a\u670d\u5668<br><strong>(config)#logging [hostname|ip address]<\/strong><\/p>\n\n\n\n<p>\u8a2d\u5b9a\u7d00\u9304\u56b4\u91cd\u5c64\u7d1a<br><strong>(config)#logging trap [level name]<\/strong><\/p>\n\n\n\n<p>\u5c07\u6642\u9593\u6233\u4f75\u5165\u8a0a\u606f\u4e2d<br><strong>(config)#service timestamps log datetime<\/strong><\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.<\/p>\n\n\n\n<p>Cisco IFS(IOS File System)<br>\u76f8\u95dc\u547d\u4ee4\u5982\u4e0b<br>#dir \/\/List files on a filesystem<br>#copy \/\/Copy from one file to another<br>#more \/\/Display the contents of a file<br>#show file<br>#delete \/\/Delete a file<br>#erase \/\/Erase a filesystem<br>#format<br>#cd \/\/Change current directory<br>#pwd \/\/Display current working directory<br>#mkdir\/rmdir<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8a2d\u5b9a\u8a2d\u5099\u540d\u7a31(config)#hostname &lt; n &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[32],"tags":[],"class_list":["post-888","post","type-post","status-publish","format-standard","hentry","category-cisco-network"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/888","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=888"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/888\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}