2011年7月22日 星期五

Extreme 回復出廠值

Extreme XOS沒辦法只回復password,下列的方式會讓所有的設定不見,請詳實告知user。

1. 重開機出現Running POST的時候按住空白鍵。

2. POST完成之後會進入boot rom模式。

3. 在提示符號下輸入:

4. Config abc 後按enter (abc指的是隨便一個檔名,目的在使系統找不到檔案後開機時load default)

5. 輸入Boot後按enter。

系統重開之後就回預設值,所有的設定都會不見。





将仿真终端接到设备的console口上
按住空格键启动设备电源
进入bootrom状态
选择D,恢复出厂缺省值 选择F,重新启动

Extreme 基本操作



2011年7月8日 星期五

cisco 指令

密碼加密
Router(config)#service password-encryption
Router(config)#no service password-encryption
把running-config備份到TFTP Server Router-1#copy running-config tftp:
Address or name of remote host []? 192.168.1.1 **指定TFTP Server 的位置
Destination filename [Router-1-confg]?
從TFTP Server還原running-config
Router-1#copy tftp: running-config Address or name of remote host []? 192.168.1.1
Source filename []? Router-1-confg
Destination filename [running-config]?
備份及還原startup-config Router-1#copy startup-config tftp:
Router-1#copy tftp: startup-config
查看目前IOS的版本 Router-1#show version Cisco IOS Software, 1841 Software (C1841-IPBASE-M), Version 12.3(14)T7, RELEASE SOFTWARE (fc2) **目前載入的IOS版本
System image file is "flash:c1841-ipbase-mz.123-14.T7.bin" **目前IOS的作業系統檔名
顯示目前Flash 記憶體的內容 Router-1#show flash:
System flash directory:
File  Length   Name/status
  2   13832032 c1841-ipbase-mz.123-14.T7.bin
[13832032 bytes used, 50184352 available, 64016384 total]
63488K bytes of processor board System flash (Read/Write)
**目前Flash 記憶體內容已使用了約13.8MB,還剩約50MB可以使用,總共可用空間為64MB。
備份IOS至TFTP Server
Router-1#copy flash: tftp: Source filename []? c1841-ipbase-mz.123-14.T7.bin **指定來源檔名
Address or name of remote host []? 192.168.1.1    **指定TFTP Server 位置
Destination filename [c1841-ipbase-mz.123-14.T7.bin]?  **指定存檔檔名
從TFTP Server 更新新版IOS Router-1#copy tftp: flash:
Address or name of remote host []? 192.168.1.1
Source filename []? c1841-advipservicesk9-mz.124-15.T1.bin
Destination filename [c1841-advipservicesk9-mz.124-15.T1.bin]?
可用指令 show flash: 來查看是否有存入flash,並用指令reload 來載入新的IOS。
重新載入IOS(重新開機)
Router-1#reload
刪除重新Flash 內的IOS Router#delete flash:c1841-ipbase-mz.123-14.T7.bin
**可用show flash 指令來查看flash 的內容 
Delete filename [c1841-ipbase-mz.123-14.T7.bin]?
Delete flash:/c1841-ipbase-mz.123-14.T7.bin? [confirm]


設定VTP(Vlan Trunking Protocol)

VTP(VLAN Trunking Protocol):是VLAN中繼協議,也被稱為虛擬局域網幹道協議。它是思科私有協議。作用是十幾台交換機在企業網中,配置VLAN工作量大,可以使用VTP協議,把一台交換機配置成VTP Server, 其餘交換機配置成VTP Client,這樣他們可以自動學習到server 上的VLAN 信息。
分類: CISCO,資訊相關 — noahchou @ 17:50:22 
VTP模式有3種 服務器模式(Server)客戶端模式(Client)透明模式(Transparent)
服務器模式(Server)
提供VTP消息:包括VLAN ID和名字信息
學習相同域名的VTP消息
轉發相同域名的VTP消息
可以添加、刪除和更改VLAN VLAN信息寫入NVRAM
客戶端模式(Client)
請求VTP消息
學習相同域名的VTP消息
轉發相同域名的VTP消息
不可以添加、刪除和更改VLAN VLAN信息不會寫入NVRAM
透明模式(Transparent)
不提供VTP消息
不學習VTP消息
轉發VTP消息
可以添加、刪除和更改VLAN,只在本地有效 VLAN信息寫入NVRAM
新交換機出廠時的預設配置是預配置為VLAN1,VTP 模式為服務器。
設定VTP-Server及指定VTP Domain
VTP-Server(config)#vtp domain vivotek
Changing VTP domain name from NULL to vivotek
VTP-Server(config)#vtp mode server
Device mode already VTP SERVER.
設定VTP-Client
VTP-Client1(config)#vtp domain vivotek
Changing VTP domain name from NULL to vivotek
VTP-Client1(config)#vtp mode client
Setting device to VTP CLIENT mode.
設定VTP-Transparent
VTP-Trans1(config)#vtp domain vivotek
Changing VTP domain name from NULL to vivotek
VTP-Trans1(config)#vtp mode transparent
Setting device to VTP TRANSPARENT mode.
查看目前VTP 狀況
VTP-Server#sh vtp statu VTP Version                     : 2
Configuration Revision          : 4
Maximum VLANs supported locally : 255
Number of existing VLANs        : 9
VTP Operating Mode              : Server
VTP Domain Name                 : vivotek VTP Pruning Mode                : Disabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0×33 0×54 0×73 0xB3 0×27 0xC4 0x0C 0×48
Configuration last modified by 0.0.0.0 at 3-1-93 00:13:57
Local updater ID is 0.0.0.0 (no valid interface found)


設定VLAN

說明如何新增VLAN
Switch#show vlan 顯示目前VLan狀態
VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup
Switch(config)#vlan 10
Switch(config-vlan)#vlan 20
新增vlan 10,vlan 20
Switch#sh vlan
已新增vlan 10,vlan 20但未有Port 加入
VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/1, Fa0/2, Fa0/3, Fa0/4
                                                Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2 
10   VLAN0010                         active 
20   VLAN0020                         active    
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

Switch(config)#int range fastEthernet 0/1-2
Switch(config-if-range)#switchport access vlan 10 
Switch(config-if-range)#int range fastEthernet 0/3-4
Switch(config-if-range)#switchport access vlan 20
將fastEthernet 0/1-2加入vlan 10,fastEthernet 0/3-4加入vlan 20
Switch#sh vlan
VLAN Name                             Status    Ports
—- ——————————– ——— ——————————-
1    default                          active    Fa0/5, Fa0/6, Fa0/7, Fa0/8
                                                Fa0/9, Fa0/10, Fa0/11, Fa0/12
                                                Fa0/13, Fa0/14, Fa0/15, Fa0/16
                                                Fa0/17, Fa0/18, Fa0/19, Fa0/20
                                                Fa0/21, Fa0/22, Fa0/23, Fa0/24
                                                Gig1/1, Gig1/2 
10   VLAN0010                         active    Fa0/1, Fa0/2
20   VLAN0020                         active    Fa0/3, Fa0/4 
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

設定port-security 功能


cisco 的 port-security功能是用來限制一個 port 只能學習到的指定數量的 MAC 位址,以防止下列情況發生。
  • 使用者帶她自己的 router, switch, hub 來產生自己的小網路。
  • 使用者自己帶一台任意筆記電腦,插入公司的 port 來存取公司網路。
  • 非經許可的安裝 virtual machine 產生多個 mac 使用網路。
設定:port-security
Switch(config)#int range fastEthernet 0/1-24
Switch(config-if-range)#switchport mode access
將Port 運作模式設定為Access Port,作為接末端設備使用
Switch(config-if-range)#switchport port-security
啟動port-security 機制
Switch(config-if-range)#switchport port-security mac-address sticky
設定為自動學習MAC Address,這樣就可以不用手動輸入
Switch(config-if-range)#switchport port-security maximum 1
記錄的MAC Address的數量上限為1筆
switchport port-security violation shutdown
一旦偵測到違反政策時,關閉該Port
重新啟動介面
Switch#clear port-security all
清除port-security資料
Switch(config)#int fastEthernet 0/1
Switch(config-if)#sh
Switch(config-if)#no sh

IOS 毀損

當設備IOS損毀時的處理方式
當無法讀取在flash 中的檔案時,系統會在Rom Monotor Mode 下。
首先可以查看在Rom Monotor Mode 下有什麼指令可以用。
rommon 1 > boot                boot up an external process
confreg             configuration register utility
dir                 list files in file system
help                monitor builtin command help
reset               system reset
set                 display the monitor variables
tftpdnld            tftp image download
unset               unset a monitor variable
這裡會用到的指令為tftpdnld,但是在使用前必須先設定系統參數,
rommon 2 > DEFAULT_GATEWAY=192.168.1.254 rommon 3 > IP_ADDRESS=192.168.1.254 rommon 4 > IP_SUBNET_MASK=255.255.255.0 rommon 5 > TFTP_FILE=c1841-ipbase-mz.123-14.T7.bin rommon 6 > TFTP_SERVER=192.168.1.1
設定完全系統參數後再執行tftpdnld指令
rommon 7 > tftpdnld
          IP_ADDRESS: 192.168.1.254
      IP_SUBNET_MASK: 255.255.255.0
     DEFAULT_GATEWAY: 192.168.1.254
         TFTP_SERVER: 192.168.1.1
           TFTP_FILE: c1841-ipbase-mz.123-14.T7.bin
Invoke this command for disaster recovery only.
WARNING: all existing data in all partitions on flash will be lost!
Do you wish to continue? y/n:  [n]:  y

Cisco設備忘記Password

當設備密碼遺失時的處理方式
  1. 重新啟動設備
  2. 在完成開機前接下「Ctrl」+「Break」或是「Ctrl」+「C」
  3. 查看在Rom Monotor Mode 下有什麼指令可以用。
    rommon 1 > ?
    boot                boot up an external process
    confreg             configuration register utility
    dir                 list files in file system
    help                monitor builtin command help
    reset               system reset
    set                 display the monitor variables
    tftpdnld            tftp image download
    unset               unset a monitor variable
  4. 在2811機種上,可以使用confreg 指令來變更Configuration register值
    rommon 2 > confreg 2142
  5. 重新啟動Router
    rommon 3 > reset
  6. 載入IOS完畢後就會進入Setup Mode,請輸入n,進行手動設定。 Continue with configuration dialog? [yes/no]: n
    Press RETURN to get started!
    Router>
  7. 手動載入startup-config
    Router#copy startup-config running-config
  8. 找出舊密碼
    Router#show running-config
    enable secret 5 $1$mERr$hx5rVt7rPNoS4wqbXKX7m0
    line con 0
    password cisco
    login
    line vty 0 4
    password cisco
    login
  9. 更改Enable 密碼
    Router(config)#enable password cisco
  10. 還原Config-register設定
    Router(config)#config-register 2102
  11. 將running-config寫回startup-config
    Router#copy running-config startup-config
  12. 重新啟動
    Router-1#reload

2011年7月1日 星期五

Splunk Lab 洞穴探索

Splunk 4.0 簡易中文安手冊
Splunk 4.0 Installation Manual_安裝手冊_繁體版.pdf

下載 Splunk。5 分鐘就能完成安裝。 您的應用程式、伺服器、實體、虛擬和雲端裝置會產生許多資料,而 Splunk 可對這些快速移動的所有資料進行收集、編列索引並加以利用。只需要幾分鐘就可以解決應用程式問題及偵測安全事件,而不用再耗上數小時或數天的時間;您可避免服務效能降低或中斷、以較低成本達成規範要求,並深入探索新的商業資訊。 免費下載 Splunk。您可於 60 天內完整使用 Splunk 企業版,且每天可對多達 500 MB 的資料編列索引。60 天試用期之前或之後,您可以轉換為永久使用免費授權或購買企業授權,以繼續使用針對多重使用者企業部署的更多功能。 有任何問題嗎? 請詢問 Splunk 專家