Skip to main content

FortiGate

想探索新的東西,所以趁過年買了一個二手的FortiGate。
看來有不少坑要踩啊!
我只用了幾個小時就讓自己被拒於管理頁面之外。
唯一能進管理系統的方法只有Console,其他能進去的方法都不小心被我移除權限了。
我連Reset都不能做,因為沒有實體的Reset按鈕啊!!!!
害我隔天跑了三間實體門市,才終於花400+買到一條RJ45轉USB Type-A的轉接頭。
(P.S. 好多服務人員分不清楚USB網卡跟Console線的分別 😭)
終於得以連進去Console中Reset設備了!

Switch

交換器分成三種類型:

  • Hardware Switch
  • Software Switch
  • VLAN Switch

Create Virtual Switch

Virtual Switch是一種硬體交換器。

部份較基礎的型號似乎沒有這個功能。😢

config system global
	set virtual-switch-vlan enable
end
config system virtual-switch
    edit "switch-name"
        set physical-switch "sw0"
        config port
            edit "internal1"
            next
            edit "internal3"
            next
						edit "internal5"
            next
						edit "internal7"
            next
        end
    next
end

Setup DHCP Server for Virtual Switch

在網頁管理頁面中若要為界面啟用DHCP Server,IP Mode要選Manual下方才會出現DHCP Server的選項。 若選DHCP是指IP會由其他設備自動提供IP位址!!

config system dhcp server
    edit 1
        set dns-service default
        set default-gateway 192.168.1.1
        set netmask 255.255.255.0
        set interface "switch-name"
        config ip-range
            edit 1
                set start-ip 192.168.1.2
                set end-ip 192.168.1.254
            next
        end
        set timezone-option default
        config reserved-address
            edit 1
                set ip 192.168.1.2
                set mac 00:00:00:00:00:00
            next
        end
    next
end

Check sessions

get system session list | grep 443

Drop specific session

# Set filter.
diagnose sys session filter src xxx.xxx.xxx.xxx
diagnose sys session filter dport 443

# List applied filter.
diagnose sys session filter

# List sessions applied by filter.
diagnose sys session list

# Clear sessions applied by filter.
diagnose sys session clear

# Clear filter.
diagnose sys session filter clear

Debug Flow

diagnose debug enable
diagnose debug flow filter saddr xxx.xxx.xxx.xxx
diagnose debug flow filter dport 443
diagnose debug flow trace start 100
diagnose debug flow trace stop
diagnose debug flow filter clear

Reference