Yuri Slobodyanyuk Blog on Information Security 2024年07月23日
Fortigate - switch from NAT to transparent mode error fix
index_new5.html
../../../zaker_core/zaker_tpl_static/wap/tpl_guoji1.html

 

本文详细介绍了在Fortigate从NAT模式切换到透明模式时,如何解决Fortilink接口使用错误的问题。通过逐步指导,展示了如何查找并删除Fortilink配置,最终成功切换操作模式。

🔍 错误分析:尝试将Fortigate的操作模式从NAT更改为透明模式时,系统提示包含管理交换机和switchctl-vlans的VDOM无法更改,需清除相关设置。

🧰 解决步骤:首先使用grep命令查找配置中的Fortilink接口,发现其在四个地方被引用:系统接口、NTP、DHCP服务器和交换机控制策略。

🗑 删除引用:文章详细说明了如何删除DHCP服务器实例、禁用NTP服务器中Fortilink接口的引用,以及如何禁用Fortilink接口本身。

🔄 重试切换:在删除和禁用相关设置后,再次尝试切换操作模式,但发现仍存在问题。最终,通过完全删除Fortilink接口,成功切换到透明模式。

🔙 回退指南:若需要从透明模式切换回NAT模式,文章也提供了相应的配置指令,包括指定默认网关的设备IP地址。

When trying to switch a Fortigate from NAT mode to the Transparent one, we get an error about Fortilink interface being used. The official docs just say to delete Fortilink from all used settings, but not how. This article shows where and how.

The error:

config sys settings

set opmode transparent

set manageip 10.13.13.13/24

Cannot change to Transparent mode because this vdom contains managed switches and switchctl-vlans.Please clear managed-switches, disable fortilink and retry.node_check_object fail! for opmode transparentAttribute 'opmode' value 'transparent' checking fail -7610Command fail. Return code -7610

First thing is to look for fortilink in the config:

# show | grep -i fortilink -fconfig system interface    edit "fortilink" <---        set vdom "root"        set fortilink enable <---        set ip 10.255.1.1 255.255.255.0        set allowaccess ping fabric        set type aggregate        set lldp-reception enable        set lldp-transmission enable        set snmp-index 9    nextendconfig system ntp    set ntpsync enable    set server-mode enable    set interface "fortilink" <---endconfig system dhcp server    edit 1        set ntp-service local        set default-gateway 10.255.1.1        set netmask 255.255.255.0        set interface "fortilink" <---        set vci-match enable        set vci-string "FortiSwitch" "FortiExtender"    nextendconfig switch-controller storm-control-policy    edit "auto-config"        set description "storm control policy for fortilink-isl-icl port" <---        set storm-control-mode disabled    nextend

All in all 4 places: NTP, switch-controller policy, interface itself under config sys interface, and DHCP server.

The cmdb command shows 3 references (misses switch-controller policy):

# diagnose sys cmdb refcnt show system.interface.name fortilinkentry used by table system.dhcp.server:id '1'entry used by child table interface:interface-name 'fortilink' of complex system.ntp:interface.interface-name

Let’s see if deleting 3 of the above will be enough:

Deleting DHCP server instance "1":

# config sys dhcp server(server) # del 1(server) # end

Disabling NTP server which lists fortilink interface (or you can switch interface to any other available):

# config sys ntpFortiGate(ntp) # showconfig system ntp    set ntpsync enable    set server-mode enable    set interface "fortilink"end(ntp) # set server-mode disable(ntp) # end

Disable Fortilink interface to see if enough:

# config sys int(interface) # edit fortilink(fortilink) # set stat down(fortilink) # end

Checking again if there any references left:

FortiGate # diagnose sys cmdb refcnt show system.interface.name fortilinkFortiGate #

Output is empty so we are clear to engage:

Cannot change to Transparent mode because this vdom contains managed switches and switchctl-vlans.Please clear managed-switches, disable fortilink and retry.node_check_object fail! for opmode transparentAttribute 'opmode' value 'transparent' checking fail -7610Command fail. Return code -7610

Nope, no joy, so seems like we have to delete the Fortilink interface altogether (at least in VM Fortigate):

# config sys int(interface) # del fortilink(interface) # end# config sys settings(settings) # set opmode transparent(settings) # set manageip 10.13.13.13/24(settings) # endChanging to TP mode

Done.

BTW, to switch back to NAT mode you will HAVE to specify device and interface ip for the default gateway (or just do exe factoryreset to wipe all config and it will reboot to NAT mode):

config sys settingsset opmode natset device port1set ip 10.13.13.1/24

Follow me on https://www.linkedin.com/in/yurislobodyanyuk/ not to miss what I publish on Linkedin, Github, blog, and more.

Fish AI Reader

Fish AI Reader

AI辅助创作,多种专业模板,深度分析,高质量内容生成。从观点提取到深度思考,FishAI为您提供全方位的创作支持。新版本引入自定义参数,让您的创作更加个性化和精准。

FishAI

FishAI

鱼阅,AI 时代的下一个智能信息助手,助你摆脱信息焦虑

联系邮箱 441953276@qq.com

相关标签

Fortigate NAT模式 透明模式 Fortilink接口 网络配置
相关文章