set trigger backup up set gre generic on
When the command:
set generic gre tunnel-source <ifname>
is used, it is necessary that the specified interface is active, so it is desirable that activation is made
by trigger commands, rather than autocmd.
It is possible to enable transmission of keep-alive packets by using the commands:
set gre generic keepalive-intval N
set gre generic keepalive-retries K
where the keep-alive interval and the number of trials before the tunnel is declared out of service,
are specified.
Even if transmission is not enabled, Imola always replies to any keep-alive packets received.
GRE TRIGGERS CONFIGURATION
When the transmission of keep-alive messages is enabled, it is possible to configure triggers,
which will be executed when there is a change of status of the tunnel interface. For example
set trigger gre up ip route del 192.168.1.0/24 dev atm0
set trigger gre up ip route add 192.168.1.0/24 dev tunnel 0
set trigger gre down ip route del 192.168.1.0/24 dev tunnel 0
set trigger gre down ip route add 192.168.1.0/24 dev atm0
with which it is established that the route towards the network 192.168.1.0/24 must be set on the
tunnel interface tun0 when it is active, and on the atm0 interface when the tunnel is not active.
GRE CONFIGURATION THROUGH CREATE-TUNNEL COMMAND
A GRE tunnel is configurable by using the command create-tunnel as in the following example:
create-tunnel tunnel 0 source 10.10.1.1 destination 10.10.2.2
address 172.16.1.2/30 peer 172.16.1.1/30 mtu 1400 key 1
The first argument (tun0) is the name of the tunnel interface.
As value of the source option the name of the physical interface can be specified:
create-tunnel tunnel 0 source ppp0 destination 10.10.2.2
address 172.16.1.2/30 peer 172.16.1.1/30 mtu 1400
The key parameter is optional.
A maximum of 100 tunnels are configurable. The name of the interface must be different for each
of them.
In order to remove a tunnel the command is:
destroy-tunnel tunnel 0.