Cisco路由器交換機配置命令詳解_第1頁
Cisco路由器交換機配置命令詳解_第2頁
Cisco路由器交換機配置命令詳解_第3頁
Cisco路由器交換機配置命令詳解_第4頁
全文預覽已結束

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

Cisco路由器交換機配置命令詳解1.交換機支持的命令:

交換機基本狀態(tài):

switch:

;ROM狀態(tài),路由器是rommon〉

hostname〉

;用戶模式hostname#

;特權模式

hostname(config)#

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

;接口狀態(tài)

交換機口令設置:

switch〉enable

;進入特權模式switch#configterminal

;進入全局配置模式

switch(config)#hostname〈hostname〉

;設置交換機的主機名

switch(config)#enablesecretxxx

;設置特權加密口令

switch(config)#enablepasswordxxa

;設置特權非密口令

switch(config)#lineconsole0

;進入控制臺口

switch(config-line)#linevty04

;進入虛擬終端

switch(config-line)#login

;允許登錄

switch(config-line)#passwordxx

;設置登錄口令xxswitch#exit

;返回命令

交換機VLAN設置:

switch#vlandatabase

;進入VLAN設置

switch(vlan)#vlan2

;建VLAN2

switch(vlan)#novlan2

;刪vlan2

switch(config)#intf0/1

;進入端口1

switch(config-if)#switchportaccessvlan2

;當前端口加入vlan2

switch(config-if)#switchportmodetrunk

;設置為干線

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

switch(config-if)#switchporttrunkencapdot1q

;設置vlan中繼

switch(config)#vtpdomain〈name〉

;設置發(fā)vtp域名

switch(config)#vtppassword〈word〉

;設置發(fā)vtp密碼

switch(config)#vtpmodeserver

;設置發(fā)vtp模式

switch(config)#vtpmodeclient

;設置發(fā)vtp模式

交換機設置IP地址:

switch(config)#interfacevlan1

;進入vlan1

switch(config-if)#ipaddress〈IP〉〈mask〉

;設置IP地址

switch(config)#ipdefault-gateway〈IP〉

;設置默認網(wǎng)關

switch#dirflash:

;查看閃存

交換機顯示命令:

switch#write

;保存配置信息

switch#showvtp

;查看vtp配置信息

switch#showrun

;查看當前配置信息

switch#showvlan

;查看vlan配置信息

switch#showinterface

;查看端口信息

switch#showintf0/0

;查看指定端口信息

2.路由器支持的命令:

路由器顯示命令:router#showrun

;顯示配置信息

router#showinterface

;顯示接口信息router#showiproute

;顯示路由信息

router#showcdpnei

;顯示鄰居信息router#reload

;重新起動

路由器口令設置:

router〉enable

;進入特權模式

router#configterminal

;進入全局配置模式

router(config)#hostname〈hostname〉

;設置交換機的主機名

router(config)#enablesecretxxx

;設置特權加密口令

router(config)#enablepasswordxxb

;設置特權非密口令

router(config)#lineconsole0

;進入控制臺口

router(config-line)#linevty04

;進入虛擬終端

router(config-line)#login

;要求口令驗證

router(config-line)#passwordxx

;設置登錄口令xx

router(config)#(Ctrl+z)

;返回特權模式

router#exit

;返回命令

路由器配置:

router(config)#ints0/0

;進入Serail接口

router(config-if)#noshutdown

;激活當前接口

router(config-if)#clockrate64000

;設置同步時鐘

router(config-if)#ipaddress〈ip〉〈netmask〉

;設置IP地址

router(config-if)#ipaddress〈ip〉〈netmask〉second

;設置第二個IP

router(config-if)#intf0/0.1

;進入子接口

router(config-subif.1)#ipaddress〈ip〉〈netmask〉

;設置子接口IP

router(config-subif.1)#encapsulationdot1q〈n〉

;綁定vlan中繼協(xié)議

router(config)#config-register0x2142

;跳過配置文件

router(config)#config-register0x2102

;正常使用配置文件

router#reload

;重新引導

路由器文件操作:

router#copyrunning-configstartup-config

;保存配置

router#copyrunning-configtftp

;保存配置到tftp

router#copystartup-configtftp

;開機配置存到tftp

router#copytftpflash:

;下傳文件到flash

router#copytftpstartup-config

;下載配置文件

ROM狀態(tài):

Ctrl+Break

;進入ROM監(jiān)控狀態(tài)

rommon〉confreg0x2142

;跳過配置文件

rommon〉confreg0x2102

;恢復配置文件

rommon〉reset

;重新引導

rommon〉copyxmodem:〈sname〉flash:〈dname〉

;從console傳輸文件

rommon〉IP_ADDRESS=

;設置路由器IP

rommon〉IP_SUBNET_MASK=

;設置路由器掩碼

rommon〉TFTP_SERVER=

;指定TFTP服務器IP

rommon〉TFTP_FILE=c2600.bin

;指定下載的文件

rommon〉tftpdnld

;從tftp下載

rommon〉dirflash:

;查看閃存內容rommon〉boot

;引導IOS

靜態(tài)路由:

iproute〈ip-address〉〈subnet-mask〉〈gateway〉

;命令格式

router(config)#iproute

;靜態(tài)路由舉例

router(config)#iproute

;默認路由舉例

動態(tài)路由:

router(config)#iprouting

;啟動路由轉發(fā)

router(config)#routerrip

;啟動RIP路由協(xié)議。

router(config-router)#network〈netid〉

;設置發(fā)布路由

router(config-router)#negihbor〈ip〉

;點對點幀中繼用。

幀中繼命令:

router(config)#frame-relayswitching

;使能幀中繼交換

router(config-s0)#encapsulationframe-relay

;使能幀中繼

router(config-s0)#fram-relaylmi-typecisco

;設置管理類型

router(config-s0)#frame-relayintf-typeDCE

;設置為DCE

router(config-s0)#frame-relaydlci16

;

router(config-s0)#frame-relaylocal-dlci20

;設置虛電路號

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

;

router(config)#log-adjacency-changes

;記錄鄰接變化

router(config)#ints0/0.1point-to-point

;設置子接口點對點

router#showframepvc

;顯示永久虛電路

router#showframemap

;顯示映射

基本訪問控制列表:

router(config)#access-list〈number〉permit|deny〈sourceip〉〈wild|any〉

router(config)#interface〈interface〉

;default:denyany

router(config-if)#ipaccess-group〈number〉in|out

;default:out

例1:router(config)#access-list4permit

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

擴展訪問控制列表:

access-list〈number〉permit|denyicmp〈SourceIPwild〉〈destinationIP

wild〉[type]

access-list〈number〉permit|denytcp〈SourceIPwild〉〈destinationIPwild〉[port]

router(config)#access-list101denyicmpanyecho

router(config)#access-list101permitipanyany

router(config)#ints0/0

router(config-if)#ipaccess-group101in

router(config)#access-list102denytcpanyeq80

router(config)#access-list102permitipanyany

router(config)#interfaces0/1

router(config-if)#ipaccess-group102out

刪除訪問控制例表:

router(config)#noaccess-list102router(config-if)#noipaccess-group101in

路由器的nat配置

Router(config-if)#ipnatinside

;當前接口指定為內部接口

Router(config-if)#ipnatoutside

;當前接口指定為外部接口

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將內部IP映射到一個公網(wǎng)IP不同的端口上。

外部網(wǎng)關協(xié)議配置

routerA(config)#routerbgp100

routerA(config-router)#network

routerA(config-router)#neighborremote-as200

配置PPP驗證:

RouterA(config)#username〈RouterB〉password〈word〉

RouterA(config)#ints0RouterA(config-if)#pppauthentication{chap|pap}

3.PIX防火墻命令

Pix525(config)#nameifethernet0outsidesecurity0

;命名接口和級別

Pix525(config)#interfaceethernet0auto

;設置接口方式

Pix525(config)#interfaceethernet1100full

;設置接口方式

Pix525(conf

溫馨提示

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

評論

0/150

提交評論