Skip to main content
yktee99
New Member
February 9, 2022
Solved

How to remove a wrong command in Fortigate firewall without rebooting it

  • February 9, 2022
  • 4 replies
  • 29220 views
I have a firewall with a wrong command in the config, I am exploring whether I can correct it without rebooting the firewall. 
 
The following syntax is in the Fortigate firewall. However, the command "set associated-interface "Terminal10" in red is wrong, it should not be there. Can the wrong command be removed by CLI without restoring the firewall config file? Restoration will cause disruption to the firewall operation as there will be rebooting. Appreciate your advice. Thanks.
 
edit "Terminal_192.168.1.1"
        set associated-interface "Terminal10"
        set comment "Terminal_192.168.1.1"
        set subnet 192.168.1.1 255.255.255.255
    next
 
After the removal, it becomes as follows:
edit "Terminal_192.0.132.1"
        set comment "Terminal_192.168.1.1"
        set subnet 192.168.1.1 255.255.255.255
    next
Best answer by yktee99

Debbie_FTNT,

 

Thank you very much, I have tested the solution you provided, It is working. Thanks again.

4 replies

Toshi_Esumi
SuperUser
SuperUser
February 9, 2022

Is this a typo? The second one is a different address object named "Terminal_192.0.132.1", with the same subnet (IP). They can coexist though.

In any case, no reboot is required for any address object changes. You should be able to remove the interface association by "unset associated-interface" under the original address object editting mode. You might need to take it out of policies if it's already used with other objects. After 6.2, you can't mix those objects with specific interface assiation and others without it on the same policy.

 

Toshi

yktee99
yktee99Author
New Member
February 10, 2022

Toshi,

 

Thank you very much for your reply.

 

Spot on, yes, it is a typo.

 

I have multiple "set associated-interface "xxx" commands in my config but I only need to remove one, will the "unset associated-interface" command remove all of them? As I only need to remove only one, can I use unset associated-interface "Terminal10" to remove this specify one instead? Thanks.

Debbie_FTNT
Staff & Editor
Staff & Editor
February 10, 2022

Hey yktee,

if you do this:
config firewall address
edit <object>
unset associated-interface

end

 

that will only remove the associated interface from this one object. The other objects will retain their associated interfaces.

Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!