2017年12月14日 星期四

FortiGate_忘記登入密碼

1、使用Console線連接至FortiGate (Baud Rate 9600,n,8,1)

2、找個可以重開機時間,拔電...重開吧。

3、開機過程...實際Console輸出內容如下...記得,留意機器序號!待會要用到!
FortiGate-80C (16:50-09.27.2011)
Ver:04000009
Serial number:FGT80C1234567888
RAM activation
Total RAM: 1024MB
Enabling cache...Done.
Scanning PCI bus...Done.
Allocating PCI resources...Done.
Enabling PCI resources...Done.
Zeroing IRQ settings...Done.
Verifying PIRQ tables...Done.
Disabling local APIC...Done.
Boot up, boot device capacity: 7640MB.
Press any key to display configuration menu...
......

Reading boot image 1463263 bytes.
Initializing firewall...
FGT80C1234567888 login: maintainer     //帳號為→maintainer
Password: bcpbFGT80C1234567888     //密碼為→bcpb機器序號
Welcome !
★★★此maintainer帳號,只有在剛開完機的30秒內,輸入有效!★★★

FGT80C1234567888 # show system admin     //顯示FortiGate內系統管理員所有帳號。
config system admin
    edit "admin"     //由此行觀察到『admin』為管理員帳號
        set accprofile "super_admin"
        set vdom "root"
        set password ENC SH2b5Q7jvPgTUXfU69eeBdD+ngawGbffesL1wYFahtE8DSVslbNl2JZ5QWfJZA=
    next
end

FGT80C1234567888 # config system admin
FGT80C1234567888 (admin) # edit admin     //編輯,帳號:admin,這位系統管理員
FGT80C1234567888 (admin) # set password 1qaz@WSX     //設定密碼為:1qaz@WSX
FGT80C1234567888 (admin) # end     //退出編輯模式,並儲存設定。
FGT80C1234567888 # show system admin     //再次顯示所有系統管理員帳號。
config system admin
    edit "admin"
        set accprofile "super_admin"
        set vdom "root"
        set password ENC SH2bR5tBaqmgqveBbn4MzZsl9PRqTVkLGR3eB2zmRS12ECgADepdQKaEgClCU0=
    next
end
FGT80C1234567888 # exit     //退出maintainer帳號。


FGT80C1234567888 login: admin     //測試使用admin帳號登入
Password: 1qaz@WSX
Welcome !

FGT80C1234567888 #     //登入成功!





2017年12月13日 星期三

HP 1920G、HP v1910開啟完整指令

《HP 1920G開啟方式》
使用Console、telnet、ssh連入HP 1920G後
輸入底下紅字內容
******************************************************************************
* Copyright (c) 2010-2015 Hewlett-Packard Development Company, L.P.       
* Without the owner's prior written consent,                               
* no decompiling or reverse-engineering shall be allowed.                 
******************************************************************************


Login authentication


Username:admin
Password:
<HP1920G Switch> _cmdline-mode on
All commands can be displayed and executed. Continue? [Y/N]Y
Please input password:Jinhua1920unauthorized
Warning: Now you enter an all-command mode for developer's testing, some commands may affect operation by wrong use, please carefully use it with our engineer's direction.
<HP1920G Switch>

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

《HP v1910開啟方式》
使用Console、telnet、ssh連入HP v1910後
輸入底下紅字內容
******************************************************************************
* Copyright (c) 2010-2015 Hewlett-Packard Development Company, L.P.       
* Without the owner's prior written consent,                               
* no decompiling or reverse-engineering shall be allowed.                 
******************************************************************************


Login authentication


Username:admin
Password:
<HPv1910 Switch> _cmdline-mode on
All commands can be displayed and executed. Continue? [Y/N]Y
Please input password:512900
Warning: Now you enter an all-command mode for developer's testing, some commands may affect operation by wrong use, please carefully use it with our engineer's direction.
<HPv1910 Switch>
------------------------


2017年12月12日 星期二

FortiGate_Switch Mode修改Interface Mode

Jimmy習慣有圖有真像....

大多的文章內容,圖片內,大多會有說明...

原則上,按圖施工,保證成功。


回到正題....

在FortiOS 5.4前,要由Switch Mode修改Interface Mode
原則上,需要將所有跟Internal有關的設定全部刪除!
才能做切換!

如果,設定不能刪,或是Production的環境...
建議,先按照FortiGate  Upgrade Paths 升級到FortiOS5.4版後,就簡單多了!
直接在Internal的Switch內,可以直接將要使用的介面給移出Internal....







2017年12月10日 星期日

FortiGate HA更新韌體

■兩部FortiGate80C,做HA (A-A Mode)

■測試升級韌體。
1、韌體由v5.4.3升級至5.4.4
2、在FortiGate管理頁面,將新版韌體手動上傳,進行更新。
3、此時WebGUI只會有韌體上傳的進度...WebGUI上,看不出更新進度。
4、若接Console線,就能發現,FGT80C-Master會先將韌體丟到FGT80C-Slave
5、等待FGT80C-Slave更新完後,並拿到HA的主控權。
(此時WebGUI畫面,應該會跳到登入畫面)
6、FGT80C-Master開始更新韌體、重新開機。
7、重新開機後,FGT80C-Master會取回HA主控權。

※韌體升級過程中...由內網往外Ping,僅掉2個封包!






2017年8月21日 星期一

※Cisco ASA 5506基本設定:
2017.08.22
▲1、使用Console(9600,n,8,1),連接上Cisco ASA 5506
         預設Enable密碼:無。

▲2、ASA5506# show interface ip brief  //查看,介面名稱,及有那些介面。(下列狀況已使用精靈導引開機設定過。)
Interface                          IP-Address        OK?            Method Status                Protocol
Virtual0                            127.1.0.1          YES unset  up                                      up
GigabitEthernet1/1         unassigned      YES unset  administratively down   down
GigabitEthernet1/2         unassigned      YES unset  administratively down   down
GigabitEthernet1/3         unassigned      YES unset  administratively down   down
GigabitEthernet1/4         unassigned      YES unset  administratively down   down
GigabitEthernet1/5         unassigned      YES unset  administratively down   down
GigabitEthernet1/6         unassigned      YES unset  administratively down   down
GigabitEthernet1/7         unassigned      YES unset  administratively down   down
GigabitEthernet1/8         unassigned      YES unset  administratively down   down
Internal-Control1/1        127.0.1.1          YES unset  up                                     up
Internal-Data1/1             unassigned      YES unset  up                                     down
Internal-Data1/2             unassigned      YES unset  up                                     up
Internal-Data1/3             unassigned      YES unset  up                                     up
Internal-Data1/4             169.254.1.1      YES unset  up                                     up
Management1/1             10.10.10.254    YES unset  down                              down

3、利用Management1/1做為WEB設定連接介面
ASA5506# configure terminal
ASA5506(config)# interface management 1/1
ASA5506(config-if)# nameif  MGMT
ASA5506(config-if)# ip address 10.10.10.254 255.255.255.0
ASA5506(config-if)# no shutdown

4、啟用Web管理功能
ASA5506(config)# http server enable                  //啟用http服務可透過WEB瀏覽器連接https://10.10.10.254下載Cisco ASDM-IDM Launcher管理軟體
ASA5506(config)# http 0.0.0.0 0.0.0.0 MGMT  //不限定那些來源的ip可經由Management1/1介面管理Cisco ASA 5506

Cisco ASDM-IDM Launcher為管理CISCO ASA防火牆常用管理工具。

5、設定Web管理登入帳號、密碼:
ASA5506(config)# username jimmy password 12345678 privilege 15         //設定帳號 Jimmy;密碼:1234578;管理等級:15
ASA5506(config)# write memory         //儲存設定

6、將GigabitEthernet1/1→設定為與中華電信小烏龜連接之WAN接口
ASA5506(config)# interface gigabitEthernet 1/1
ASA5506(config-if)# nameif  WAN    //後面有部份設定會參考到此別名
ASA5506(config-if)# ip address 123.45.67.89 255.255.255.0
ASA5506(config-if)# no shutdown
ASA5506(config)#route WAN 0.0.0.0 0.0.0.0 123.45.67.254 1

7、建立BVI介面並將GigabitEthernet1/2~1/7設定為Layer 2 Switch運作模式
GUIConfigurationDevice SetupInterface SettingsInterfacesAddBridge Group Interface...輸入Interface NameIP addressOKApply
interface gigabitEthernet 1/2~1/7需使用指令模式操作

ASA5506(config)# interface BVI 1
ASA5506(config)# description Jimmy_Subnet
ASA5506(config)#  nameif  Inside    //後面有部份設定會參考到此別名
ASA5506(config)#  security-level 100
ASA5506(config)#  ip address 192.168.100.254 255.255.255.0
ASA5506(config)# interface gigabitEthernet 1/2
ASA5506(config-if)# no nameif
ASA5506(config-if)# bridge-group 1
ASA5506(config-if)# nameif LAN2
ASA5506(config-if)# no shutdown
ASA5506(config)# interface gigabitEthernet 1/3
ASA5506(config-if)# no nameif
ASA5506(config-if)# bridge-group 1
ASA5506(config-if)# nameif LAN3
ASA5506(config-if)# no shutdown
..... interface gigabitEthernet 1/4~7以此類推ASA並無interface range指令。

8GigabitEthernet1/8設定為DMZ
GUIConfigurationDevice SetupInterface SettingsInterfaces點選要設定的介面Edit輸入Interface NameIP addressOKApply
ASA5506(config)# interface GigabitEthernet1/8
ASA5506(config-if)# nameif DMZ
ASA5506(config-if)#  ip address 172.16.100.254 255.255.255.0

9設定NAT使GigabitEthernet1/2~1/7可透過GigabitEthernet1/1(WAN)上網。
GUIConfigurationFirewallNAT RulesAddAdd "Network Object" NAT Rules...
        TypeNetwork
        IP Address192.168.100.0
        Netmask255.255.255.0
        勾選「Add Automatic Address Translation Rules
        TypeDynamic PAT(Hide)
        Translated Addr下拉選WAN
ASA5506(config)# object network Jimmy_Subnet
ASA5506(config-network-object)# subnet 192.168.100.0 255.255.255.0
ASA5506(config-network-object)# description Jimmy_Subnet-NAT-to_WAN
ASA5506(config-network-object)# nat (any,WAN) dynamic interface

10、將BVI介面『Inside』啟用DHCP功能
GUIConfigurationDevice ManagementDHCPDHCP Server滑鼠雙擊Inside輸入相關資訊後OKApply
ASA5506(config)# dhcpd address 192.168.100.100-192.168.100.160 Inside
ASA5506(config)# dhcpd dns 168.95.1.1 8.8.8.8 interface Inside
ASA5506(config)# dhcpd enable Inside

11、允許使用者透過LAN2~7來管理Cisco ASA 5506允許234.56.78.90經由WAN介面管理Cisco ASA 5506
GUIConfigurationDevice ManagementManagement AccessASDM/HTTPS/Telnet/SSH按下ADD新增
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN2
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN3
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN4
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN5
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN6
ASA5506(config)#http 192.168.100.0 255.255.255.0 LAN7
ASA5506(config)#http 234.56.78.90 255.255.255.255 WAN

12、設定時區及NTP Server
GUI:Configuration→Device SetupSystem TimeClockTimeZone→下拉選取→Apply
GUI:Configuration→Device SetupSystem TimeNTPAdd→輸入相關資訊→OKApply
ASA5506(config)#clock timezone CST 8
ASA5506(config)#ntp server 118.163.81.61 source WAN prefer
ASA5506(config)#ntp server 211.22.103.158 source WAN

13、設定可Ping到外部
GUIConfigurationFirewallService Policy→global_policy→EditRule Actions→勾選ICMP選項→OKApply
ASA5506# configure terminal
ASA5506(config)# policy-map ?
        configure mode commands/options:
        WORD < 129 char  policy-map name
        type             Specifies the type of policy-map
ASA5506(config)# policy-map global_policy
ASA5506(config-pmap)# class ?
        mpf-policy-map mode commands/options:
        WORD
        configure mode commands/options:
        WORD < 129 char
ASA5506(config-pmap)# class inspection_default
ASA5506(config-pmap-c)# inspect icmp

14、設定User可透過MGMT介面,SSH管理Cisco ASA5506
GUI:Configuration→Device ManagementManagement AccessASDM/HTTPS/Telnet/SSH→按下ADD新增!
ASA5506(config)# crypto key generate rsa modulus 512
ASA5506(config)# ssh 0.0.0.0 0.0.0.0 MGMT
ASA5506(config)# ssh timeout 5  (單位:分鐘)
ASA5506(config)# aaa authentication ssh console LOCAL

15、設定相關Banner
GUIConfigurationDevice ManagementManagement AccessCommand Line (CLI)Banner
ASA5506(config)#banner exec        ##### A C C E S S - W A R N I N G !#####
ASA5506(config)#banner exec This is a Private computer system. Unauthorized access
ASA5506(config)#banner exec or use is prohibited and only authorized users are permitted.
ASA5506(config)#banner exec
ASA5506(config)#banner exec
ASA5506(config)#banner login                *** W A R N I N G ***
ASA5506(config)#banner login  Unauthorized access prohibited. All access is
ASA5506(config)#banner login  monitored, and trespassers shall be prosecuted
ASA5506(config)#banner login  to the fullest extent of the law.
ASA5506(config)#banner login
ASA5506(config)#banner login
ASA5506(config)#banner motd *** UNAUTHORIZED ACCESS TO THIS DEVICE IS PROHIBITED ! ***
ASA5506(config)#banner motd
ASA5506(config)#banner motd
ASA5506(config)#banner asdm
ASA5506(config)#banner asdm ###################################################
ASA5506(config)#banner asdm                 ***IMPORTANT NOTICES***
ASA5506(config)#banner asdm            You have logged in to a Secure Device!!!
ASA5506(config)#banner asdm         If you are not authorized to access this device,
ASA5506(config)#banner asdm log out immediately or risk possible criminal consequences.
ASA5506(config)#banner asdm ###################################################

16、其它常用指令:
ASA5506# copy running-config startup-config   //儲存設定,指令1
ASA5506# write memory                          //儲存設定,指令2   (指令1、指令2則一用即可。)
ASA5506# show running-config               //顯示目前運作設定
ASA5506# show version                           //顯示版本
ASA5506# show ip address                //顯示各介面IP位置
ASA5506# show interface ip brief     //顯示各介面連接狀態
ASA5506# reload                                  //重新開機。 ※無關機指令!

17、GUI備份設定:
GUICisco ASDM-IML Launcher→Tools→Backup Configurations