2012年12月4日 星期二

Fortigate-300A 韌體升級 - Part2

將升級過程遇到的一些問題及解決過程做個紀錄  (現在暫時憑記憶作筆記,內容有些會有誤)

原始版本 : Fortigate-300A 4.0 MR1-Patch10

1. 先將 NB 直接接上防火牆並用 WEB GUI 登入。

2. 從韌體版本下方的按鈕按更新後選擇 MR2 的檔案,按下確認後,
    就會開始更新並自動重開機。

**問題**     自動重開後,就無法進入 WEB,從 Console 進入發現設定被清空還原至出廠狀態

開始解決 :

1.從手冊上,port 1 預設 192.168.1.99/24 ,將 NB 改成 192.168.1.100/24,ping 成功,但是
   仍然無法進入 WEB。

2.從機器前面板還原至出廠預設值,依舊 ping 成功,WEB 失敗。

3.測試另外一組預設 IP,192.168.100.99/24,ping 成功,WEB 失敗。

4.Console 進入,原廠預設帳號 : damin ,密碼 : (空白)

5.輸入指令 :
      #config system interface

      #edit port1

      #acc http https            -- 開啟 port 1 的 WEB 功能

      #end

      #show system interface       -- 確認 port 1 的 https 有開啟

6.問題無解決,只好刪除韌體並使用 TFTP 重新載入。

步驟 :

一、機器關閉電源重新開機,在開機中跑出 "Enter any key....." 時,按下空白鍵。

二、按 G 選擇刪除韌體。

三、按 E 從 TFTP 載入韌體,先輸入 TFTP Server IP (NB的IP),第二空格按 ENTER 跳過,
       接著輸入韌體名稱,包含副檔名,版本為 MR2-Patch1。

四、更新完後選擇 D ,使用預設的設定。

等機器重開機完後,使用 192.167.1.100/24,連上 port 1,登入 https://192.168.1.99 成功。


更新至最新版本韌體 :

1. 重複動作更新自動重開即可,設定檔回復後,就算升級韌體設定也不會消失

2.經過測試從 MR2-Patch1 > Patch4 > Patch7 > Patch10 > Patch13 ,一次跳過 2個更新
   可以正常使用,跳再多則無法保證。( 原廠建議一次最多跳 2、3個版本 )


結論 : 結果還是不知道是 MR2 這版本檔案有問題,還是因為從 MR1 轉到 MR2 的關係
          才會有問題,只能等以後有機會再來測試。

Fortigate-300A 韌體升級

紀錄升級 Fortigate-300A 防火牆的些過程,它的授權已經過期,要先上官網延長授權。

先到官網 http://www.fortinet.com 的下方進入支援網頁


在支援網站選擇 Reqister/Renew

登入帳號密碼

輸入 Contract Registration Code , 這在授權書上會有
接下來再輸入機器的序號,FG300Axxxxxxxxxx 等16碼,這在機器背面的貼紙上。(因已先註冊完成所以無附圖)

中間會跳出同意書按確認後,即授權成功。


之後選擇 Manage/View Products ,可以看見帳號下有哪些機器註冊

像此圖下方有台 FG300A 的 Firewall ,後面有授權到期時間,點機器進去還可以看到詳細
資料


再來是下載韌體,將指標移到 Download 上,選擇 Firmware Images 選項,然後點選下方的 FortiGate

點選後會連接到 FTP,之後就去各版本尋找機器相對應的韌體

在 4.0 的 MR1 Patch10 下,有著現在使用的韌體

 ***注意事項***      

原廠建議要升級韌體一定要按照順序升上去,如下圖的 MR2,要升級到 Patch13 的話就要從 MR2 、MR2 Patch1 ~~ 一路升級到 MR2 Patch13,中間可以稍微跳個 2、3 號,像是 Patch 1、Patch 3、Patch 5、Patch 8 這樣下去,不過如果時間足夠的話建議還是一個一個升上去比較保險。

2012年11月20日 星期二

20121121 cisco 3560-x series

設定 L3 switch 的 IP 繞送

switch(config) # interface GigabitEthernet 0/1
switch(config-if) # no switchport                                   **--重要--** 切換後才能設定 IP
switch(config-if) # ip address X.X.X.217 255.255.255.252
switch(config-if) # no sh


switch(config) # interface vlan1
switch(config-if) # ip address Y.Y.Y.30 255.255.255.224
switch(config-if) # no sh


switch(config) # interface range GigabitEthernet 0/2 - 24         --一次將 port 2~24 全部 no sh
switch(config-if) # no sh


switch(config) # ip route 0.0.0.0 0.0.0.0 X.X.X.218
switch(config) # ip route Y.Y.Y.0 255.255.255.224 Vlan1     --後面不能直接指定 VLAN 的 IP

switch(config) # ip routing                               **--重要--** 要打這行指令才會開啟 IP 繞送


switch # copy run sta

20121120 Juniper EX-2200

將工作上設定的一些指令貼上,設定一台 L3 switch

set system root-authentication encrypted-password "~!@#"          --設定 root 密碼(自動加密)

set interfaces interface-range lan member-range ge-0/0/1 to ge-0/0/23       --將port1~23加入lan群組

set interfaces interface-range lan unit 0 family ethernet-switching vlan members lan      --將 lan 群組加入名為 lan 的 VLAN 中

set interfaces ge-0/0/0 unit 0 family inet address X.X.X.165/30     --設定 port 0 的 IP

set interfaces vlan unit 16 family inet address Y.Y.Y.190/26       --設定 VLAN 16 的 IP

set routing-options static route 0.0.0.0/0 next-hop X.X.X.166        --預設的靜態路由

set routing-options static route Y.Y.Y.128/26 next-hop Y.Y.Y.190       --返回的路由設定

set vlans default l3-interface vlan.0             --開啟 VLAN 1 的 L3 繞送

set vlans lan vlan-id 16             --建立 VLAN 16

set vlans lan l3-interface vlan.16             --開啟 VLAN 16 的 L3 繞送

2012年7月5日 星期四

Juniper SRX-100

預設帳號 : root    密碼 : (空)    IP : 192.168.1.1

密碼復原 :

1. 正面電源鈕開機,然後快速按下空白鍵,輸入 =》bootd

2. 輸入後再次按下空白鍵,並輸入 Loader > boot -s

3. 看見提示 for/bin/sh 時,輸入 recovery

4. 進入系統後,刪除 root 密碼  root# delete system root-authentication

5. 重新輸入密碼 root# set system root-authentication plain-text-password   ,然後 commit


設定 IP :
#set interfaces vlan unit 0 family inet address 192.168.0.1/24

#set interfaces fe-0/0/0 unit 0 family inet address 192.168.1.1/24

#set interfaces fe-0/0/1 unit 0 family inet address 192.168.0.254/24

** 設定 fe-0/0/1 時,要先刪除原本的 family **
#delete  interfaces fe-0/0/1 unit 0 family


靜態路由 : 

#set routin-options static  route 0.0.0.0/0 next-hop 192.168.0.254


刪除不用的 DHCP :
#delete system services dhcp


防火牆 ( 四行一組 ) ( any-to-any 作為範例 )

設定 trust 至 untrust 的來源 IP : ANY
#set security policies from-zone trust to-zone untrust policy truse-to-untrust match source-address any

設定 trust 至 untrust 的目的 IP : ANY
#set security policies from-zone trust to-zone untrust policy truse-to-untrust match destination-address any

設定 trust 至 untrust 的協定 : ANY ( 如 : ping、https、ssh )
#set security policies from-zone trust to-zone untrust policy truse-to-untrust match application any

設定此項為 permit ( 允許 )
#set security policies from-zone trust to-zone untrust policy truse-to-untrust then permit



設定 untrust 至 trust 的來源 IP : ANY
#set security policies from-zone untrust to-zone trust policy truse-to-untrust match source-address any

設定 untrust 至 trust 的目的 IP : ANY 
#set security policies from-zone untrust to-zone trust policy truse-to-untrust match destination-address any

設定 untrust 至 trust 的協定 : ANY ( 如 : ping、https、ssh )
#set security policies from-zone untrust to-zone trust policy truse-to-untrust match application any

設定此項為 permit ( 允許 ) 
#set security policies from-zone untrust to-zone trust policy truse-to-untrust then permit


開啟 WAN 的 ping 功能
#set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services ping

#set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services https

#set security zones security-zone untrust interfaces fe-0/0/0.0 host-inbound-traffic system-services http

2012年6月5日 星期二

VLAN - trunk 與 access 差別

  • access links : 指的是只屬於一個VLAN,且僅向該VLAN轉發封包的端口,也叫做native VLAN。switches 把封包發送到access-link設備之前, 移去任何的VLAN信息。而且access-link設備不能與其他 VLAN 溝通, 除非封包由 L3 的設備轉送。

  • trunk links : 指的是能夠轉發多個不同VLAN的通信的端口。1條最多可以攜帶1005個VLAN信息。trunk link使你的單獨的 1個端口同時成為數個VLAN的端口。






2012年5月22日 星期二

Juniper

預設帳號 : root
預設密碼 : no

%cli                                   //進入 cli 介面模式
>configure  或  >edit       //進入特權模式
>show system processes extensive     //工作管理員

基本設定
#edit system                                   //進入 system 目錄
#set host-name switch                   //設定主機名稱
#set root-authentication plain-text-password             //設定 root 管理帳號密碼 (之後才能存檔)
#set system login user (name) class super-user       //設定使用者為超級己用者
#set system login user (username) authentication plain-text-password (password)   
//設定使用者密碼

*** 設定密碼時使用 plain-text-password自動進行加密,之後 show 設定時會顯示亂碼***

#commit                                    //儲存設定
#commit check                         //儲存設定並檢查語法是否有錯誤
#rollback 0                                //回到running config,還沒commit的設定全部都會消失
#rollback 1                                //回到上一次commit設定
# show | compare rollback 0   //確認與上次儲存的差異

>request system halt (power-off)   //關機
>request system reboot                   //重新開機

#load factory-authentication            //回復出廠預設值
#set system root-authentication plain-text-password       
//需先設定root密碼再commit才會回復出廠預設值

>request system storage cleanup     //清除硬碟內的檔案及log(設定不變)

#set services telnet                                        //啟動 Telnet 服務
#set services ssh                                           //啟動 SSH 服務
#set services web-management http           //啟動 Web 服務 (使用 Web 介面進行管理)
預設 IP : 192.168.1.1
#set time-zone Asia/Taipei                           //設定時區

#set routing-options static route 0.0.0.0/0 next-hop 192.168.1.254     //指定 DefaultGateway
#set routing-options static route 192.168.10.0/24 next-hop 192.168.1.254  //新增一筆靜態路由
#set interfaces me0 unit 0 family inet address 192.168.1.254            //指定管理介面 IP Address

# set interface ge-0/0/0 unit 0 family inet address.192.168.1.1/24         //設定ip
# delet interface ge-0/0/0 unit 0 family inet address.192.168.1.1/24      //刪除ip


設定 VLAN
#set vlans (name) vlan-id (id)                                                                          //新增一個VLAN (name不能只有數字)
#set interfaces vlan unit (id) family inet address 192.168.1.254/24           //設定VLAN IP
#set vlans (name) l3-interface vlan (id)                                                           //將此VLAN設為L3層
#set interface ge-0/0/0 unit 0 family ethernet-switching vlan members (id)   //將port加入VLAN
#set interface interface-range (name) member-range ge-0/0/0 to ge-0/0/23   
//將多個port加入VLAN


設定 LACP
#set chassis aggregated-devices ethernet device-count 1                             //指定數量
#set interfaces ge-0/0/1 ether-option 802.3ad ae0                                          //指定 LAG port
#set interfaces ge-0/0/2 ether-option 802.3ad ae0                                          //指定 LAG port
#set interfaces ae0 aggregated-ether-options lacp active                              //設定 LACP port
#set interfaces ae0 aggregated-ether-options lacp periodic fast                   //設定 LACP port
#set interfaces ae0 unit 0 family ethernet-switching port-mode access         //設定存取模式
#set interfaces ae0 unit 0 family ethernet-switching vlan members VLAN2   //設定 VLAN
#show interface terse | grep ae                                                                            //檢視 LAG port
#show lacp interface                                                                                              //檢視 LACP



設定 SNMP
#set snmp (community-name) public authorization read-only      //指定為 SNMP Server

#set snmp trap-group trap targets 192.168.1.1                            // 加入 SNMP Server 



 Loader 下更新 OS
一、檔案在 USB 根目錄 ( 沒試過幾次 )

  1.開機時狂按空白鍵進入 loader>

  2.loader> install  file:///jinstall-ex-2200-11.4R2.14-domestic-signed.tgz

二、使用 TFTP Server

  1.開機時狂按空白鍵進入 loader>

  2.loader> set  ipaddr=192.168.100.1

  3.loader> set  netmask=255.255.255.0

  4.loader> set  serverip=192.168.100.10

  5.loader> show                          --確認 IP 有沒有錯誤

  6.loader> install tftp://192.168.100.10/jinstall-ex-2200-11.4R2.14-domestic-signed.tgz



shell

>start shell

進入shell模式,進入後系統為Linux


 MAC 查 port

>ping 192.168.10.40                                              //先 ping IP 收集 arp 表
>show arp | match 192.168.10.40                        //再從 arp 表用 IP 去找 MAC
>show ethernet-switching table | match MAC     //最後從交換表去查 MAC 是從哪個 port 進來的

過程跟 Cisco 教的一樣,只是指令不同而已


硬碟相關
遇到硬碟容量問題

>show system storage          //檢視資料夾容量,可以看到各資料夾容量大小及使用量

>request system storage cleanup          //清空硬碟,除了設定檔之類必要的以外,其他檔案會被清空,連log都會被清掉


virtual-chassis 堆疊

>show virtual-chassis           //檢視機器堆疊的狀態


>request virtual-chassis vc-port set pic-slot 1 port 0 member 0 //設定1/0/0加入member0的堆疊
>request virtual-chassis vc-port delete pic-slot 1 port 0              //刪除堆疊port


#set virtual-chassis member 0 mastership-priority 255   //設定master值(255為最大)


>request virtual-chassis recycle member-id         //回收member-id


Firewall Filter (類似 Cisco ACL)
會設定這東西是因為 2014年2月開始流行起來的 NTP 的 DDOS 攻擊

remote-login ( filter name )
allow-ntp、 deny-ntp ( term name )


set firewall family inet filter remote-login term allow-ntp from source-address 59.124.196.84/32          //設定來源IP

set firewall family inet filter remote-login term allow-ntp from protocol udp          //設定來源協定

set firewall family inet filter remote-login term allow-ntp from destination-port ntp     //目的地port

set firewall family inet filter remote-login term allow-ntp then accep     //符合條件的話允許通過

下列的 term 不同,因為一個 port 只能套用一條 filter ,因此想要設定多項過濾設定就必須用 term 來做區分。

set firewall family inet filter remote-login term deny-ntp from protocol udp     //設定來源協定

set firewall family inet filter remote-login term deny-ntp from destination-port ntp     //目的地port

set firewall family inet filter remote-login term deny-ntp then discard     //符合條件的話就阻擋

set interfaces lo0 unit 1 family inet filter input remote-login     //套用在 lookback 1的 port 上

set system ntp server 59.124.196.84 prefer     //設定 NTP Server IP ,prefer 為優先使用

set system ntp server 192.168.1.254     //設定 NTP Server IP

set system ntp source-address 192.168.1.1     //限制 NTP 的封包來源

上面是 switch 的設定,下列是 route的設定,只差在開頭不同。

set firewall filter ntp term allow-ntp from source-address 59.124.196.84/32
set firewall filter ntp term allow-ntp from protocol udp
set firewall filter ntp term allow-ntp from destination-port ntp
set firewall filter ntp term allow-ntp then accept
set firewall filter ntp term deny-ntp from protocol udp
set firewall filter ntp term deny-ntp from destination-port ntp
set firewall filter ntp term deny-ntp then discard
set firewall filter ntp term not-ntp then accept





2012年3月26日 星期一

FortiGate

Extreme

Enterasys

Router XSR-3150

defule user :
admin   (none)
admin   netadmin
ro         (none)
rw        (none)

>enable
#configure terminal

#show version
#show running-config

(config)#username admin password cleartext (password)
(config)#end

#copy running-config startup-config
#exit






LACP

LACP :  將 2個以上的 port連接在一起作為 Trunk,藉此達到 "加大頻寬"、" 平衡負載"、"網路備援" 的功用。

CISCO :
Switch(config)# interface range fastethernet0/1 -2 
Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 10
Switch(config-if-range)# channel-group 1 mode active
Switch(config-if-range)# end 



Switch(config)# interface channel-group 1
Switch(config-if-range)# ip address 192.168.1.1 255.255.255.252
Switch(config-if-range)# no shutdown
Switch(config-if-range)# end 


show etherchannel port
show etherchannel port-group
show etherchannel protocool