Skip to main content
darrencarr
New Member
January 12, 2010
Question

Renaming a VLAN interface

  • January 12, 2010
  • 8 replies
  • 37323 views
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

    8 replies

    emnoc
    New Member
    January 12, 2010
    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 ;)
    darrencarr
    New Member
    January 12, 2010
    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?
    emnoc
    New Member
    January 12, 2010
    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
    Maik
    New Member
    January 12, 2010
    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.
    New Contributor III
    January 12, 2010
    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
    New Member
    January 12, 2010
    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...
  • emnoc
    New Member
    January 12, 2010
    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.
    g3rman
    New Member
    January 12, 2010
    See this blog post: http://firewallguru.blogspot.com/2009/11/cli-magic-renaming-existing-interfaces.html
    rwpatterson
    New Member
    January 12, 2010
    That' s way too easy!
    darrencarr
    New Member
    January 12, 2010
    Guys Thanks for all of the valuable input... As Bob says... far too easy... Cheers Darren
    darrencarr
    New Member
    January 13, 2010
    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
    rwpatterson
    New Member
    January 13, 2010
    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.
    darrencarr
    New Member
    January 13, 2010
    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
    New Contributor III
    January 13, 2010
    I think the safest way would be to edit the config file and rename all old VLAN name occurrence. -J.