網(wǎng)工復(fù)習(xí)+交換機(jī)路由器命令解析_第1頁
網(wǎng)工復(fù)習(xí)+交換機(jī)路由器命令解析_第2頁
網(wǎng)工復(fù)習(xí)+交換機(jī)路由器命令解析_第3頁
網(wǎng)工復(fù)習(xí)+交換機(jī)路由器命令解析_第4頁
網(wǎng)工復(fù)習(xí)+交換機(jī)路由器命令解析_第5頁
已閱讀5頁,還剩13頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡介

.交換機(jī)支持的命令:

交換機(jī)基本狀態(tài):switch:;ROM狀態(tài),路由器是rommon>

hostname>;用戶模式

hostname#;特權(quán)模式

hostname(config)#;全局配置模式

hostname(config-if)#;接口狀態(tài)交換機(jī)口令設(shè)置:switch>enable;進(jìn)入特權(quán)模式

switch#configterminal;進(jìn)入全局配置模式

switch(config)#hostname;設(shè)置交換機(jī)的主機(jī)名

switch(config)#enablesecretxxx;設(shè)置特權(quán)加密口令

switch(config)#enablepasswordxxa;設(shè)置特權(quán)非密口令

switch(config)#lineconsole0;進(jìn)入控制臺口

switch(config-line)#linevty04;進(jìn)入虛擬終端

switch(config-line)#login;允許登錄

switch(config-line)#passwordxx;設(shè)置登錄口令xx

switch#exit;返回命令交換機(jī)VLAN設(shè)置:switch#vlandatabase;進(jìn)入VLAN設(shè)置

switch(vlan)#vlan2;建VLAN2

switch(vlan)#novlan2;刪vlan2

switch(config)#intf0/1;進(jìn)入端口1

switch(config-if)#switchportaccessvlan2;當(dāng)前端口加入vlan2

switch(config-if)#switchportmodetrunk;設(shè)置為干線

switch(config-if)#switchporttrunkallowedvlan1,2;設(shè)置允許的vlan

switch(config-if)#switchporttrunkencapdot1q;設(shè)置vlan中繼

switch(config)#vtpdomain;設(shè)置發(fā)vtp域名

switch(config)#vtppassword;設(shè)置發(fā)vtp密碼

switch(config)#vtpmodeserver;設(shè)置發(fā)vtp模式

switch(config)#vtpmodeclient;設(shè)置發(fā)vtp模式交換機(jī)設(shè)置IP地址:switch(config)#interfacevlan1;進(jìn)入vlan1

switch(config-if)#ipaddress;設(shè)置IP地址

switch(config)#ipdefault-gateway;設(shè)置默認(rèn)網(wǎng)關(guān)

switch#dirflash:;查看閃存交換機(jī)顯示命令:switch#write;保存配置信息

switch#showvtp;查看vtp配置信息

switch#showrun;查看當(dāng)前配置信息

switch#showvlan;查看vlan配置信息

switch#showinterface;查看端口信息

switch#showintf0/0;查看指定端口信息2.路由器支持的命令:

路由器顯示命令:router#showrun;顯示配置信息

router#showinterface;顯示接口信息

router#showiproute;顯示路由信息

router#showcdpnei;顯示鄰居信息

router#reload;重新起動路由器口令設(shè)置:router>enable;進(jìn)入特權(quán)模式

router#configterminal;進(jìn)入全局配置模式

router(config)#hostname;設(shè)置路由器的主機(jī)名

router(config)#enablesecretxxx;設(shè)置特權(quán)加密口令

router(config)#enablepasswordxxb;設(shè)置特權(quán)非密口令

router(config)#lineconsole0;進(jìn)入控制臺口

router(config-line)#linevty04;進(jìn)入虛擬終端

router(config-line)#login;要求口令驗(yàn)證

router(config-line)#passwordxx;設(shè)置登錄口令xx

router(config)#(Ctrl+z);返回特權(quán)模式

router#exit;返回命令路由器配置:router(config)#ints0/0;進(jìn)入Serail接口

router(config-if)#noshutdown;激活當(dāng)前接口

router(config-if)#clockrate64000;設(shè)置同步時(shí)鐘

router(config-if)#ipaddress;設(shè)置IP地址

router(config-if)#ipaddresssecond;設(shè)置第二個(gè)IP

router(config-if)#intf0/0.1;進(jìn)入子接口

router(config-subif.1)#ipaddress;設(shè)置子接口IP

router(config-subif.1)#encapsulationdot1q;綁定vlan中繼協(xié)議

router(config)#config-register0x2142;跳過配置文件

router(config)#config-register0x2102;正常使用配置文件

router#reload;重新引導(dǎo)路由器文件操作:router#copyrunning-configstartup-config;保存配置

router#copyrunning-configtftp;保存配置到tftp

router#copystartup-configtftp;開機(jī)配置存到tftp

router#copytftpflash:;下傳文件到flash

router#copytftpstartup-config;下載配置文件ROM狀態(tài):

Ctrl+Break;進(jìn)入ROM監(jiān)控狀態(tài)

rommon>confreg0x2142;跳過配置文件

rommon>confreg0x2102;恢復(fù)配置文件

rommon>reset;重新引導(dǎo)

rommon>copyxmodem:flash:;從console傳輸文件rommon>IP_ADDRESS=;設(shè)置路由器IP

rommon>IP_SUBNET_MASK=;設(shè)置路由器掩碼

rommon>TFTP_SERVER=;指定TFTP服務(wù)器IP

rommon>TFTP_FILE=c2600.bin;指定下載的文件

rommon>tftpdnld;從tftp下載

rommon>dirflash:;查看閃存內(nèi)容

rommon>boot;引導(dǎo)IOS靜態(tài)路由:iproute;命令格式

router(config)#iproute.0;靜態(tài)路由舉例

router(config)#iproute;默認(rèn)路由舉例動態(tài)路由:router(config)#iprouting;啟動路由轉(zhuǎn)發(fā)

router(config)#routerrip;啟動RIP路由協(xié)議。

router(config-router)#network;設(shè)置發(fā)布路由

router(config-router)#negihbor;點(diǎn)對點(diǎn)幀中繼用。幀中繼命令:router(config)#frame-relayswitching;使能幀中繼交換

router(config-s0)#encapsulationframe-relay;使能幀中繼

router(config-s0)#fram-relaylmi-typecisco;設(shè)置管理類型

router(config-s0)#frame-relayintf-typeDCE;設(shè)置為DCE

router(config-s0)#frame-relaydlci16;

router(config-s0)#frame-relaylocal-dlci20;設(shè)置虛電路號

router(config-s0)#frame-relayinterface-dlci16;

router(config)#log-adjacency-changes;記錄鄰接變化

router(config)#ints0/0.1point-to-point;設(shè)置子接口點(diǎn)對點(diǎn)

router#showframepvc;顯示永久虛電路

router#showframemap;顯示映射基本訪問控制列表:router(config)#access-listpermit|deny

router(config)#interface;default:denyany

router(config-if)#ipaccess-groupin|out;default:out例1:

router(config)#access-list4permit.1

router(config)#access-list4deny55

router(config)#access-list4permit55

router(config)#access-list4deny55

router(config)#access-list4permitany

router(config)#intf0/0

router(config-if)#ipaccess-group4in擴(kuò)展訪問控制列表:access-listpermit|denyicmp<DESTINATIONIP

wild>[type]

access-listpermit|denytcp<DESTINATIONIP

wild>[port]

例3:

router(config)#access-list101denyicmpany.0echo

router(config)#access-list101permitipanyany

router(config)#ints0/0

router(config-if)#ipaccess-group101in

例3:

router(config)#access-list102denytcpanyeq80

router(config)#access-list102permitipanyany

router(config)#interfaces0/1

router(config-if)#ipaccess-group102out刪除訪問控制例表:router(config)#noaccess-list102

router(config-if)#noipaccess-group101in路由器的nat配置Router(config-if)#ipnatinside;當(dāng)前接口指定為內(nèi)部接口

Router(config-if)#ipnatoutside;當(dāng)前接口指定為外部接口

Router(config)#ipnatinsidesourcestatic[p]<私有IP><公網(wǎng)IP>[port]

Router(config)#ipnatinsidesourcestatic

Router(config)#ipnatinsidesourcestatictcp8080

Router(config)#ipnatpoolp10

Router(config)#ipnatinsidesourcelist1poolp1

Router(config)#ipnatinsidedestinationlist2poolp2

Router(config)#ipnatinsidesourcelist2interfaces0/0overload

Router(config)#ipnatpoolp2typerotary

Router#showipnattranslation

rotary參數(shù)是輪流的意思,地址池中的IP輪流與NAT分配的地址匹配。

overload參數(shù)用于PAT將內(nèi)部IP映射到一個(gè)公網(wǎng)IP不同的端口上。外部網(wǎng)關(guān)協(xié)議配置:routerA(config)#routerbgp100

routerA(config-router)#network.0

routerA(config-router)#neighborremote-as200配置PPP驗(yàn)證:RouterA(config)#usernamepassword

RouterA(config)#ints0

RouterA(config-if)#pppauthentication{chap|pap}3.PIX防火墻命令Pix525(config)#global(if_name)natidip-ip;定義公網(wǎng)IP區(qū)間

Pix525(config)#global(outside)1.1-5;例句

Pix525(config)#global(outside)1;例句

Pix525(config)#noglobal(outside)1;去掉設(shè)置Pix525(config)#nat(if_name)nat_idlocal_ip[netmark]

Pix525(config)#nat(inside)100

內(nèi)網(wǎng)所有主機(jī)(0代表.0)可以訪問global1指定的外網(wǎng)。

Pix525(config)#nat(inside)1

內(nèi)網(wǎng)/16網(wǎng)段的主機(jī)可以訪問global1指定的外網(wǎng)。Pix525(config)#routeif_name00gateway_ip[metric];命令格式

Pix525(config)#routeoutside001;例句

Pix525(config)#routeinside.01;例句Pix525(config)#static(inside,outside)

表示內(nèi)部ip地址,訪問外部時(shí)被翻譯成全局地址。Pix525(config)#static(dmz,outside)

中間區(qū)域ip地址,訪問外部時(shí)被翻譯成全局地址。CISCO交換機(jī)基本配置:Console端口連接

用戶模式hostname#;

特權(quán)模式hostname(config)#;

全局配置模式hostname(config-if)#;

交換機(jī)口令設(shè)置:

switch>enable;進(jìn)入特權(quán)模式

switch#configterminal;進(jìn)入全局配置模式

switch(config)#hostnamecsico;設(shè)置交換機(jī)的主機(jī)名

switch(config)#enablesecretcsico1;設(shè)置特權(quán)加密口令

switch(config)#enablepasswordcsico8;設(shè)置特權(quán)非密口令

switch(config)#lineconsole0;進(jìn)入控制臺口

switch(config-line)#linevty04;進(jìn)入虛擬終端

switch(config-line)#login;虛擬終端允許登錄

switch(config-line)#passwordcsico6;設(shè)置虛擬終端登錄口令csico6

switch#exit;返回命令交換機(jī)VLAN創(chuàng)建,刪除,端口屬性的設(shè)置,配置trunk端口,將某端口加入vlan中,配置VTP:

switch#vlandatabase;進(jìn)入VLAN設(shè)置

switch(vlan)#vlan2;建VLAN2

switch(vlan)#vlan3namevlan3;建VLAN3并命名為vlan3

switch(vlan)#novlan2;刪vlan2

switch(config)#intf0/1;進(jìn)入端口1

switch(config)#speed?

查看speed命令的子命令

switch(config)#speed100

設(shè)置該端口速率為100mb/s(10/auto)

switch(config)#duplex?

查看duplex的子命令

switch(config)#duplexfull設(shè)置該端口為全雙工(auto/half)

switch(config)#descriptionTO_PC1這是該端口描述為TO_PC1

switch(config-if)#switchportaccessvlan2;當(dāng)前端口加入vlan2

switch(config-if)#switchportmodetrunk;設(shè)置為trunk模式(access模式)

switch(config-if)#switchporttrunkallowedvlan1,2;設(shè)置允許的vlan

switch(config-if)#switchporttrunkencapdot1q;設(shè)置vlan中繼

switch(config)#vtpdomainvtpserver

;設(shè)置vtp域名相同

switch(config)#vtppassword

;設(shè)置發(fā)vtp密碼

switch(config)#vtpserver;設(shè)置vtp服務(wù)器模式

switch(config)#vtpclient;設(shè)置vtp客戶機(jī)模式交換機(jī)設(shè)置IP地址,默認(rèn)網(wǎng)關(guān),域名,域名服務(wù)器,配置和查看MAC地址表:

switch(config

溫馨提示

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

評論

0/150

提交評論