Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Last active September 9, 2021 07:47
Show Gist options
  • Save eclecticmiraclecat/29d467923f12d4088b1ee1b1d17ac48c to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/29d467923f12d4088b1ee1b1d17ac48c to your computer and use it in GitHub Desktop.

enable dhcp on port1

FortiGate-VM64-KVM # config system interface

FortiGate-VM64-KVM (interface) # edit port1

FortiGate-VM64-KVM (port1) # set mode dhcp

FortiGate-VM64-KVM (port1) # next

FortiGate-VM64-KVM (interface) # end

get ip

FortiGate-VM64-KVM # get system interface physical 
== [onboard]
	==[port1]
		mode: dhcp
		ip: 192.168.1.36 255.255.255.0
		ipv6: ::/0
		status: up
		speed: 1000Mbps (Duplex: full)

create local user

FortiGate-VM64-KVM # config user local 

FortiGate-VM64-KVM (local) # edit "user1"
new entry 'user1' added

FortiGate-VM64-KVM (user1) # set type password

FortiGate-VM64-KVM (user1) # set two-factor email

FortiGate-VM64-KVM (user1) # set email-to "user1@example.com"

FortiGate-VM64-KVM (user1) # set passwd "user1password"

FortiGate-VM64-KVM (user1) # next

FortiGate-VM64-KVM (local) # end

create admin user

FortiGate-VM64-KVM # config system admin

FortiGate-VM64-KVM (admin) # edit "admin2"
new entry 'admin2' added

FortiGate-VM64-KVM (admin2) # set accprofile "super_admin"

FortiGate-VM64-KVM (admin2) # set vdom "root"

FortiGate-VM64-KVM (admin2) # set password "pickastrongpassword"

FortiGate-VM64-KVM (admin2) # next

FortiGate-VM64-KVM (admin) # end

create alias

FortiGate-VM64-KVM # config system alias 

FortiGate-VM64-KVM (alias) # edit alias_test
new entry 'alias_test' added

FortiGate-VM64-KVM (alias_test) # set command 'config system interface
> show'

FortiGate-VM64-KVM (alias_test) # end

FortiGate-VM64-KVM # alias alias_test 
config system interface
    edit "port1"
        set vdom "root"
        set mode dhcp
        set allowaccess ping https ssh fgfm
        set type physical
        set snmp-index 1
    next
    edit "ssl.root"
        set vdom "root"
        set type tunnel
        set alias "SSL VPN interface"
        set snmp-index 2
    next
    edit "fortilink"
        set vdom "root"
        set fortilink enable
        set ip 169.254.1.1 255.255.255.0
        set allowaccess ping fabric
        set type aggregate
        set lldp-reception enable
        set lldp-transmission enable
        set snmp-index 3
    next
end

reboot

FortiGate-VM64-KVM # execute reboot
This operation will reboot the system !
Do you want to continue? (y/n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment