Skip to main content
Nivedha
Staff
Staff
July 25, 2022

Technical Tip: Changing Interface associated to the Generic Routing Encapsulation (GRE) tunnel

Description

This article describes the changing interface associated to the Generic Routing Encapsulation (GRE) tunnel.

Scope

 FortiGate all models.

Solution

GRE tunnel is always associated to an interface and these are the steps to migrating the GRE tunnel from WAN1 to WAN2 Interface.

 

  • WAN1 -> port1
  • WAN2 -> port3
  • LAN -> port2

 

Initial Configuration.

  1. GRE Tunnel (GRE) is associated to WAN1 interface.

 

Nivedha_0-1658707787367.png

 

 

  1. Select Edit in CLI.

 

 

config system interface 

edit "GRE" 

show 

config system interface 

    edit "GRE" 

        set vdom "root" 

        set ip 192.168.254.2 255.255.255.255 

        set allowaccess ping 

        set type tunnel 

        set remote-ip 192.168.254.1 255.255.255.252 

        set snmp-index 15 

        set interface "port1" 

    next 

 end 

 

Change the interface to port3.

 

 set interface "port3" 

 

This error will occur when changing the interface.

 

Entry not found in datasource. Value parse error before 'port3'.

Command fail. Return code -3.

 

 

  1. To change the interface to port3, run these commands. 

 

 

config system gre-tunnel 

     edit GRE 

     show 

 

config system gre-tunnel 

     edit "GRE" 

        set interface "port1" 

        set remote-gw 10.56.241.131 

        set local-gw 10.56.241.156 

    next 

 end 

 

Change the interface and save it using end command.

 

 (GRE) # set interface port3 

 (GRE) # end 

 

  1. Now the GRE tunnel will be associated to port3.

 

Nivedha_1-1658707787373.png
Related articles:
Technical Tip: Configuring and verifying a GRE tunnel between two FortiGates (static routing)
Configuring IPsec or GRE tunnels on FortiOS
    Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
    Thought Leadership. Security Summit. Thursday, October 8th. Disney's Grand Californian Hotel & SPA, Anaheim, CA.
    Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT