【问题标题】:How to set IP address on an interface in Fortigate CLI?如何在 Fortigate CLI 中的接口上设置 IP 地址?
【发布时间】:2020-03-23 23:44:12
【问题描述】:

我想在 Fortinet Fortigate CLI 的 Port1 上设置 IP 地址。

我正在尝试使用以下命令:

set ip 192.168.176.0 255.255.255.0

但我在 255.255.255.0 之前收到以下错误:

IP地址非法值解析错误

我尝试了很多,但无法理解这个问题背后的原因。

【问题讨论】:

    标签: firewall web-application-firewall fortigate


    【解决方案1】:

    配置port1 IP地址和网络掩码。

    例如:

    config system interface
        edit port1
            set ip 192.168.0.100 255.255.255.0
        end
    

    【讨论】:

      【解决方案2】:

      默认情况下,Fortigate 的所有接口都处于 DHCP 模式。因此,您需要将其设为静态并允许访问您想在其中使用的协议。

      这里要注意的另一件事是,如果您尝试将 192.168.176.0/24 分配给接口,那么这是一个无效的 IP,因为它是一个网络地址。

      试试,下面的命令,

      system config interface
        edit port1
          set mode static
          set allowaccess ping http https ssh telnet
          set ip 192.168.176.1/24
          end
      

      【讨论】:

        【解决方案3】:

        您想将“192.168.176.0/24”配置为 FortiGate 接口 IP 地址:

        • 网络ip 192.168.176.0/24 = 192.168.176.0
        • 第一个可用 ip of 192.168.176.0/24 = 192.168.176.1
        • 最后一个可用 ip of 192.168.176.0/24 = 192.168.176.254
        • 广播ip 192.168.176.0/24 = 192.168.176.255

        您不能将网络 ip 地址配置为接口 ip。而是使用可用的 ip。

        system config interface
          edit port1
            set mode static
            set allowaccess ping https ssh
            set ip 192.168.176.1/24
          next
        end
        

        【讨论】:

          猜你喜欢
          • 2013-07-04
          • 1970-01-01
          • 1970-01-01
          • 2023-03-03
          • 2011-01-17
          • 2011-01-18
          • 1970-01-01
          • 2020-10-21
          • 2011-05-07
          相关资源
          最近更新 更多