神州數(shù)碼路由器及交換機配置命令.doc_第1頁
神州數(shù)碼路由器及交換機配置命令.doc_第2頁
神州數(shù)碼路由器及交換機配置命令.doc_第3頁
神州數(shù)碼路由器及交換機配置命令.doc_第4頁
神州數(shù)碼路由器及交換機配置命令.doc_第5頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

_神州數(shù)碼交換機配置命令交換機基本狀態(tài):hostname ;用戶模式hostname# ;特權(quán)模式hostname(config)# ;全局配置模式hostname(config-if)# ;接口狀態(tài)交換機口令設置:switchenable ;進入特權(quán)模式switch#config terminal ;進入全局配置模式switch(config)#hostname ;設置交換機的主機名switch(config)#enable secret xxx ;設置特權(quán)加密口令switch(config)#enable password xxa ;設置特權(quán)非密口令switch(config)#line console 0 ;進入控制臺口switch(config-line)#line vty 0 4 ;進入虛擬終端switch(config-line)#login ;允許登錄switch(config-line)#password xx ;設置登錄口令xxswitch#exit ;返回命令交換機VLAN設置:switch#vlan database ;進入VLAN設置switch(vlan)#vlan 2 ;建VLAN 2switch(vlan)#no vlan 2 ;刪vlan 2switch(config)#int f0/1 ;進入端口1switch(config-if)#switchport access vlan 2 ;當前端口加入vlan 2switch(config-if)#switchport mode trunk ;設置為干線switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlanswitch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼switch(config)#vtp domain ;設置發(fā)vtp域名switch(config)#vtp password ;設置發(fā)vtp密碼switch(config)#vtp mode server ;設置發(fā)vtp模式switch(config)#vtp mode client ;設置發(fā)vtp模式交換機設置IP地址:switch(config)#interface vlan 1 ;進入vlan 1switch(config-if)#ip address ;設置IP地址switch(config)#ip default-gateway ;設置默認網(wǎng)關(guān)switch#dir Flash: ;查看閃存交換機顯示命令:switch#write ;保存配置信息switch#show vtp ;查看vtp配置信息switch#show run ;查看當前配置信息switch#show vlan ;查看vlan配置信息switch#show interface ;查看端口信息switch#show int f0/0 ;查看指定端口信息完了最最要的一步。要記得保存設置俄,保存命令:switch(config)#copy running-config startup-config解決交換機無法遠程管理的經(jīng)典三招1、檢查線路連接狀態(tài)2、檢查端口工作狀態(tài):“display cpu” 如果發(fā)現(xiàn)某塊板卡的CPU消耗率達到50%以上,那么對應板卡上的某個交換端口可能不停地受到大容量數(shù)據(jù)的沖擊3、檢查病毒攻擊狀態(tài)接著在交換機后臺管理系統(tǒng)的DOS命令行狀態(tài)下,執(zhí)行字符串命令“dis dia”,來對交換機系統(tǒng)的各個交換端口進行全面掃描,掃描結(jié)束后這些結(jié)果信息會被自動捕獲保存到先前設置的文本文件中;打開目標文本文件,仔細檢查其中是否存在地址沖突的提示信息,要是發(fā)現(xiàn)有這樣的提示信息時,那就說明局域網(wǎng)中存在ARP病毒。為了找到ARP病毒源頭,我們可以在交換機的命令行狀態(tài)下執(zhí)行“dis mac”字符串命令,從其后的結(jié)果界面中找到發(fā)生地址沖突的MAC地址對應的交換端口以及所在子交換機的IP地址;下面以系統(tǒng)管理員權(quán)限登錄進入目標子交換機系統(tǒng),將該系統(tǒng)切換進入全局配置狀態(tài),之后再進入目標交換端口的視圖配置狀態(tài),在該狀態(tài)下執(zhí)行“shutdown”命令,將目標交換端口暫時關(guān)閉,以便禁止ARP病毒通過該交換端口影響整個局域網(wǎng);最后,我們可以查看網(wǎng)管記錄,找到連接到故障交換端口的客戶端計算機,要求該計算機用戶必須及時殺毒,確保能夠?qū)RP病毒及時清除干凈;在清除干凈ARP病毒后,再在對應交換端口的視圖模式配置狀態(tài)下,執(zhí)行“undo shutdown”字符串命令,將目標交換端口重新啟用起來,這么一來我們就能成功解決由ARP病毒引起的無法遠程管理交換機故障現(xiàn)象了第一部分:交換機配置:1.基本配置:開啟SSH服務:debug ssh-server設置特權(quán)模式密碼:enable password 8 注釋:8為加密的密碼設置退出特權(quán)模式超時時間:exec-timeout Switch(config)#exec-timeout 5 30(退出時間為5分30秒)更改主機名:hostname主機名設置主機名與IP地址的映射關(guān)系:Switch(config)#ip host beijing (beijing為主機)開啟web配置服務:Switch(config)#ip http serve顯示幫戶信息的語言類型:language chinese|english使用密碼驗證:login使用本地用戶密碼驗證:Switch(config)#login local設置用戶在console上進入一般用戶配置模式時的口令:Switch(config)#password 8 test熱啟動交換機:reload加密系統(tǒng)密碼:service password-encryption恢復交換機出廠配置:set default保存當前配置:write配置交換機作為Telnet服務器允許登錄的Telnet客戶端的安全IP地址:Switch(config)#telnet-server securityip 1設置Telnet客戶端的用戶名及口令:Switch(config)#telnet-user Antony password 0 switch打開交換機的SSH服務器功能:Switch(config)#ssh-server enable設置SSH客戶端的用戶名及口令:Switch(config)#ssh-user switch password 0 switch通過DHCP方式獲取IP地址。Switch(config)#interface vlan 1Switch(Config-if-Vlan1)#ip dhcp-client enableSwitch(Config-if-Vlan1)#exit交換機Switch1端口1同交換機Switch2端口1用線相連,將該兩個端口設置為強制100Mbit/s速率,半雙工模式。Switch1(config)#interface ethernet1/1Switch1(Config-If-Ethernet1/1)#speed-duplex force100-halfSwitch2(config)#interface ethernet1/1Switch2(Config-If-Ethernet1/1)#speed-duplex force100-half配置名稱為test的隔離組。SwitchenableSwitch#configSwitch(config)#isolate-port group test打開LACP調(diào)試開關(guān)。Switch#debug lacp新建一個port group,并且采用默認的流量分擔方式。Switch (config)#port-group 1刪除一個port groupSwitch (config)#no port-group 1在Ethernet1/1端口模式下,將本端口以active模式加入port-group 1。Switch (Config-If-Ethernet1/1)#port-group 1 mode active刪除端口1動態(tài)MAC。Switch#clear port-security dynamic interface Ethernet 1/1使能端口1的MAC地址綁定功能。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security將端口1的MAC地址轉(zhuǎn)化為靜態(tài)安全MAC地址。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security convert添加MAC 00-03-0F-FE-2E-D3到端口1Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security mac-address 00-03-0F-FE-2E-D3設置端口1安全MAC地址上限為4。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security maximum 4設置端口1的違背模式為shutdown。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security violation shutdown生成樹配置:配置VLAN1-10;100-110與Instance 1的映射關(guān)系。Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)#instance 1 vlan 1-10;100-110配置修正數(shù)值為2000。Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)# revision-level 2000開啟和關(guān)閉生成樹Switch(config)#spanning-treeSwitch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#no spanning-tree設置交換機運行STP模式。Switch(config)#spanning-tree mode stp在端口1/2設置實例1的端口優(yōu)先級為32。Switch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#spanning-tree mst 1 port-priority 32配置交換機實例2的優(yōu)先級為4096。Switch(config)#spanning-tree mst 2 priority 4096訪問控制列表配置:使能在Tuesday到Saturday內(nèi)的9:15:30到12:30:00時間段內(nèi)配置生效Switch(config)#time-range dc_timerSwitch(Config-Time-Range-dc_timer)#absolute-periodic tuesday 9:15:30 to saturday 12:30:00使能在Monday、Wednesday、Friday和Sunday四天內(nèi)的14:30:00到16:45:00時間段配置生效Switch (Config-Time-Range-dc_timer)#periodicmonday wednesday friday sunday 14:30:00 to16:45:00創(chuàng)建編號為110的數(shù)字擴展訪問列表。拒絕icmp報文通過,允許目的地址為目的端口為32的udp包通過。Switch(config)#access-list 110 deny icmp any-source any-destinationSwitch(config)#access-list 110 permit udp any-source host-destination d-port 32創(chuàng)建一條編號為20的數(shù)字標準IP訪問列表,允許源地址為/24的數(shù)據(jù)包通過,拒絕其余源地址為/16的數(shù)據(jù)包通過。Switch(config)#access-list 20 permit 55Switch(config)#access-list 20 deny 55允許源MAC地址為00-00-XX-XX-00-01的數(shù)據(jù)包通過,拒絕源地址為00-00-00-XX-00-ab的數(shù)據(jù)包通過。Switch(config)# access-list 700 permit 00-00-00-00-00-01 00-00-FF-FF-00-00Switch(config)# access-list 700 deny00-00-00-00-00-ab 00-00-00-FF-00-00允許源地址為/24的數(shù)據(jù)包通過,拒絕其余源地址為/16的數(shù)據(jù)包通過。Switch(config)# ip access-list standard ipFlowSwitch(Config-Std-Nacl-ipFlow)# permit 55Switch(Config-Std-Nacl-ipFlow)# deny 55二層交換機配置:1.基本配置:enable進入特權(quán)模式config禁進入全局配置模式hostname更改設備名稱1.使用TFTP上傳文件:show flashcopy startup-config t0/sw1-config012.配置telnet服務:telnet-server enabletelnet-user admin password 0 admintelnet-server secu 指定特定的IP遠程登錄3.http登錄:ip http serverweb-user dcnu password 0 dcnu指定登錄用戶名和密碼4.交換機vlan的配置:vlan 10switchport interface ethernet 0/0/1-105.端口鏡像:monitor session 1 source interface ethernet 0/0/1;10;24monitor session 1 destination interface ethernet 0/0/236.端口MAC地址綁定:sw port-securitysw port-security mac-address 00-0B-CD-4A-23-AF查看mac地址表:show mac-address-table7.AM實現(xiàn)端口IP和MAC地址綁定:am enableam mac-ip-pool mac地址IP地址8.生成樹配置:開啟和關(guān)閉生成樹:span no span針對特定端口開啟和關(guān)閉生成樹:int e0/0/1span/no spanmstp配置:span mstp configname dcnuinstance 1 vlan 10instance 2 vlan 20指定優(yōu)先級:span mstp 1 priority 4096span mstp 2 priority 61440指定特定端口的優(yōu)先級:int e0/0/1span mstp 1 port-poriority 16span mstp 2 port-poriority 240三層交換機DHCP和中繼的配置:1.DHCP配置:vlan 10vlan 20int vlan 10ip add int vlan 20ip add service dhcpip dhcp pool 1network-address 24default-router ip dhcp pool 2network-address 24default-router 2.DHCP中繼:ip forward-protocol udp bootpsint vlan 10ip help ip route 路由器配置:1.ospf路由器配置:router ospf 100network area 0接口權(quán)值配置:ip ospf cost值路由重分發(fā):redistribute ospf區(qū)域號redistribute rip下面的配置在路由器A和B之間配置一條virtua link。路由器A(router-id: )上的配置:!router ospf 100network area 1area 1 virtual-link 路由器B(router-id: )上的配置:router ospf 100network area 1area 1 virtual-link 策略路由配置:創(chuàng)建ACL:ip access-list standard net1 permit 55創(chuàng)建router-map:router-maprouter-map pbr 10 permitmatch ip addess net1 set ip next-hop 9綁定在進入的接口上:interface fastethernet 0/0ip policy route-map pbrRouterA配置:RouterenableRouter#confRouter_config#hostname RouterARouterA_config#username RouterB password 1234設置賬號密碼RouterA_config#int s0/1RouterA_config_s0/1#ip address RouterA_config_s0/1#encapsulation ppp封裝PPP協(xié)議RouterA_config_s0/1#ppp authentication chap設置驗證方式RouterA_config_s0/1#ppp chap hostname RouterA設置發(fā)給對方驗證的賬號RouterA_config_s0/1#physical-layer speed 64000設置DCE時鐘頻率RouterA_config_s0/1#no shutRouterA_config_s0/1#exitRouterA_config#aaa authentication ppp default local配置aaa的ppp認證方法表RouterB配置:RouterenableRouter#confRouter_config#hostname RouterBRouterB_config#username RouterA password 1234設置賬號密碼RouterB_config#int s0/1RouterB_config_s0/1#ip address RouterB_config_s0/1#encapsulation ppp封裝PPP協(xié)議RouterB_config_s0/1#ppp authentication chap設置驗證方式RouterB_config_s0/1#ppp chap hostname Router

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論