Skip to main content
darrencarr
New Member
Jan 12, 2010 1:48 AM UTC
Question

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

    14 replies

    emnoc
    New Member
    Jan 12, 2010 2:25 AM UTC
    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 ;)
    Translate
    darrencarr
    New Member
    Jan 12, 2010 2:32 AM UTC
    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?
    Translate
    emnoc
    New Member
    Jan 12, 2010 2:48 AM UTC
    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
    Translate
    Maik
    New Member
    Jan 12, 2010 9:39 AM UTC
    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.
    Translate
    Esteemed Contributor III
    Jan 12, 2010 9:48 AM UTC
    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.
    Translate
    rwpatterson
    New Member
    Jan 12, 2010 1:36 PM UTC
    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...
  • Translate
    emnoc
    New Member
    Jan 12, 2010 1:55 PM UTC
    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.
    Translate
    g3rman
    New Member
    Jan 12, 2010 3:59 PM UTC
    See this blog post: http://firewallguru.blogspot.com/2009/11/cli-magic-renaming-existing-interfaces.html
    Translate
    rwpatterson
    New Member
    Jan 12, 2010 4:21 PM UTC
    That' s way too easy!
    Translate
    darrencarr
    New Member
    Jan 12, 2010 10:52 PM UTC
    Guys Thanks for all of the valuable input... As Bob says... far too easy... Cheers Darren
    Translate
    darrencarr
    New Member
    Jan 13, 2010 7:01 AM UTC
    Ok, so out of hours I tried renaming my VLAN interface but got this error? I am using FortiOS 3 MR7 (Patch1) Any ideas? Thanks Darren
    Translate
    rwpatterson
    New Member
    Jan 13, 2010 12:59 PM UTC
    I received the same error renaming my IPSec Phase1-interfaces. Turned out there were OSPF interfaces attached which couldn' t be renamed. Go through the config with a fine toothed comb. Search under the old name and see what shows up. Something may have been left behind. Also compare a before backup and see if anything disappeared after the change.
    Translate
    darrencarr
    New Member
    Jan 13, 2010 10:15 PM UTC
    Hi Bob I experienced the same issue when attempting to rename a IPSec virtual interface in my test lab. In the end I did this in the GUI (renamed the phase 1 and phase 2) components. The tunnel did drop however between the two firewalls. The interface I got the error on is a simple VLAN interface that is connected via physical port 8 on my Fortigate 1000A. I really don' t want to go through the config file renaming all instances of the VLAN interface and then reloading, it must be easier than this. As you can see from the image there are a number of virtual interfaces off the physical port 8. They are: 3 x VLAN interfaces (including one I am trying to rename) 2 x IPSec interfaces (which are based on two of the above VLAN interfaces) The one I am trying to rename has no association with any of the IPSec interfaces? I am confused??? D
    Translate
    Esteemed Contributor III
    Jan 13, 2010 7:34 AM UTC
    I think the safest way would be to edit the config file and rename all old VLAN name occurrence. -J.
    Translate
    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024