2017年10月13日 星期五

Fortigate Virtual ip(VIP)注意事項

底下是原本的設定


原本狀況去ping 192.168.154.254 or 2.2.2.1(模擬外網)都正常。

後來有需求說要從其他的內網(r4之後的網路)要連到Fortigate port1的10.20.20.x/24網段。

所以我就新增VIP與Policy如下圖


然後就發現到外網就斷了。
sniffer發現有去無回

debug看被NAT成VIP的IP了

詢問前輩,問題就出在VIP在建立的時候我選擇Any,這樣是不正確的。
後來就改成只會在Port2出現後就正常了。

VIP 一定match VIP 來進行
如果在建立VIP時選擇any,表示這VIP都可以在任何interface都生效。
就有可能導致source NAT時帶的是VIP的IP,但這IP不是在該介面身上,導致防火牆sniffer有去無回的狀況。

2017年9月24日 星期日

Fortigate Hardware Quick Inspection Package(HQIP)測試

Fortigate 可以Hardware Quick Inspection Package(HQIP)自我檢測硬體。
首先要到https://support.fortinet.com 去下載 HQIP Images。
需要輸入設備序號後會提供下載檔案,如:FGT_600D-HQIP.3.4.2.2190.OUT。

然後Fortigate console接好,開機。
出現"Press any key to display configuration menu..."時按任何按鍵中斷開機程序。
[C]:  Configure TFTP parameters.
[R]:  Review TFTP parameters.
[T]:  Initiate TFTP firmware transfer.
[F]:  Format boot device.
[B]:  Boot with backup firmware and set as default.
[I]:  System configuration and information.
[Q]:  Quit menu and continue to boot.

[H]:  Display this list of options.

Enter C,R,T,F,B,I,Q,or H:

Enter C,R,T,F,B,I,Q,or H:G
Enter remote TFTP server IP address [192.168.1.168]:192.168.1.100
Enter local IP address [192.168.1.64]:192.168.1.111
Enter firmware file name [FGT_600D-HQIP.3.4.2.2190.out]:FGT_600D-HQIP.3.4.2.2190.out

準備好TFTP SERVER上傳FGT_600D-HQIP.3.4.2.2190.out。

###################
Total 20883984 bytes data downloaded.
Verifying the integrity of the firmware image.

Total 65536kB unzipped.
Save as Default firmware/Backup firmware/Run image without saving:[D/B/R]?R
................................................................
Reading boot image 4698251 bytes.
Initializing firewall...


System is started.


Please press Enter to activate this console. 
FORTITEST/FGT6HD3916804672 ~# diag hqip start

打完diag hqip start就會開始檢測,建議開機前就把網路線插好,
如Port1 接 Port2、Port3 接 Port4。
最後就會顯示硬體自我檢測狀況。

2017年9月14日 星期四

Fortigate OSPF 筆記

跟前輩請教依些有關Fortigate OSPF的東西,筆記一下。

1. OSPF底下的Interface,可設可不設。如果有要設定type or interval就需要。

type > network-type point-to-point, point-multipoint  (CLI下修改)

Interval >  hello interval ,dead interval

2.如果要設定如cisco的passive -interface ,就要到CLI下

config router ospf
append passive-interface 介面




2017年9月13日 星期三

cisco router or siwtch 下ACL後,Client無法透過DHCP取得IP問題



DHCP四個階段
DISCOVER、OFFER、REQUEST、Acknowledge


在DISCOVER的時候,會透過UDP 發出Src=0.0.0.0、sPort=68,Dest=255.255.255.255 、dPort=67

所以ACL如果沒注意到,可能就會被擋掉而導致client要不到IP狀況。
這時候ACL就要加入一筆

 permit udp any eq bootpc any eq bootps


2017年6月22日 星期四

Fortigate Forward Traffic Log不多

這問題比較常在小module身上。
在Fortiview有看到LOG,可是在Forward traffic沒看到幾個。

到CLI下,
config log memory filter


set severity information 

(原本是warning)

end


這樣就可以在Forward Traffic底下看到了。

不過可能是因為小module的Fortigate都是把log放在memory,不想浪費太多資源,所以才把紀錄設定的等級調得比較高。


2017年6月21日 星期三

Fortigate link-monitor 5.4

Fortigate 5.2的時候,GUI有個link-monitor的功能,可以偵測線路狀況。
5.4的時候,GUI就找不到了,原廠似乎建議使用WAN link load balancing功能去做。

不過link-monitor在CLI還是存在著,指令如下:

config system link-monitor
    edit "port2"
        set srcintf "port2"
        set server "1.1.1.2"
        set protocol ping
        set gateway-ip 1.1.1.2
        set source-ip 0.0.0.0
        set interval 5
        set timeout 1
        set failtime 5
        set recoverytime 5
        set ha-priority 1
        set update-cascade-interface disable
        set update-static-route enable
        set status enable
    next
    edit "port3"
        set srcintf "port3"
        set server "2.2.2.2"
        set protocol ping
        set gateway-ip 2.2.2.2
        set source-ip 0.0.0.0
        set interval 5
        set timeout 1
        set failtime 5
        set recoverytime 5
        set ha-priority 1
        set update-cascade-interface disable
        set update-static-route enable
        set status enable
    next
end

2017年5月18日 星期四

Cisco Switch Block 445 Port

1.透過Vlan

ACL
ip access-list extended deny445
permit tcp any any eq 445
permit udp any any eq 445

VLAN Map
vlan access-map deny445 10
 match ip address deny445
 action drop
vlan access-map deny445 20
action forward

Applying VLAN Map to VLAN

vlan filter deny445 vlan-list  “Vlan ID” 


2.透過port

ip access-list extended deny445
deny   tcp any any eq 445
deny   udp any any eq 445
permit ip any any

int r f0/1 – X or Gi1/0/1 - X
ip access-group deny445 in