GRE keepalive with Linux and RouterOS

Posted by eri on Server Fault See other posts from Server Fault or by eri
Published on 2013-10-19T22:17:06Z Indexed on 2013/10/20 3:57 UTC
Read the original article Hit count: 1317

Filed under:
|
|
|
|

I have a Linux host and couple of routerboadrs. I created a GRE tunnel, but Linux does not answer keepalive packages. Then router mark gre connection as unreachable, so I cant send to Linux host from router subnet. If linux sends something into tunnel (ping, etc.) - RouterOS mark connection as reacheble. Second and next packages routed nicely until one minute idle (no traffic).

Tunnel in linux a make in this way:

remote=x.x.x.x
dev=gre21
network=10.21.0.0/16

ip tunnel add ${dev} mode gre remote ${remote} ttl 255
ip addr add 172.16.1.1/24 peer 172.16.1.21 dev ${dev}
ip link set ${dev} up
ip route add ${network} dev ${dev}

And ip l:

14: gre21: <POINTOPOINT,NOARP,UP,LOWER_UP> mtu 1476 qdisc noqueue state UNKNOWN 
    link/gre 0.0.0.0 peer 109.60.170.15

How to set state "running"?

How to keep alive tunnel? Ping in cron?

© Server Fault or respective owner

Related posts about linux

Related posts about ip