Support Forum
The Forums are a place to find answers on a range of Fortinet products from peers and product experts.
darrencarr
New Contributor II

Renaming a VLAN interface

Hi All I want to rename a VLAN interface (MCI-INTERNET) but cannot do it in the GUI. Is there anyway you can do this in the CLI? Cheers D
Fortigate 1000A v4.0,build194,100121 (MR1 Patch 4) Fortianalyzer 800B v4.0,build0130 (MR1 Patch 3)
Fortigate 1000A v4.0,build194,100121 (MR1 Patch 4) Fortianalyzer 800B v4.0,build0130 (MR1 Patch 3)
14 REPLIES 14
emnoc
Esteemed Contributor III

config sys int delete it, and recreate it with the new name but way do you want to create it and is it worth it ;)

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
darrencarr
New Contributor II

Hi I want to keep all of the policies going from say Internal -> MCI-INTERNET Deleting it will delete the policies and I will have to add them again, that is correct?
Fortigate 1000A v4.0,build194,100121 (MR1 Patch 4) Fortianalyzer 800B v4.0,build0130 (MR1 Patch 3)
Fortigate 1000A v4.0,build194,100121 (MR1 Patch 4) Fortianalyzer 800B v4.0,build0130 (MR1 Patch 3)
emnoc
Esteemed Contributor III

I want to say you can' t delete it until anything bound to it is 1st removed. It' s fortinet way of checks and balances. So any fwpolicy, dhcp-scopes, protection profiles, etc.. must be removed. But give it a try, back up your config. If it' s just cosmetics, I would leave it alone. This is why I perfer using the wording vlan or vlan-number and just use the alias command options on these virtual interfaces. i.e config sys int edit vlanXXX set alias " give it a name" end

PCNSE 

NSE 

StrongSwan  

PCNSE NSE StrongSwan
Maik
New Contributor II

I want to rename a VLAN interface (MCI-INTERNET) but cannot do it in the GUI. Is there anyway you can do this in the CLI?
from the CLI try config sys interface rename MCI-INTERNET to NEWNAME end dependend on your firmware it might work.
Not applicable

Hi darrencarr , You can also try this way : - Save the config (keep a backup) - Edit it - replace all occurrence of the " current name" with the " new name" - Reboot with the new config That will update all objects referring to the VLAN name. -J.
rwpatterson
Valued Contributor III

I just did that. Pain in the (insert word here)!
  • Backed up the config in plain text
  • Broke out any references to the VLAN into a new file
  • In reverse order, I entered the commands to delete all reference to the VLAN
  • I altered the commands to recreate the VLAN
  • I copied/pasted the commands into the CLI, making corrections as needed Not pretty, but functional...
  • Bob - self proclaimed posting junkie!
    See my Fortigate related scripts at: http://fortigate.camerabob.com

    Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
    emnoc
    Esteemed Contributor III

    from the CLI try config sys interface rename MCI-INTERNET to NEWNAME end dependend on your firmware it might work.  
    That would be interesting to see if it works. I know that the FortiOS will not let you change static entries, but I' m not 100% sure as to what it would do with a VLAN entry which is not static or at least I think it' s not considered static. Worst case, you could use a wordpad and F5 : find or vi editor and %/s and subsitute the variables in the config file and reload it.

    PCNSE 

    NSE 

    StrongSwan  

    PCNSE NSE StrongSwan
    g3rman
    New Contributor

    See this blog post: http://firewallguru.blogspot.com/2009/11/cli-magic-renaming-existing-interfaces.html
    A Real World Fortinet Guide Configuration Examples & Frequently Asked Questions http://firewallguru.blogspot.com
    A Real World Fortinet Guide Configuration Examples & Frequently Asked Questions http://firewallguru.blogspot.com
    rwpatterson
    Valued Contributor III

    That' s way too easy!

    Bob - self proclaimed posting junkie!
    See my Fortigate related scripts at: http://fortigate.camerabob.com

    Bob - self proclaimed posting junkie!See my Fortigate related scripts at: http://fortigate.camerabob.com
    Announcements

    Select Forum Responses to become Knowledge Articles!

    Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.

    Labels
    Top Kudoed Authors