導航:首頁 > 程序命令 > 思科配置區域網命令

思科配置區域網命令

發布時間:2022-12-08 14:52:03

㈠ 思科路由器配置命令一覽表是什麼

思科路由器常用配置命令一覽表: x0dx0a1、Exec commands: x0dx0a<1-99> 恢復一個會話 x0dx0abfe 手工應急模式設置 x0dx0aclear 復位功能 x0dx0aclock 管理系統時鍾 x0dx0aconfigure 進入設置模式 x0dx0aconnect 打開一個終端 x0dx0a 從tftp伺服器拷貝設置文件或把設置文件拷貝到tftp伺服器上 x0dx0adebug 調試功能 x0dx0adisable 退出優先命令狀態 x0dx0adisconnect 斷開一個網路連接 x0dx0aenable 進入優先命令狀態 x0dx0aerase 擦除快閃內存 x0dx0aexit 退出exce模式 x0dx0ahelp 交互幫助系統的描述 x0dx0alat 打開一個本地傳輸連接 x0dx0alock 鎖定終端 x0dx0alogin 以一個用戶名登錄 x0dx0alogout 退出終端 x0dx0ambranch 向樹形下端分支跟蹤多路由廣播 x0dx0amrbranch 向樹形上端分支跟蹤反向多路由廣播 x0dx0aname-connection 給一個存在的網路連接命名 x0dx0ano 關閉調試功能 x0dx0apad 打開X.29 PAD連接 x0dx0aping 發送回顯信息 x0dx0appp 開始點到點的連接協議 x0dx0areload 停機並執行冷啟動 x0dx0aresume 恢復一個活動的網路連接 x0dx0arlogin 打開遠程注冊連接 x0dx0arsh 執行一個遠端命令 x0dx0asend 發送信息到另外的終端行 x0dx0asetup 運行setup命令 x0dx0ashow 顯示正在運行系統信息 x0dx0aslip 開始SLIP協議 x0dx0astart-chat 在命令行上執行對話描述 x0dx0asystat 顯示終端行的信息 x0dx0atelnet 遠程登錄 x0dx0aterminal 終端行參數 x0dx0atest 測試子系統內存和埠 x0dx0atn3270 打開一個tin3270連接 x0dx0atrace 跟蹤路由到目的地 x0dx0aundebug 退出調試功能 x0dx0averify 驗證檢查閃爍文件的總數 x0dx0awhere 顯示活動的連接 x0dx0awhich-route 執行OSI路由表查找並顯示結果 x0dx0awrite 把正在運行的設置寫入內存、網路、或終端 x0dx0ax3 在PAD上設置X.3參數 x0dx0axremote 進入xremote模式 x0dx0ax0dx0a2、#show ? x0dx0ax0dx0aaccess-expression 顯示訪問控製表達式 x0dx0aaccess-lists 顯示訪問控製表 x0dx0aapollo Apollo 網路信息 x0dx0aappletalk Apple Talk 信息 x0dx0aarap 顯示Appletalk 遠端通道統計 x0dx0aarp 地址解析協議表 x0dx0aasync 訪問路由介面的終端行上的信息 x0dx0abridge 前向網路資料庫 x0dx0abuffers 緩沖池統計 x0dx0aclns CLNS網路信息 x0dx0aclock 顯示系統時鍾 x0dx0acmns 連接模式網路服務信息 x0dx0acompress 顯示壓縮狀態 x0dx0aconfiguration 非易失性內存的內容 x0dx0acontrollers 埠控制狀態 x0dx0adebugging 調試選項狀態 x0dx0adecnet DEC網路信息 x0dx0adialer 撥號參數和統計 x0dx0adnsix 顯示Dnsix/DMPP信息 x0dx0aentry 排隊終端入口 x0dx0aextended 擴展埠信息 x0dx0aflash 系統閃爍信息 x0dx0aflh-log 閃爍裝載幫助日誌緩沖區 x0dx0aframe-relay 幀中繼信息 x0dx0ahistory 顯示對話層歷史命令 x0dx0ahosts IP域名,查找方式,名字服務,主機表 x0dx0ainterfaces 埠狀態和設置 x0dx0aip IP信息 x0dx0aipx Novell IPX信息 x0dx0aisis IS-IS路由信息 x0dx0akeymap 終端鍵盤映射 x0dx0alat DEC LAT信息 x0dx0aline 終端行信息 x0dx0allc2 IBM LLC2 環路信息 x0dx0alnm IBM 局網管理 x0dx0alocal-ack 本地認知虛環路 x0dx0amemory 內存統計 x0dx0anetbios-cache NetBios命名緩沖存貯器內存 x0dx0anode 顯示已知LAT節點 x0dx0antp 網路時間協議 x0dx0aprocesses 活動進程統計 x0dx0aprotocols 活動網路路由協議 x0dx0aqueue 顯示隊列內容 x0dx0aqueueing 顯示隊列設置 x0dx0aregistry 功能注冊信息 x0dx0arhosts 遠程主機文件 x0dx0arif RIF存貯器入口 x0dx0aroute-map 路由器信息 x0dx0asdlle 顯示sdlc-llc2轉換信息 x0dx0aservices 已知LAT服務 x0dx0asessions 遠程連接信息 x0dx0asmds SMDS信息 x0dx0asource-bridge 源網橋參數和統計 x0dx0aspanning-tree 跨越樹形拓樸 x0dx0astacks 進程堆棧應用 x0dx0astandby 熱支持協議信息 x0dx0astun STUN狀態和設置 x0dx0asubsystem 顯示子系統 x0dx0atcp TCP連接狀態 x0dx0aterminal 顯示終端設置 x0dx0atn3270 TN3270 設置 x0dx0atranslate 協議轉換信息 x0dx0attycap 終端容易表 x0dx0ausers 顯示終端行的信息 x0dx0aversion 系統硬、軟體狀態 x0dx0avines VINES信息 x0dx0awhoami 當前終端行信息 x0dx0ax25 X.25信息 x0dx0axns XNS信息 x0dx0axermote Xremote統計 x0dx0ax0dx0a3、#config ? x0dx0ax0dx0aMemory 從非易失性內存設置 x0dx0aNetwork 從TFTP網路主機設置 x0dx0aOverwrite-network 從TFTP網路主機設置覆蓋非易失性內存 x0dx0aTerminal 從終端設置 x0dx0ax0dx0a4、Configure commads: x0dx0ax0dx0aAccess-list 增加一個訪問控制域 x0dx0aApollo Apollo全局設置命令 x0dx0aappletalk Appletalk 全局設置命令 x0dx0aarap Appletalk遠程進出協議 x0dx0aarp 設置一個靜態ARP入口 x0dx0aasync-bootp 修改系統啟動參數 x0dx0aautonomous-system 本地所擁有的特殊自治系統成員 x0dx0abanner 定義注冊顯示信息 x0dx0aboot 修改系統啟動時參數 x0dx0abridge 透明網橋 x0dx0abuffers 調整系統緩沖池參數 x0dx0abusy-message 定義當連接主機失敗時顯示信息 x0dx0achat-script 定義一個數據機對話文本 x0dx0aclns 全局CLNS設置子命令 x0dx0aclock 設置時間時鍾 x0dx0aconfig-register 定義設置寄存器 x0dx0adecnet 全局DEC網路設置子命令 x0dx0adefault-value 預設字元位值 x0dx0adialer-list 創建一個撥號清單入口 x0dx0adnsix-nat 為審計提供DMDM服務 x0dx0aenable 修改優先命令口令 x0dx0aend 從設置模式退出 x0dx0aexit 從設置模式退出 x0dx0aframe-relay 全局幀中繼設置命令 x0dx0ahelp 交互幫助系統的描述 x0dx0ahostname 設置系統網路名 x0dx0aiterface 選擇設置的埠 x0dx0aip 全局地址設置子命令 x0dx0aipx Novell/IPX全局設置命令 x0dx0akeymap 定義一個新的鍵盤映射 x0dx0alat DEC本地傳輸協議 x0dx0aline 設置終端行 x0dx0alnm IBM局網管理 x0dx0alocaddr-priority-list 在LU地址上建立優先隊列 x0dx0alogging 修改注冊(設備)信息 x0dx0alogin-string 定義主機指定的注冊字元串 x0dx0amap-class 設置靜態表類 x0dx0amap-list 設置靜態表清單 x0dx0amenu 定義用戶介面菜單 x0dx0amop 設置DEC MOP伺服器 x0dx0anetbios NETBIOS通道控制過濾 x0dx0ano 否定一個命令或改為預設設置 x0dx0antp 設置NTP x0dx0apriority-list 建立特權列表 x0dx0aprompt 設置系統提示符 x0dx0aqueue-list 建立常規隊列列表 x0dx0arcmd 遠程命令設置命令 x0dx0arcp-enable 打開Rep服務 x0dx0arif 源路由進程 x0dx0arouter-map 建立路由表或進入路由表命令模式 x0dx0arouter 打開一個路由進程 x0dx0arsh-enable 打開一個RSH服務 x0dx0asap-priority-list 在SAP或MAC地址上建立一個優先隊列 x0dx0aservice 修改網路基本服務 x0dx0asnmp-server 修改SNMP參數 x0dx0astate-machine 定義一個TCP分配狀態的機器 x0dx0astun STUN全局設置命令 x0dx0atacacs-server 修改TACACS隊列參數 x0dx0aterminal-queue 終端隊列命令 x0dx0atftp-server 為網路裝載請求提供TFTP服務 x0dx0atn3270 tn3270設置命令 x0dx0atranslate 解釋全局設置命令 x0dx0ausername 建立一個用戶名及其許可權 x0dx0avines VINES全局設置命令 x0dx0ax25 X.25 的第三級 x0dx0ax29 X.29 命令 x0dx0axns XNS 全局設置命令 x0dx0axremote 設置Xremote x0dx0ax0dx0a5、(config)#ip x0dx0ax0dx0aGlobal IP configuration subcommands: x0dx0aAccounting-list 選擇保存IP記帳信息的主機 x0dx0aAccounting-threshold 設置記帳入口的最大數 x0dx0aaccounting-transits 設置通過入口的最大數 x0dx0aalias TCP埠的IP地址取別名 x0dx0aas-path BGP自治系統路徑過濾 x0dx0acache-invalidate-delay 延遲IP路由存貯池的無效 x0dx0aclassless 跟隨無類前向路由規則 x0dx0adefault-network 標志網路作為預設網關候選 x0dx0adefault-gateway 指定預設網(如果沒有路由IP) x0dx0adomain-list 完成無資格主機的域名 x0dx0adomain-lookup 打開IP域名服務系統主機轉換 x0dx0adomain-name 定義預設域名 x0dx0aforward-protocol 控制前向的、物理的、直接的IP廣播 x0dx0ahost 為IP主機表增加一個入口 x0dx0ahost-routing 打開基於主機的路由(代理ARP和再定向) x0dx0ahp-host 打開HP代理探測服務 x0dx0amobile-host 移動主機資料庫 x0dx0amulticast-routing 打開前向IP x0dx0aname-server 指定所用名字伺服器的地址 x0dx0aospf-name-lookup 把OSPF路由作為DNS名顯示 x0dx0apim PIM 全局命令 x0dx0aroute 建立靜態路由 x0dx0arouting 打開IP路由 x0dx0asecurity 指定系統安全信息 x0dx0asource-route 根據源路由頭的選擇處理包 x0dx0asubnet-zero 允許子網0子網 x0dx0atcp 全局TCP參數

㈡ 思科配置命令詳細介紹

思科配置命令詳細介紹

對於剛想學計算機網路技術的朋友,首先接觸的就是思科路由器,下面是我給大家帶來的最詳細的CISCO路由器配置命令及方法:

第一章 路由器配置基礎

一、基本設置方式

二、命令狀態

三、設置對話過程

四、常用命令

五、配置IP定址

六、配置靜態路由

第二章 廣域網協議設置

一、HDLC

二、PPP

三、X.25

四、Frame Relay

五、ISDN

六、PSTN

第三章 路由協議設置

一、RIP協議

二、IGRP協議

三、OSPF協議

四、重新分配路由

五、IPX協議設置

第四章 服務質量及訪問控制

一、協議優先順序設置

二、隊列定製

三、訪問控制

第五章 虛擬區域網(VLAN)路由

一、虛擬區域網(VLAN)

二、交換機間鏈路(ISL)協議

三、虛擬區域網(VLAN)路由實例

第一章:路由器配置基礎

一、基本設置方式

一般來說,可以用5種方式來設置路由器:

1.Console口接終端或運行終端模擬軟體的微機;

2.AUX口接MODEM,通過電話線與遠方的終端或運行終端模擬軟體的微機相連;

3.通過Ethernet上的TFTP伺服器;

4.通過Ethernet上的TELNET程序;

5.通過Ethernet上的SNMP網管工作站。

但路由器的第一次設置必須通過第一種方式進行,此時終端的硬體設置如下:

波特率 :9600

數據位 :8

停止位 :1

奇偶校驗: 無

二、命令狀態

1. router>

路由器處於用戶命令狀態,這時用戶可以看路由器的連接狀態,訪問其它網路和主機,但不能看到和更改路由器的設置內容。

2. router#

在router>提示符下鍵入enable,路由器進入特權命令狀態router#,這時不但可以執行所有的用戶命令,還可以看到和更改路由器的設置內容。

3. router(config)#

在router#提示符下鍵入configure terminal,出現提示符router(config)#,此時路由器處於全局設置狀態,這時可以設置路由器的全局參數。

4. router(config-if)#; router(config-line)#; router(config-router)#;…

路由器處於局部設置狀態,這時可以設置路由器某個局部的參數。

5. >

路由器處於RXBOOT狀態,在開機後60秒內按ctrl-break可進入此狀態,這時路由器不能完成正常的功能,只能進行軟體升級和手工引導。

設置對話狀態

這是一台新路由器開機時自動進入的狀態,在特權命令狀態使用SETUP命令也可進入此狀態,這時可通過對話方式對路由器進行設置。

三、設置對話過程

顯示提示信息

全局參數的設置

介面參數的設置

顯示結果

利用設置對話過程可以避免手工輸入命令的煩瑣,但它還不能完全代替手工設置,一些特殊的設置還必須通過手工輸入的方式完成。

進入設置對話過程後,路由器首先會顯示一些提示信息:

--- System Configuration Dialog ---

At any point you may enter a question mark '?' for help.

Use ctrl-c to abort configuration dialog at any prompt.

Default settings are in square brackets '[]'.

這是告訴你在設置對話過程中的任何地方都可以鍵入“?”得到系統的幫助,按ctrl-c可以退出設置過程,預設設置將顯示在‘[]’中。然後路由器會問是否進入設置對話:

Would you like to enter the initial configuration dialog? [yes]:

如果按y或回車,路由器就會進入設置對話過程。首先你可以看到各埠當前的狀況:

First, would you like to see the current interface summary? [yes]:

Any interface listed with OK? value "NO" does not have a valid configuration

Interface IP-Address OK? Method Status Protocol

Ethernet0 unassigned NO unset up up

Serial0 unassigned NO unset up up

……… ……… … …… … …

然後,路由器就開始全局參數的設置:

Configuring global parameters:

1.設置路由器名:

Enter host name [Router]:

2.設置進入特權狀態的密文(secret),此密文在設置以後不會以明文方式顯示:

The enable secret is a one-way cryptographic secret used

instead of the enable password when it exists.

Enter enable secret: cisco

3.設置進入特權狀態的密碼(password),此密碼只在沒有密文時起作用,並且在設置以後會以明文方式顯示:

The enable password is used when there is no enable secret

and when using older software and some boot images.

Enter enable password: pass

4.設置虛擬終端訪問時的密碼:

Enter virtual terminal password: cisco

5.詢問是否要設置路由器支持的各種網路協議:

Configure SNMP Network Management? [yes]:

Configure DECnet? [no]:

Configure AppleTalk? [no]:

Configure IPX? [no]:

Configure IP? [yes]:

Configure IGRP routing? [yes]:

Configure RIP routing? [no]:

………

6.如果配置的是撥號訪問伺服器,系統還會設置非同步口的參數:

Configure Async lines? [yes]:

1) 設置線路的最高速度:

Async line speed [9600]:

2) 是否使用硬體流控:

Configure for HW flow control? [yes]:

3) 是否設置modem:

Configure for modems? [yes/no]: yes

4) 是否使用默認的modem命令:

Configure for default chat s cript? [yes]:

5) 是否設置非同步口的PPP參數:

Configure for Dial-in IP SLIP/PPP access? [no]: yes

6) 是否使用動態IP地址:

Configure for Dynamic IP addresses? [yes]:

7) 是否使用預設IP地址:

Configure Default IP addresses? [no]: yes

8) 是否使用TCP頭壓縮:

Configure for TCP Header Compression? [yes]:

9) 是否在非同步口上使用路由表更新:

Configure for routing updates on async links? [no]: y

10) 是否設置非同步口上的其它協議。

接下來,系統會對每個介面進行參數的設置。

1.Configuring interface Ethernet0:

1) 是否使用此介面:

Is this interface in use? [yes]:

2) 是否設置此介面的IP參數:

Configure IP on this interface? [yes]:

3) 設置介面的IP地址:

IP address for this interface: 192.168.162.2

4) 設置介面的IP子網掩碼:

Number of bits in subnet field [0]:

Class C network is 192.168.162.0, 0 subnet bits; mask is /24

在設置完所有介面的參數後,系統會把整個設置對話過程的結果顯示出來:

The following configuration command s cript was created:

hostname Router

enable secret 5 $1$W5Oh$p6J7tIgRMBOIKVXVG53Uh1

enable password pass

…………

請注意在enable secret後面顯示的是亂碼,而enable password後面顯示的是設置的內容。

顯示結束後,系統會問是否使用這個設置:

Use this configuration? [yes/no]: yes

如果回答yes,系統就會把設置的結果存入路由器的NVRAM中,然後結束設置對話過程,使路由器開始正常的工作。

四、常用命令

1. 幫助

在IOS操作中,無論任何狀態和位置,都可以鍵入“?”得到系統的幫助。

2. 改變命令狀態

任務 命令

進入特權命令狀態 enable

退出特權命令狀態 disable

進入設置對話狀態 setup

進入全局設置狀態 config terminal

退出全局設置狀態 end

進入埠設置狀態 interface type slot/number

進入子埠設置狀態 interface type number.subinterface [point-to-point | multipoint]

進入線路設置狀態 line type slot/number

進入路由設置狀態 router protocol

退出局部設置狀態 exit

3. 顯示命令

任務 命令

查看版本及引導信息 show version

查看運行設置 show running-config

查看開機設置 show startup-config

顯示埠信息 show interface type slot/number

顯示路由信息 show ip router

4. 拷貝命令

用於IOS及CONFIG的備份和升級

5. 網路命令

任務 命令

登錄遠程主機 telnet hostname|IP address

網路偵測 ping hostname|IP address

路由跟蹤 trace hostname|IP address

6. 基本設置命令

任務 命令

全局設置 config terminal

設置訪問用戶及密碼 username username password password

設置特權密碼 enable secret password

設置路由器名 hostname name

設置靜態路由 ip route destination subnet-mask next-hop

啟動IP路由 ip routing

啟動IPX路由 ipx routing

埠設置 interface type slot/number

設置IP地址 ip address address subnet-mask

設置IPX網路 ipx network network

激活埠 no shutdown

物理線路設置 line type number

啟動登錄進程 login [local|tacacs server]

設置登錄密碼 password password

五、配置IP定址

1. IP地址分類

IP地址分為網路地址和主機地址二個部分,A類地址前8位為網路地址,後24位為主機地址,B類地址16位為網路地址,後16位為主機地址,C類地址前24位為網路地址,後8位為主機地址,網路地址范圍如下表所示:

種類 網路地址范圍

A 1.0.0.0 到126.0.0.0有效 0.0.0.0 和127.0.0.0保留

B 128.1.0.0到191.254.0.0有效 128.0.0.0和191.255.0.0保留

C 192.0.1.0 到223.255.254.0有效 192.0.0.0和223.255.255.0保留

D 224.0.0.0到239.255.255.255用於多點廣播

E 240.0.0.0到255.255.255.254保留 255.255.255.255用於廣播

2. 分配介面IP地址

任務 命令

介面設置 interface type slot/number

為介面設置IP地址 ip address ip-address mask

掩瑪(mask)用於識別IP地址中的網路地址位數,IP地址(ip-address)和掩碼(mask)相與即得到網路地址。

3. 使用可變長的子網掩碼

通過使用可變長的子網掩碼可以讓位於不同介面的同一網路編號的網路使用不同的掩碼,這樣可以節省IP地址,充分利用有效的IP地址空間。

如下圖所示:

Router1和Router2的E0埠均使用了C類地址192.1.0.0作為網路地址,Router1的E0的網路地址為192.1.0.128, 掩碼為255.255.255.192, Router2的E0的網路地址為192.1.0.64,掩碼為255.255.255.192,這樣就將一個C類網路地址分配給了二個網,既劃分了二個子網,起到了節約地址的作用。

4. 使用網路地址翻譯(NAT)

NAT(Network Address Translation)起到將內部私有地址翻譯成外部合法的全局地址的功能,它使得不具有合法IP地址的用戶可以通過NAT訪問到外部Internet.

當建立內部網的時候,建議使用以下地址組用於主機,這些地址是由Network Working Group(RFC 1918)保留用於私有網路地址分配的`.

?; Class A:10.1.1.1 to 10.254.254.254

?; Class B:172.16.1.1 to 172.31.254.254

?; Class C:192.168.1.1 to 192.168.254.254

命令描述如下:

任務 命令

定義一個標准訪問列表 access-list access-list-number permit source [source-wildcard]

定義一個全局地址池 ip nat pool name start-ip end-ip {netmask netmask | prefix-length prefix-length} [type rotary]

建立動態地址翻譯 ip nat inside source {list {access-list-number | name} pool name [overload] | static local-ip global-ip}

指定內部和外部埠 ip nat {inside | outside}

如下圖所示,

路由器的Ethernet 0埠為inside埠,即此埠連接內部網路,並且此埠所連接的網路應該被翻譯,Serial 0埠為outside埠,其擁有合法IP地址(由NIC或服務提供商所分配的合法的IP地址),來自網路10.1.1.0/24的主機將從IP地址池 c2501中選擇一個地址作為自己的合法地址,經由Serial 0口訪問Internet。命令ip nat inside source list 2 pool c2501 overload中的參數overload,將允許多個內部地址使用相同的全局地址(一個合法IP地址,它是由NIC或服務提供商所分配的地址)。命令 ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192定義了全局地址的范圍。

設置如下:

ip nat pool c2501 202.96.38.1 202.96.38.62 netmask 255.255.255.192

interface Ethernet 0

ip address 10.1.1.1 255.255.255.0

ip nat inside

!

interface Serial 0

ip address 202.200.10.5 255.255.255.252

ip nat outside

!

ip route 0.0.0.0 0.0.0.0 Serial 0

access-list 2 permit 10.0.0.0 0.0.0.255

! Dynamic NAT

!

ip nat inside source list 2 pool c2501 overload

line console 0

exec-timeout 0 0

!

line vty 0 4

end

六、配置靜態路由

通過配置靜態路由,用戶可以人為地指定對某一網路訪問時所要經過的路徑,在網路結構比較簡單,且一般到達某一網路所經過的路徑唯一的情況下採用靜態路由。

任務 命令

建立靜態路由 ip route prefix mask {address | interface} [distance] [tag tag] [permanent]

Prefix :所要到達的目的網路

mask :子網掩碼

address :下一個跳的IP地址,即相鄰路由器的埠地址。

interface :本地網路介面

distance :管理距離(可選)

tag tag :tag值(可選)

permanent :指定此路由即使該埠關掉也不被移掉。

以下在Router1上設置了訪問192.1.0.64/26這個網下一跳地址為192.200.10.6,即當有目的地址屬於 192.1.0.64/26的網路范圍的數據報,應將其路由到地址為192.200.10.6的相鄰路由器。在Router3上設置了訪問 192.1.0.128/26及192.200.10.4/30這二個網下一跳地址為192.1.0.65。由於在Router1上埠Serial 0地址為192.200.10.5,192.200.10.4/30這個網屬於直連的網,已經存在訪問192.200.10.4/30的路徑,所以不需要在Router1上添加靜態路由。

Router1:

ip route 192.1.0.64 255.255.255.192 192.200.10.6

Router3:

ip route 192.1.0.128 255.255.255.192 192.1.0.65

ip route 192.200.10.4 255.255.255.252 192.1.0.65

同時由於路由器Router3除了與路由器Router2相連外,不再與其他路由器相連,所以也可以為它賦予一條默認路由以代替以上的二條靜態路由,

ip route 0.0.0.0 0.0.0.0 192.1.0.65

即只要沒有在路由表裡找到去特定目的地址的路徑,則數據均被路由到地址為192.1.0.65的相鄰路由器。

;

㈢ Cisco路由器配置命令

Cisco路由器配置命令大全

為方便考生復習思科路由器的配置,以下是我為大家整理的Cisco路由器配置命令,歡迎閱讀與收藏。

1. switch配置命令

(1)模式轉換命令

用戶模式----特權模式, 使用命令"enable"

特權模式----全局配置模式, 使用命令"config t"

全局配置模式----介面模式, 使用命令"interface+介面類型+介面號"

全局配置模式----線控模式, 使用命令"line+介面類型+介面號"

注:

用戶模式:查看初始化的信息.

特權模式:查看所有信息、調試、保存配置信息

全局模式:配置所有信息、針對整個路由器或交換機的所有介面

介面模式:針對某一個介面的配置

線控模式:對路由器進行控制的介面配置

(2)配置命令

show running config 顯示所有的配置

show versin 顯示版本號和寄存器值

shut down 關閉介面

no shutdown 打開介面

ip add +ip地址 配置IP地址

secondary+IP地址 為介面配置第二個IP地址

show interface+介面類型+介面號 查看介面管理性

show controllers interface 查看介面是否有DCE電纜

show history 查看歷史記錄

show terminal 查看終端記錄大小

hostname+主機名 配置路由器或交換機的標識

config memory 修改保存在NVRAM中的啟動配置

exec timeout 0 0 設置控制台會話超時為0

service password-encryptin 手工加密所有密碼

enable password +密碼 配置明文密碼

ena sec +密碼 配置密文密碼

line vty 0 4/15 進入telnet介面

password +密碼 配置telnet密碼

line aux 0 進入AUX介面

password +密碼 配置密碼

line con 0 進入CON介面

password +密碼 配置密碼

bandwidth+數字 配置帶寬

no ip address 刪除已配置的IP地址

show startup config 查看NVRAM中的配置信息

run-config atartup config 保存信息到NVRAM

write 保存信息到NVRAM

erase startup-config 清除NVRAM中的配置信息

show ip interface brief 查看介面的謫要信息

banner motd # +信息 + # 配置路由器或交換機的描素信息

description+信息 配置介面聽描素信息

vlan database 進入VLAN資料庫模式

vlan +vlan號+ 名稱 創建VLAN

switchport access vlan +vlan號 為VLAN為配介面

interface vlan +vlan號 進入VLAN介面模式

ip add +ip地址 為VLAN配置管理IP地址

vtp+service/tracsparent/client 配置SW的VTP工作模式

vtp +domain+域名 配置SW的VTP域名

vtp +password +密碼 配置SW的密碼

switchport mode trunk 啟用中繼

no vlan +vlan號 刪除VLAN

show spamming-tree vlan +vlan號 查看VLA怕生成樹議

2. 路由器配置命令

ip route+非直連網段+子網掩碼+下一跳地址 配置靜態/默認路由

show ip route 查看路由表

show protocols 顯示出所有的被動路由協議和介面上哪些協議被設置

show ip protocols 顯示了被配置在路由器上的路由選擇協議, 同時給出了在路由選擇協議中使用的定時器等信息

router rip 激活RIP協議

路由器的幾個基本命令:

Router>enable 進入特權模式

Router#disable 從特權模式返回到用戶模式

Router#configure terminal 進入到全局配置模式

Router(config)#interface ethernet 1 進入到路由器編號為1的乙太網口

exit 返回上層模式

end 直接返回到特權模式

========================================================

注意:

1、CISCO CATALYST(交換機),如果在初始化時沒有發現「用戶配置」文件,就會自動載入Default Settings(默認配置)文件,進行交換機初始化,以確保交換機正常工作。

2、CISCO Router(路由器)在初始化時,如果沒有發現「用戶配置」文件,系統會自動進入到「初始化配置模式」(系統配置對話模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!

========================================================

1、CONSOLE PORT(管理控制台介面):距離上限制,獨占的方式。剛開始配置的時候一般使用這個。

2、AUX port(輔助管理介面):可以掛接MODEM實現遠程管理,獨占的方式。

3、Telnet:多人遠程管理(決定於性能,VTY線路數量)不安全。後期維護,遠程管理登陸。

========================================================

注意:

交換機、路由器配置命令都是回車後立即執行,立即生效的。在運行中的機器上修改命令的時候要特別注意。

========================================================

Router(config)#hostname ?

WORD This system's network name

在配置模式下修改當前主機的本地標識,例:

------------------

Router(config)#hostname r11

r11(config)#

------------------

r11(config-if)#ip address ?

A.B.C.D IP address

為當前埠設置IP地址,使用前先進入需要配置的埠,例:

------------------

r11(config)#interface ethernet 1

r11(config-if)#ip address 172.16.1.1 255.255.255.0

------------------

r11>show version

r11#show version 觀察IOS版本,設備工作時間,相關介面列表

r11#show running-config 查看當前生效的配置,此配置文件存儲在RAM

r11#show interfaces ethernet 1 查看乙太網介面的狀態,工作狀態等等等...

========================================================

r11#reload 重新載入Router(重啟)

r11#setup 手工進入setup配置模式

r11#show history 查看歷史命令(最近剛用過的命令)

r11#terminal history size<0-256>設置命令緩沖區大小,0 : 代表不緩存

r11# running-config startup-config 保存當前配置

注意概念:

nvram:非易失性內存,斷電信息不會丟失 <-- 用戶配置 <-- 保存著startup-config

ram:隨機存儲器,斷電信息全部丟失 <-- 當前生效配置 <-- 保存著running-config

startup-config:在每次路由器或是交換機啟動時候,會主動載入(默認情況)

========================================================

設置說明和密碼的幾個命令:

r11(config)#banner motd [char c] 同時要以[char c]另起一行結束,描述機器登陸時的說明

r11(config-if)#description 描述介面注釋,需要在埠配置模式下

配置console口密碼:

------------------

r11(config)#line console 0 進入到consolo 0

r11(config-line)#password eliuzd 設置一個密碼為「eliuzd」

r11(config-line)#login 設置login(登陸)時使用密碼

------------------

配置enable密碼:

------------------

r11(config)#enable password cisco 設置明文的enable密碼

r11(config)#enable secret eliuzd 設置暗文的enable密碼(優先於明文被使用)

r11(config)#service password-encryption 加密系統所有明文密碼(功能較弱)

------------------

配置Telnet密碼:

------------------

r11(config)#line vty 0

r11(config-line)#password cisco

r11(config-line)#login

------------------

========================================================

配置虛擬回環介面:(回環介面默認為UP狀態)

(config)# 下,虛擬一個埠

------------------

r11(config)#interface loopback 0 創建一個回環介面loopback 0

r11(config-if)#ip address 192.168.1.1 255.255.255.0 配置它的IP地址

no * 做配置的反向操作(刪除配置)

------------------

=========================================================

路由器 DCE/DTE 僅存在廣域網中

r11#show controllers serial 0 用於查看DCE與DTE的屬性,serial 0路由器廣域網埠

DCE的Router需要配置時鍾頻率

r11(config-if)#clock rate ? 配置DCE介面的時鍾頻率(系統指定頻率)

一般實際情況下,這個不需要自己配置,因為DCE設備都在運營商那。

=========================================================

r11#show interfaces serial 1

查看埠狀態,第一行提示說明

Serial1 is administratively down, Line protocol is down

沒有使用no shutdown命令激活埠

Serial1 is down, Line protocol is down

1、對方沒有no shutdown激活埠

2、線路損壞,介面沒有任何連接線纜

Serial1 is up, line protocol is down

1、對方沒有配置相同的二層協議,Serial介面default encapsulation: HDLC

2、可能沒有配置時鍾頻率

3、可能沒有正確的配置三層地址(可能)

Serial1 is up,line protocol is up

介面工作正常

========================================================

查看CDP信息的幾個命令:

r11#show cdp neighbors 查看CDP的鄰居(不含IP)

r11#show cdp neighbors detail 查看CDP的鄰居(包含三層的IP地址)

r11#show cdp entry * 查看CDP的鄰居(包含三層的IP地址)老命令

r1(config)#no cdp run 在全局配置模式關閉CDP協議(影響所有的介面)

r1(config-if)#no cdp enable 在介面下關閉CDP協議(僅僅影響指定的介面)

r11#clear cdp table 清除CDP鄰居表

r11#show cdp interface serial 1 查看介面的CDP信息

注意兩個提示:

Sending CDP packets every 60 seconds(每60秒發送cdp數據包)

HoldTime 180 seconds(每個cdp數據包保持180秒)

========================================================

r11(config)#ip host 設置靜態的主機名映射

r11#show sessions 查看設置過的映射主機名

========================================================

Telnet *.*.*.* 被telnet的設備,需要設置line vty的密碼,如果需要進入特權模式需要配置enable密碼

㈣ 思科網路配置

enable
config t
1、創建相應的vlan
vlan 10
2、連接終端的埠加入到相應的VLAN
interface range f0/1-2
switchport access vlan 10
exit
3、將交換機與交換機的埠配置成TRUNK
interface f0/3
switchport mode trunk
end

1、交換機與交換機相連的埠配置成trunk
Switch(config)#interface range f0/1-2
Switch(config-if-range)#sw m t
2、創建相應的vlan(本匯聚層交換機以下所有vlan)
Switch(config)#vlan 10

enable
conf t
vlan 10
vlan 20
vlan 30
interface range f0/1-3
switchport trunk en do
switchport mode trunk
exit
interface vlan 10
ip address 192.168.10.254 255.255.255.0
exit
interface vlan 20
ip address 192.168.20.254 255.255.255.0
exit
interface vlan 30
ip address 192.168.30.254 255.255.255.0
exit
ip routing //啟用ip路由功能
interface f0/1
no switchport
ip address 192.168.40.2 255.255.255.0
end
write

enable
conf t
vlan 40
vlan 50
int rang f0/2
switchport trunk en do
switchport mode trunk
exit

interface vlan 40
ip address 100.100.100.1 255.255.255.0
exit
interface vlan 50
ip address 110.110.110.1 255.255.255.0
ip routing
interface f0/1
no switchport
ip address 54.1.1.2 255.255.255.0
end
write

三層

router rip
network 54.1.1.0
network 100.100.100.0
network 110.110.110.0

路由5
conf t
router rip
network 45.1.1.0
network 54.1.1.0

路由4
en
show ip route

conf t
router rip
network 45.1.1.0
network 64.1.1.0

路由6
en
show ip route

conf t
router rip
network 64.1.1.0


路由6
en
conf t
access-list 1 permit 192.168.10.0 0.0.0.255
access-list 1 permit 192.168.20.0 0.0.0.255
ip nat inside source list 1 interface f0/1

interface f0/0
ip nat inside
exit
interface f0/1
ip nat outside

路由6
Router(config)#ip route 192.168.20.0 255.255.255.0 192.168.40.2
Router(config)#ip route 192.168.10.0 255.255.255.0 192.168.40.2
Router(config)#ip route 192.168.30.0 255.255.255.0 192.168.40.2
access-list 1 permit 192.168.30.0 0.0.0.255

RIP(Routing Information Protocol,路由信息協議)是一種 內部網關協議 (IGP),是一種 動態路由選擇 協議,用於自治系統(AS)內的路由信息的傳遞。

如何配置動態路由協議RIP(內網三層設備都要rip,邊界路由器)
Switch#show ip route 查路由表
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

埠映射:Router(config)#ip nat inside source static tcp 192.168.10.1 80 64.1.1.1 80

NAT上網的思路
1、內網做通(ok)
2、外網做通(ok)
3、採用NAT將內外網連通

NAT配置的位置:內網與外網相交的三層設備上進行配置

1、控制內網要上網的網段。
Router(config)#access-list 1 permit 192.168.10.0 0.0.0.255
Router(config)#access-list 1 permit 192.168.20.0 0.0.0.255
2、實現內網到外網的轉換
Router(config)#ip nat inside source list 1 interface f0/1
inside source list 1 :內網要上網的網段
interface f0/1 (本路由器的外網介面)
3、指定本路由器內外網介面
Router(config)#interface f0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#interface f0/1
Router(config-if)#ip nat outside

注意:內網所有的三層設備需要配置一個默認路由到公網:
Switch(config)#ip route 0.0.0.0 0.0.0.0 192.168.40.1


埠映射:Router(config)#ip nat inside source static tcp 192.168.10.1 80 64.1.1.1 80

路由器埠設置ip

1.規劃網段

2.配置ip

3.配路由協議(讓路由層面互通)

en
conf t
interface f0/0
no shutdown
ip address 192.168.50.2 255.255.255.0
exit
interface f0/1
no shutdown
ip address 192.168.50.1 255.255.255.0
exit

en
conf t
ip dhcp pool pc0
network 192.168.10.0 255.255.255.0
default-router 192.168.10.254
exit

設置DNS
dns-server 192.168.110.2

show ip route
en
conf t
router ospf 1 //進程號
network 192.168.10.0 0.0.0.255 area 0
network 192.168.20.0 0.0.0.255 area 0

// network 直連網段 反子網掩碼 直連網段所處區域

R2

interface loopback 1
ip address 2.2.2.2 255.255.255.0

show ip protocols
router ospf 1
router-id 2.2.2.2
write
clear ip ospf process #重啟OSPF路由協議,讓配置生效

rouer ospf 1
network 2.2.2.0 0.0.0.255 area 2

router ospf 1
area 2(兩個區域之間的區域) virtual-link 4.4.4.4(對方的身份證)

R4

interface loopback 1
ip address 4.4.4.4 255.255.255.0

router ospf 1
router-id 4.4.4.4
write
clear ip ospf process

rouer ospf 1
network 4.4.4.0 0.0.0.255 area 2

router ospf 1
area 2(兩個區域之間的區域) virtual-link 2.2.2.2(對方的身份證)

Router#show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
12.1.1.1 1 FULL/DR 00:00:35 12.1.1.1 FastEthernet0/0
34.1.1.3 1 FULL/DR 00:00:32 23.1.1.3 FastEthernet0/1
4.4.4.4 0 FULL/ - 00:00:38 34.1.1.4 OSPF_VL0

R1 ping R5能 ping通

兩個交換機都要配

en

conf t

int vlan 10

standby 2 ip 192.168.20.253

修改pc的網關為192.168.10.253

router0
Router(config)#interface tunnel 1
Router(config-if)#tunnel source f0/1 (介面給本路由器的公網介面)
Router(config-if)#tunnel destination 110.110.110.2(給對方的公網地址)

router2
interface tunnel 1
tunnel source f0/0
tunnel destination 100.100.100.1

Router0
Router(config)#interface tunnel 1
Router(config-if)#ip address 1.1.1.1 255.255.255.0
Router2
Router(config)#interface tunnel 1
Router(config-if)#ip address 1.1.1.2 255.255.255.0
測試隧道是否能夠通信。
Router#ping 1.1.1.1

第六部:將隧道介面所有的網段network到總部與分部所有的路由協議(rip\ospf)裡面去。
Router0
Router(config)#router ospf 1
Router(config-router)#network 1.1.1.0 0.0.0.255 area 0
Router2
Router(config)#router ospf 1
Router(config-router)#network 1.1.1.0 0.0.0.255 area 0
或者
Router0
Router(config)#router rip
Router(config-router)#network 1.1.1.0
Router2
Router(config)#router rip
Router(config-router)#network 1.1.1.0

㈤ 思科與H3C配置命令對比MSTP VRRP

思科與H3C配置命令對比MSTP VRRP

MSTP,多生成樹協議是IEEE 802.1s中定義的一種新型生成樹協議。簡單說來,STP/RSTP是基於埠的,PVST+是基於VLAN的,而MSTP是基於實例的。與STP/RSTP和PVST+相比,MSTP中引入了「實例」的概念。它既可以實現快速收斂,又可以使不同VLAN的流量沿著各自的路徑轉發,從而利用冗餘鏈路提供了更好的負載分擔機制。

MSTP的基本思想地基於實例INSTANCE計算出多棵生成樹,每一個實例可以包含一個或者多個VLAN,每一個VLAN只能映射到一個實例。交換機通過配置多個實例,可以實現不同VLAN組之間的負載分擔。

MSTP多生成樹協議是IEEE標准協議,思科與H3C均可使用,但是配置命令上有所不同,下面具體來比較思科和H3C關於MSTP的配置命令。

如圖所示:三台交換機都運行MSTP,配置兩個實例,實例1對應VLAN 10,實例2對應VLAN 20。

思科MSTP配置如下:

Switch(config)#vlan 10 //創建VLAN 10

Switch(config)#vlan 20 //創建VLAN 20

Switch(config)#spanning-tree mode mst //生成樹工作模式配置為MSTP

Switch(config)#spanning-tree mst configuration //進入mstp的配置模式

Switch(config-mst)#name jc //命名mstp的域名

Switch(config-mst)#revision 0 //修訂級別

Switch(config-mst)#instance 1 vlan 10 //VLAN 10 加入實例1

Switch(config-mst)#instance 2 vlan 20 //VLAN 20 加入實例2

思科MSTP查看命令:

Switch#show spanning-tree mst 查看MSTP的全部信息

Switch#show spanning-tree mst configuration 查看實例映射信息

H3C MSTP配置如下:

[Switch]vlan 10 //創建VLAN 10

[Switch]vlan 20 //創建VLAN 20

[Switch]stp region-configuration //進入mstp配置模式

[Switch-mst-region]region-name jc //命名mstp的域名

[Switch-mst-region]revision-level 0 //修訂級別

[Switch-mst-region]instance 1 vlan 10 //VLAN 10 加入實例1

[Switch-mst-region]instance 2 vlan 20 //VLAN 20 加入實例2

[Switch-mst-region]active region-configuration //激活mst域的配置

H3C MSTP查看命令:

[Switch]display stp brief 查看生成樹狀態

[Switch]dis stp region-configuration 查看域配置

VRRP:

虛擬路由冗餘協議(Virtual Router Rendancy Protocol,簡稱VRRP)是由IETF提出的解決區域網中配置靜態網關出現單點失效現象的路由協議,1998年已推出正式的RFC2338協議標准。VRRP允許將多個路由器加入到一個備份組中,形成一台虛擬路由器。

在VRRP主備備份方式中,僅由主路由器承擔網關功能。當主路由器出現故障時。其他備份路由器會通過VRRP選舉出一個路由器接替主路由器的工作。主要備份組中仍有一台路由器正常工作,虛擬路由器就仍然正常工作。這樣就可以避免由於網關單點故障而導致的`網路中斷。

主備備份方式僅需要一個備份組,不同的路由器在該備份組中擁有不同的優先順序,優先順序最高的路由器將成為主路由器。

VRRP協議思科與H3C均可使用,但是配置命令上有所不同,下面具體來比較思科和H3C關於VRRP的配置命令。

思科VRRP主要配置如下:

Router#interface GigabitEthernet 0/0/0 //進入介面

Router(config-if)#vrrp 1 ip 192.168.1.254 //創建備份組並配置虛擬IP地址

Router(config-if)#vrrp 1 priority 120 //配置在備份組中的優先順序

Router(config-if)#vrrp 1 preempt //開啟搶占

H3C VRRP主要配置如下:

[Switch]interface GigabitEthernet 0/0/0 //進入介面

[Switch-GigabitEthernet0/0/0] vrrp vrid 1 virtual-ip 192.168.1.254 //創建備份組並配置虛擬IP地址

[Switch-GigabitEthernet0/0/0] vrrp vrid 1 priority 120 //配置在備份組中的優先順序

[Switch-GigabitEthernet0/0/0] vrrp vrid 1 preempt-mode //開啟搶占

;

㈥ 思科路由器基礎配置命令


思科路由器基礎配置命令
一、

1.router(config)#router rip 啟動rip進程

2.router(conifg-router)#network 172.17.0.0指定rip協議的主網路

3.router(config-router)#passive-interface f0/1把f0/1配置成passive埠

4.router(config-router)#neighbor 172.17.12.67 以單波方式通告rip更新給路由器

5.router(config-if)#ip address 192.168.83.244 255.255.255.0 主ip地址

router(config-if)#ip address 10.33.55.1 255.255.255.0 secondary輔助ip地址

二、

1.router(config-router)#version 2將rip配置成版本2

2.router(config-ip)#ip rip send version 1隻發rip 1數據包

router(config-ip)#ip rip receive version 2隻接收rip 2數據包

3.router(config-router)#no auto-summary 關閉匯總功能

4.router(config-if)#no ip split-horizon關閉水平分割

5.router#show ip ospf database router 192.168.30.10顯示路由器LSA通告

router#show ip ospf database network 192.168.17.18顯示網路LSA通告

router#show ip ospf database summary 172.16.121.0顯示網路匯總LSA通告

router#show ip ospf database asbr-summary顯示ASBR匯總LSA通告

router#show ip ospf database external 10.83.10.0顯示自主系統外部LSA通告

router#show ip ospf database nssa-external顯示NSSA外部LSA通告

三、

1.router(config)#router ospf 10配置ospf進程id

2.router(config)#interface loopback0

router(config-if)#ip address 192.168.10.1 255.255.255.0配置loopback0介面

3.router(config-router)#area 1 stub 配置stub區域

4.router(config-router)#area 1 stub no-summary配置totally stubby區域

5.router(config-router)#area 1 nssa配置nssa區域

6.router(config-router)#area 25 range 172.16.0.0 255.240.0.0 配置地址匯總

7.router(config-router)#area 100 virtual-link 192.168.100.33 配置虛鏈路

四、

1.router(config)#standby 172 ip 172.16.10.254加入備份組172 指定虛擬IP 地址

2.router(config-if)#standby 47 priority 150配置HSRP的優先順序150

3.router(config-if)#standby 47 preempt 配置HSRP的佔先權

4.router(config-if)#standby 47 ip time 2 9 2表示HELLO時間,9表示保持時間

5.router(config)#interface s0

6.router(config-if)#standby 47 track s0 100配置跟蹤埠s0並在埠down時減少100

7.router#show standby brief 查看HSRP的狀態

8.router#no debuge all關閉調試功能

五、

1.router(config-if)#ip access-group 1 in 訪問列表的入

router(config-if)#ip access-group 1 out訪問列表的出

2.router(config)#access-list 1 premit 192.168.10.0 0.0.0.255 允許192.168.10.0的網段通過

router(config)#access-list 1 deny 192.168.10.0 2.0.0.255 拒絕192.168.10.2的主機通過

3.router(config)#access-list 1 premit any ;any表示0.0.0.0 255.255.255.255

router(config)#access-list 1 premit host 172.30.16.29 ;host表示0.0.0.0

4.router(config)#access-list 101 deny tcp 172.16.4.0 0.0.0.255 172.16.3.0 0.0.0.255 eq 21拒絕來自172.16.4.0去往172.16.3.0的FTP流量

5.router(config)#ip access-list extended cisco創建名為cisco的命名訪問控制列表

六、靜態地址轉換

1.配置外部埠的IP地址

Router(config)#interface s0

Router(config-if)#ip address 61.159.62.129 255.255.255.248

2.配置內部埠的IP地址

Router(config)#interface e0

Router(config-if)#ip address 192.168.100.1 255.255.255.0

3.靜態地址轉換

Router(config)#ip nat inside source static 192.168.100.2 61.159.62.130

4.在內部和外部埠上啟用NAT

Router(config)#interafce s0

Router(config-if)#ip nat outside

Router(config)#interafce e0

Router(config-if)#ip nat inside

七、動態NAT配置

1.配置外部埠的IP地址

Router(config)#interface s0

Router(config-if)#ip address 61.159.62.129 255.255.255.248

2.配置內部埠的IP地址

Router(config)#interface e0

Router(config-if)#ip address 192.168.100.1 255.255.255.0

3.定義內部網路允許訪問外部網路

Router(config)#access-list 1 permit 192.168.100.0 0.0.0.255

4.定義合法的IP地址池

Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248

5.實現網路地址轉換

Router(config)#ip nat inside source list 1 pool chen

6.在內部和外部埠上啟用NAT

Router(config)#interafce s0

Router(config-if)#ip nat outside

Router(config)#interafce e0

Router(config-if)#ip nat inside

八、PAT的配置

1.配置外部埠的IP地址

Router(config)#interface s0

Router(config-if)#ip address 61.159.62.129 255.255.255.248

2.配置內部埠的IP地址

Router(config)#interface e0

Router(config-if)#ip address 192.168.100.1 255.255.255.0

3.定義內部網路允許訪問外部網路

Router(config)#access-list 1 permit 192.168.100.0 0.0.0.255

4.定義合法的IP地址池

Router(config)#ip nat pool chen 61.159.62.129 61.159.62.190 netmask 255.255.255.248

5.實現復用IP地址轉換

Router(config)#ip nat inside source list 1 pool chen overload

6.在內部和外部埠上啟用NAT

Router(config)#interafce s0

Router(config-if)#ip nat outside

Router(config)#interafce e0

Router(config-if)#ip nat inside

㈦ 思科交換機的配置保存命令

1、首先打開思科交換CLI,從特權模式進入全局配置模式,如下圖所示。

㈧ 思科交換機常用的100個命令

思科交換機常用的100個命令

在思科交換機上的命令有哪些?哪些命令最實用,你知道嗎?下面我為大家分享最常用的思科交換機基本命令,希望能幫助到大家!

1:進入特權模式enable

switch> enable

switch#

2:進入全局配置模式configure terminal

switch> enable

switch#c onfigure terminal

switch(conf)#

3:交換機命名hostname aptech2950 以aptech2950 為例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch-2950

aptech2950(conf)#

4:配置使能口令enable password cisco 以cisco 為例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# enable password cisco

5:配置使能密碼enable secret ciscolab 以cicsolab 為例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# enable secret ciscolab

6:設置虛擬區域網vlan 1 interface vlan 1

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# interface vlan 1

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0 配置交換機埠ip 和子網掩



aptech2950(conf-if)#no shut 是配置處於運行中

aptech2950(conf-if)#exit

aptech2950(conf)#ip default-gateway 192.168.254 設置網關地址

7:進入交換機某一埠interface fastehernet 0/17 以17 埠為例

switch> enable

switch#c onfigure terminal

switch(conf)#hostname aptch2950

aptech2950(conf)# interface fastehernet 0/17

aptech2950(conf-if)#

8:查看命令show

switch> enable

switch# show version 察看系統中的所有版本信息

show interface vlan 1 查看交換機有關ip 協議的配置信息

show running-configure 查看交換機當前起作用的配置信息

show interface fastethernet 0/1 察看交換機1 介面具體配置和統計信息

show mac-address-table 查看mac 地址表

show mac-address-table aging-time 查看mac 地址表自動老化時間

9:交換機恢復出廠默認恢復命令

switch> enable

switch# erase startup-configure

switch# reload

10:雙工模式設置

switch> enable

switch#c onfigure terminal

switch2950(conf)#hostname aptch-2950

aptech2950(conf)# interface fastehernet 0/17 以17 埠為例

aptech2950(conf-if)#plex full/half/auto 有full , half, auto 三個可選



11:cdp 相關命令

switch> enable

switch# show cdp 查看設備的cdp 全局配置信息

show cdp interface fastethernet 0/17 查看17 埠的cdp 配置信息

show cdp traffic 查看有關cdp 包的統計信息

show cdp nerghbors 列出與設備相連的cisco 設備

12:csico2950 的密碼恢復

拔下交換機電源線。

用手按著交換機的MODE 鍵,插上電源線

在switch:後執行flash_ini 命令:switch: flash_ini

查看flash 中的文件: switch: dir flash:

把“config.text”文件改名為“config.old”: switch: rename flash: config.text flash: config.old

執行boot: switch: boot

交換機進入是否進入配置的對話,執行no :

進入特權模式察看flash 里的文件: show flash :

把“config.old”文件改名為“config.text”: switch: rename flash: config.old flash: config.text

把“ config.text ” 拷入系統的“ running-configure ”: flash: config.text system :

running-configure

把配置模式重新設置密碼存檔,密碼恢復成功。

13:交換機telnet 遠程登錄設置:

switch>en

switch#c onfigure terminal

switch(conf)#hostname aptech-2950

aptech2950(conf)#enable password cisco 以cisco 為特權模式密碼

aptech2950(conf)#interface fastethernet 0/1 以17 埠為telnet 遠程登錄埠

aptech2950(conf-if)#ip address 192.168.1.1 255.255.255.0

aptech2950(conf-if)#no shut

aptech2950(conf-if)#exit

aptech2950(conf)line vty 0 4 設置0-4 個用戶可以telnet 遠程登陸

aptech2950(conf-line)#login

aptech2950(conf-line)#password edge 以edge 為遠程登錄的用戶密碼

主機設置:

ip 192.168.1.2 主機的ip 必須和交換機埠的地址在同一網路



netmask 255.255.255.0

gate-way 192.168.1.1 網關地址是交換機埠地址

運行:

telnet 192.168.1.1

進入telnet 遠程登錄界面

password : edge

aptech2950>en

password: cisco

aptech#

14:交換機配置的重新載入和保存

設置完成交換機的配置後:

aptech2950(conf)#reload

是否保存(y/n) y: 保存設置信息n:不保存設置信息

1.在基於IOS 的.交換機上設置主機名/系統名:

switch(config)# hostname hostname

在基於CLI 的交換機上設置主機名/系統名:

switch(enable) set system name name-string

2.在基於IOS 的交換機上設置登錄口令:

switch(config)# enable password level 1 password

在基於CLI 的交換機上設置登錄口令:

switch(enable) set password

switch(enable) set enalbepass

3.在基於IOS 的交換機上設置遠程訪問:

switch(config)# interface vlan 1

switch(config-if)# ip address ip-address netmask

switch(config-if)# ip default-gateway ip-address

在基於CLI 的交換機上設置遠程訪問:

switch(enable) set interface sc0 ip-address netmask broadcast-address

switch(enable) set interface sc0 vlan

switch(enable) set ip route default gateway

4.在基於IOS 的交換機上啟用和瀏覽CDP 信息:

switch(config-if)# cdp enable

switch(config-if)# no cdp enable

為了查看Cisco 鄰接設備的CDP 通告信息:

switch# show cdp interface [type modle/port]

switch# show cdp neighbors [type mole/port] [detail]

在基於CLI 的交換機上啟用和瀏覽CDP 信息:

switch(enable) set cdp {enable|disable} mole/port

為了查看Cisco 鄰接設備的CDP 通告信息:

switch(enable) show cdp neighbors[mole/port] [vlan|plex|capabilities|detail]

5.基於IOS 的交換機的埠描述:

switch(config-if)# description description-string

基於CLI 的交換機的埠描述:

switch(enable)set port name mole/number description-string

6.在基於IOS 的交換機上設置埠速度:

㈨ cisco交換機安全配置設定命令

cisco交換機安全配置設定命令大全

思科交換機的安全怎麼設置,下面為大家分交換機安全設置的配置命令,希望對同學們學習思科交換機有所幫助!

一、交換機訪問控制安全配置

1、對交換機特權模式設置密碼盡量採用加密和md5 hash方式

switch(config)#enable secret 5 pass_string

其中 0 Specifies an UNENCRYPTED password will follow

5 Specifies an ENCRYPTED secret will follow

建議不要採用enable password pass_sting密碼,破解及其容易!

2、設置對交換機明文密碼自動進行加密隱藏

switch(config)#service password-encryption

3、為提高交換機管理的靈活性,建議許可權分級管理並建立多用戶

switch(config)#enable secret level 7 5 pass_string7 /7級用戶進入特權模式的密碼

switch(config)#enable secret 5 pass_string15 /15級用戶進入特權模式的密碼

switch(config)#username userA privilege 7 secret 5 pass_userA

switch(config)#username userB privilege 15 secret 5 pass_userB

/為7級,15級用戶設置用戶名和密碼,Cisco privilege level分為0-15級,級別越高許可權越大

switch(config)#privilege exec level 7 commands

/為7級用戶設置可執行的命令,其中commands可以根據分配給用戶的許可權自行定義

4、本地console口訪問安全配置

switch(config)#line console 0

switch(config-line)#exec-timeout 5 0 /設置不執行命令操作的超時時間,單位為分鍾和秒

switch(config-line)#logging synchronous

/強制對彈出的干擾日誌信息進行回車換行,使用戶輸入的命令連續可見

設置登錄console口進行密碼驗證

方式(1):本地認證

switch(config-line)#password 7 pass_sting /設置加密密碼

switch(config-line)#login /啟用登錄驗證

方式(2):本地AAA認證

switch(config)#aaa new-model /啟用AAA認證

switch(config)#aaa authentication login console-in group acsserver local

enable

/設置認證列表console-in優先依次為ACS Server,local用戶名和密碼,enable特權密碼

switch(config)#line console 0

switch(config-line)# login authentication console-in

/調用authentication設置的console-in列表

5、遠程vty訪問控制安全配置

switch(config)#access-list 18 permit host x.x.x.x

/設置標准訪問控制列表定義可遠程訪問的PC主機

switch(config)#aaa authentication login vty-in group acsserver local

enable

/設置認證列表vty-in, 優先依次為ACS Server,local用戶名和密碼,enable特權密碼

switch(config)#aaa authorization commands 7 vty-in group acsserver local

if-authenticated

/為7級用戶定義vty-in授權列表,優先依次為ACS Server,local授權

switch(config)#aaa authorization commands 15 vty-in group acsserver local

if-authenticated

/為15級用戶定義vty-in授權列表,優先依次為ACS Server,local授權

switch(config)#line vty 0 15

switch(config-line)#access-class 18 in /在線路模式下調用前面定義的標准ACL 18

switch(config-line)#exec-timeout 5 0 /設置不執行命令操作的超時時間,單位為分鍾和秒

switch(config-line)#authorization commands 7 vty-in /調用設置的授權列表vty-in

switch(config-line)#authorization commands 15 vty-in

switch(config-line)#logging synchronous

/強制對彈出的干擾日誌信息進行回車換行,使用戶輸入的命令連續可見

switch(config-line)#login authentication vty-in

/調用authentication設置的vty-in列表

switch(config-line)#transport input ssh

/有Telnet協議不安全,僅允許通過ssh協議進行遠程登錄管理

6、AAA安全配置

switch(config)#aaa group server tacacs+ acsserver /設置AAA伺服器組名

switch(config-sg-tacacs+)#server x.x.x.x /設置AAA伺服器組成員伺服器ip

switch(config-sg-tacacs+)#server x.x.x.x

switch(config-sg-tacacs+)#exit

switch(config)# tacacs-server key paa_string /設置同tacacs-server伺服器通信的密鑰

二、交換機網路服務安全配置

禁用不需要的各種服務協議

switch(config)#no service pad

switch(config)#no service finger

switch(config)#no service tcp-small-servers

switch(config)#no service udp-small-servers

switch(config)#no service config

switch(config)#no service ftp

switch(config)#no ip http server

switch(config)#no ip http secure-server

/關閉http,https遠程web管理服務,默認cisco交換機是啟用的

三、交換機防攻擊安全加固配置

MAC Flooding(泛洪)和Spoofing(欺騙)攻擊

預防方法:有效配置交換機port-security

STP攻擊

預防方法:有效配置root guard,bpguard,bpfilter

VLAN,DTP攻擊

預防方法:設置專用的native vlan;不要的介面shut或將埠模式改為access

DHCP攻擊

預防方法:設置dhcp snooping

ARP攻擊

預防方法:在啟用dhcp snooping功能下配置DAI和port-security在級聯上層交換機的trunk下

switch(config)#int gi x/x/x

switch(config-if)#sw mode trunk

switch(config-if)#sw trunk encaps dot1q

switch(config-if)#sw trunk allowed vlan x-x

switch(config-if)#spanning-tree guard loop

/啟用環路保護功能,啟用loop guard時自動關閉root guard

接終端用戶的埠上設定

switch(config)#int gi x/x/x

switch(config-if)#spanning-tree portfast

/在STP中交換機埠有5個狀態:disable、blocking、listening、learning、forwarding,只有處於forwarding狀態的埠才可以發送數據。但需經過從blocking-->listening

15s,listening-->learning 15s,learning-->forwarding 20s

共計50s的時間,啟用portfast後將直接從blocking-->forwarding狀態,這樣大大縮短了等待的時間。

說明:portfast僅適用於連接終端或伺服器的交換機埠,不能在連接交換機的埠上使用!

switch(config-if)#spanning-tree guard root

/當一埠啟用了root

guard功能後,當它收到了一個比根網橋優先值更優的.BPDU包,則它會立即阻塞該埠,使之不能形成環路等情況。這個埠特性是動態的,當沒有收到更優的包時,則此埠又會自己變成轉發狀態了。

switch(config-if)#spanning-tree bpfilter enable

/當啟用bpfilter功能時,該埠將丟棄所有的bp包,可能影響網路拓撲的穩定性並造成網路環路

switch(config-if)#spanning-tree bpguard enable

/當啟用bpguard功能的交換機埠接收到bp時,會立即將該埠置為error-disabled狀態而無法轉發數據,進而避免了網路環路!

注意:同時啟用bpguard與bpfilter時,bpfilter優先順序較高,bpguard將失效!

廣播、組播風暴控制設定

switch(config-if)#storm-control broadcast level 10 /設定廣播的閥值為10%

switch(config-if)#storm-control multicast level 10 /設定組播的閥值為10%

switch(config-if)#storm-control action shutdown / Shutdown this interface

if a storm occurs

or switch(config-if)#storm-control action trap / Send SNMP trap if a storm

閱讀全文

與思科配置區域網命令相關的資料

熱點內容
下班之後的程序員 瀏覽:69
檢測支持ssl加密演算法 瀏覽:340
衢州發布新聞什麼APP 瀏覽:80
中國移動長沙dns伺服器地址 瀏覽:249
wifi密碼加密了怎麼破解嗎 瀏覽:596
linux命令cpu使用率 瀏覽:67
linux實用命令 瀏覽:238
傳奇引擎修改在線時間命令 瀏覽:109
php取域名中間 瀏覽:897
cad命令欄太小 瀏覽:830
php開發環境搭建eclipse 瀏覽:480
qt文件夾名稱大全 瀏覽:212
金山雲伺服器架構 瀏覽:230
安卓系統筆記本怎麼切換系統 瀏覽:618
u盤加密快2個小時還沒有搞完 瀏覽:93
小米有品商家版app叫什麼 瀏覽:94
行命令調用 瀏覽:436
菜鳥裹裹員用什麼app 瀏覽:273
窮查理寶典pdf下載 瀏覽:514
csgo您已被禁用此伺服器怎麼辦 瀏覽:398