思科交換機基本配置例項講解

  你還在為不知道 而煩惱麼?接下來是小編為大家收集的 教程,希望能幫到大家。

   的方法

  目 錄

  1、基本概念介紹.... 2

  2、密碼、登陸等基本配置.... 2

  3、cisco裝置埠配置詳解.... 8

  4、vlan的規劃及配置.... 13

  4.1 核心交換機的相關配置.... 13

  4.2 接入交換機的相關配置.... 25

  5、配置交換機的路由功能.... 30

  6、配置交換機的DHCP功能.... 31

  7、常用排錯命令.... 32

  友情連結:

  杭州大金空調售後

   杭州大金空調售後電話

  杭州西門子洗衣機售後維修電話

   杭州西門子洗衣機售後服務電話

  上海夜總會招聘

   上海***

  上海夜總會

   上海夜場

  上海***

   上海招聘

  杭州ktv招聘

   ktv招聘

  1、基本概念介紹

  IOS:

  網際網路作業系統,也就是交換機和路由器中用的作業系統

  VLAN:

  虛擬lan

  VTP:

  VLAN TRUNK PROTOCOL

  DHCP:

  動態主機配置協議

  ACL: 訪問控制列表

  三層交換機:具有三層路由轉發能力的交換機

  本教程中“#”後的藍色文字為註釋內容。

  2、密碼、登陸等基本配置

  本節介紹的內容為cisco路由器或者交換機的基本配置,在目前版本的cisco交換機或路由器上的這些命令是通用的。本教程用的是cisco的模擬器做的介紹,一些具體的埠顯示或許與你們實際的裝置不符,但這並不影響基本配置命令的執行。

  Cisco 3640 R4700 processor revision 0xFF with 124928K/6144K bytes of memory.

  Processor board ID 00000000

  R4700 CPU at 100MHz, Implementation 33, Rev 1.2

  2 Ethernet interfaces

  8 Serial interfaces

  DRAM configuration is 64 bits wide with parity enabled.

  125K bytes of NVRAM.

  8192K bytes of processor board System flash Read/Write

  --- System Configuration Dialog ---

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

  # 此處我們選擇no,不進入他的初始化配置嚮導

  Press RETURN to get started!

  # 選擇no以後,提示你按回車鍵開始,此處我們需要按回車鍵

  *Mar

  1 00:43:56.591: %IP-5-WEBINST_KILL: Terminating DNS process

  *Mar

  1 00:43:58.379: %SYS-5-RESTART: System restarted --

  Cisco IOS Software, 3600 Software C3640-JK9O3S-M, Version 12.314T7, RELEASE SOFTWARE fc2

  Technical Support:

  Copyright c 1986-2006 by Cisco Systems, Inc.

  Compiled Wed 22-Mar-06 21:46 by pwade

  *Mar

  1 00:43:58.411: %SNMP-5-COLDSTART: SNMP agent on host Router is undergoing a cold start

  Router>

  # 等顯示穩定後,出現最初的提示符,注意提示符是“>”,目前所處的狀態稱為使用者模式。

  Router>

  Router>

  Router>en

  # 如果在當前狀態下沒有重複的命令,我們可以用“TAB”鍵來補齊這條命令,主要目的是為了便於閱讀

  Router>enable

  # 從使用者模式user mode進入到特權模式exec mode,注意提示符的變化,提示符變為“#”

  Router#conf t

  Router#configure terminal

  說明:#在特權模式下輸入configure terminal進入全域性配置模式global configuration mode,在這之下輸入的命令叫做全域性命令,一旦輸入,將對整個router產生即時影響。如下,注意提示符的變化:

  Routerconfig#exit

  # 請注意提示符發生了改變,當前的模式據叫做全域性配置模式。

  Router#conf

  *Mar

  1 00:44:291: %SYS-5-CONFIG_I: Configured from console by console t

  # 在輸入命令的過程中,IOS會出現一些即時提示。

  Enter configuration commands, one per line.

  End with CNTL/Z.

  Routerconfig#exit

  # 退出當前的全域性配置模式的命令是exit

  Router#conf t

  # 重新進入到全域性配置模式

  Enter configuration commands, one per line.

  End with CNTL/Z.

  Routerconfig#

  *Mar

  1 00:44:35.591: %SYS-5-CONFIG_I: Configured from console by consolehos

  # 這行是路由器交換機出現的一些即時提示。

  Routerconfig#hostname test

  # 這條命令用來更改當前裝置的名字名字中可包含裝置的樓層、用途等資訊,主要是為了將來便於區分裝置。

  testconfig#

  # 回車後我們就會發現,但前的裝置的名字已經發生了改變,變成了test了。

  testconfig#enable pass

  # 這條命令用來配置裝置的登陸密碼,用tab鍵補齊後,再下一行顯示完整命令。

  testconfig#enable password cisco

  # 我們輸入這臺裝置的登陸密碼為 cisco

  testconfig#end

  # 我們退回到全域性配置模式,校驗一下剛才輸入的密碼

  test#sh r

  # 此命令的完整寫法是show running-start,此處的sh r用的是省略的寫法,因無其他重複的命令所以可以被執行。

  Building configuration...

  Current configuration : 1559 bytes

  !

  version 12.3

  service timestamps debug datetime msec

  service timestamps log datetime msec

  no service password-encryption

  !

  hostname test

  # 注意此處顯示的是我們配置的裝置的名字

  !

  boot-start-marker

  boot-end-marker

  !

  enable password cisco

  # 此處顯示的是剛才我們配置的enable密碼,注意此時是用明文顯示的,有點不安全。

  !

  no aaa new-model

  !

  resource policy

  !

  memory-size iomem 5

  ip subnet-zero

  !

  # 到這一行其實並未全部顯示完配置的內容,我們可以按鍵盤上的任意鍵來終止繼續顯示。在顯示的過程中通過按回車鍵可以逐行顯示,按空格鍵可以一頁一頁的顯示。這些操作可在實際的裝置中體會。

  test#conf t

  # 重新進入到全域性配置模式

  testconfig#service pass

  testconfig#service password-encryption

  # 利用這條命令給密碼加密顯示。

  testconfig#end

  test#sh r

  # 退出到全域性配置模式後,驗證剛才的配置。

  Building configuration...

  Current configuration : 1565 bytes

  !

  version 12.3

  service timestamps debug datetime msec

  service timestamps log datetime msec

  service password-encryption

  !

  hostname test

  !

  boot-start-marker

  boot-end-marker

  !

  enable password 7 070C285F4D06

  # 注意此處剛才明文顯示的密碼已經變成加密顯示了,這樣從一定程度上保證了密碼的安全。

  !

  no aaa new-model

  !

  resource policy

  !

  memory-size iomem 5

  ip subnet-zero

  !

  # 驗證完畢後按任何一個鍵中斷顯示,下面的內容說明終端登陸密碼的配置。

  test#conf t

  Enter configuration commands, one per line.

  End with CNTL/Z.

  testconfig#no service password-encryption

  # 可利用這條命令前面加no來去掉密碼加密功能,cisco的所有命令都可以通過這種方式來禁止。

  testconfig#line con

  testconfig#line console 0

  # 利用這條命令來配置用超級終端登陸時的一些引數。

  testconfig-line#pass

  testconfig-line#password cisco

  # 新增密碼,此處我們配置的密碼為cisco

  testconfig-line#loggi

  testconfig-line#logging ?

  # 在任何情況下如果你忘記了命令的相關引數可以用?來獲得提示和幫助

  synchronous

  Synchronized message output

  testconfig-line#logging sy

  testconfig-line#logging synchronous

  # 在我們進行配置時,IOS會產生一些即時的提示資訊,而這些資訊會衝亂我們的游標顯示,用這條命令可以將游標規矩在下一行,即使出現了一些即時的提示。

  testconfig-line#exit

  # 退出當前console口的引數配置

  testconfig#line vt?

  #

  telnet登陸時相關引數的配置,此處用了?來尋求提示。

  <0-134>

  First Line number

  aux

  Auxiliary line

  console

  Primary terminal line

  tty

  Terminal controller

  vty

  Virtual terminal

  x/y

  Slot/Port for Modems

  testconfig#line vty 0 4

  # 我們配置虛擬終端的0到4,也就是同時允許5個使用者可以telnet到這臺裝置上來。

  testconfig-line#pass

  testconfig-line#password cisco

  # 我們配置telnet時的密碼為cisco,如果此處我們不設定密碼,那麼用telnet來登陸的時候並不會以空密碼登陸,而是會給你提示說:相關密碼沒有設定,禁止登陸。所以我們為了能遠端telnet到這臺裝置,此處的密碼一定要設定好。

  testconfig-line#login

  # 這條命令是允許通過telnet來登入

  testconfig-line#exit

  # 退出當前配置模式到全域性配置模式。

  testconfig#

  testconfig#

  test#conf s

  # 我們在做配置的時候,會出現輸入錯誤的情況,在這種情況下ios會以為你輸入的是一個域名

  Translating "s"...domain server 255.255.255.255

  # 那麼ios會做長時間的搜尋,試圖找到這個域名對應的ip地址.......

  Translating "s"...domain server 255.255.255.255

  # 這段時間是比較長的,那麼我們如何禁用它的這個功能呢?

  % Unknown command or computer name, or unable to find computer address

  test#conf t

  Enter configuration commands, one per line.

  End with CNTL/Z.

  testconfig#no ip domain-lookup

  # 在全域性配置模式下,將ip域名的搜尋功能關閉就可以了。

  testconfig#end

  test#conf

  *Mar

  1 01:40:46.895: %SYS-5-CONFIG_I: Configured from console by console

  test#conf x

  # 將上述功能關閉以後,再有輸入錯誤的情況會直接提示你輸入錯誤。

  ^

  % Invalid input detected at '^' marker.

  test#

  testconfig#ip domain-name 202.102.128.68

  # 如果有必要將裝置配置上DNS功能的話就用這條命令。

  ### 基本配置完畢後我們驗證一下所有的配置###

  test#sh run

  Building configuration...

  Current configuration : 1693 bytes

  !

  version 12.3

  service timestamps debug datetime msec

  service timestamps log datetime msec

  service password-encryption

  # 密碼加密顯示功能開啟

  !

  hostname test

  !

  boot-start-marker

  boot-end-marker

  !

  enable password 7 070C285F4D06

  # 密碼被加密顯示了

  !

  no aaa new-model

  !

  resource policy

  !

  memory-size iomem 5

  ip subnet-zero

  !

  !

  ip cef

  no ip domain lookup

  # 關閉了域名查詢功能

  no ip dhcp use vrf connected

  !

  !

  no ip ips deny-action ips-interface

  !

  no ftp-server write-enable

  !

  no crypto isakmp ccm

  !

  略……

  ip http server

  no ip http secure-server

  ip classless

  !

  control-plane

  !

  line con 0

  exec-timeout 0 0

  password 7 094F471A1A0A

  # 用超級終端登陸的密碼,也同樣被加密顯示

  logging synchronous

  line aux 0

  line vty 0 4

  password 7 00071A150754

  # 用telnet登陸的密碼,也同樣被加密顯示

  login

  !

  !

  end

  test#