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

lan2 greyed out in GUI after removing from virtual-switch via CLI

I removed lan2 from the CLI, and noticed that it is now greyed out and missing from Network in the GUI.  Was expecting it to become a physical interface in Network when removed from the virtual-switch.

Original configuration of virtual-switch

config system virtual-switch
edit "lan"
config port
edit "lan2"
next
edit "lan3"
next

end
next
end

I then ran the following commands:

config system virtual-switch
edit "lan"
config port
delete "lan2"

Then I tried to added it back in with:

config system virtual-switch
edit "lan"
config port
edit lan2

It gave an error: 
entry not found in datasource


If I do "edit ?" it shows that lan2 is not available:

*name Physical interface name.
lan3 interface

config system interface does show a lan2

How do I get it to show up as a physical interface via CLI after removing it from the virtual-switch?
How do I re-add it to the virtual-switch from the CLI?

1 Solution
ScotH
New Contributor

Figured it out.  Had to reboot the Fortigate, then lan2 showed up as a physical interface and was no-longer greyed out.

 

Looks like when I ran my commands, I didn't specify end to save the changes.  After a reboot, I used these commands to add lan2 back to the virtual-switch:

config system virtual-switch
edit "lan"
config port
edit "lan2"
next

end

end


and then used these commands to remove it:

config system virtual-switch
edit "lan"
config port
delete "lan2"
end
end

Gui now shows lan2 as a physical interface and not part of the virtual switch.

View solution in original post

4 REPLIES 4
akristof
Staff
Staff

Hello,

If the interface is greyed out, usually it means that it is admin disabled. Can you share with me output:

diag netlink interface list lan2

diag hardware deviceinfo nic lan2

fnsysctl lan2

 

Also this can be useful:

diagnose sys cmdb refcnt show system.interface.name lan2

 

 

Adrian
vsahu
Staff
Staff

Hello,


Can you please check if the lan2 is an alias or if it's the port name itself, as an example .


Physical Interface: 

config system interface
edit "internal6" -------- > Interface name
set vdom "root"
set type physical
set alias "lan"  -------- > Alias
set device-identification enable
set lldp-transmission enable
set role lan
set snmp-index 8
next
end


If I use the alias it will give an error:

 

FG80FP-1 (port) # edit lan
entry not found in datasource

value parse error before 'lan'
Command fail. Return code -3

If I use the name it will take it.

Regards,
Vishal
ScotH
New Contributor

Figured it out.  Had to reboot the Fortigate, then lan2 showed up as a physical interface and was no-longer greyed out.

 

Looks like when I ran my commands, I didn't specify end to save the changes.  After a reboot, I used these commands to add lan2 back to the virtual-switch:

config system virtual-switch
edit "lan"
config port
edit "lan2"
next

end

end


and then used these commands to remove it:

config system virtual-switch
edit "lan"
config port
delete "lan2"
end
end

Gui now shows lan2 as a physical interface and not part of the virtual switch.

Kangming
Staff
Staff

Hi ScotH,

 

We have created a bug internally to investigate this issue, there is a certain flaw in such CLI design that will cause the LAN2 interface to disappear.

Thanks

Kangming

Labels
Top Kudoed Authors