Actually I meant the tunnel is up and running means it's ok and I can ping
Good, so the only issue is the handling of keepalive packets.
I can't figure where is the problem !! how can I know where to search I mean the firewall !! I don't know
I'll summarize again - the way how GRE keepalive works, it needs no special algorithm on the remote side. The sender of the keepalive packet prepares the response, which is a GRE packet the remote side would send if it was to encapsulate an empty payload, and sends that response as a payload of its own GRE packet. So the whole keepalive request packet looks as follows (simplified):
from:A.A.A.A to:B.B.B.B type:GRE payload:{from:B.B.B.B to:A.A.A.A type:GRE payload:{}}
The recipient handles such a packet exactly the same way it would handle any other GRE packet coming from the peer - it extracts the inner GRE packet and forwards it to its destination, which happens to be the sender of the keepalive request packet.
Now on Mikrotik, a different path through the firewall is used for packets generated by the router itself and for packets received from somewhere else, which the router is just forwarding. So if a payload packet coming in via some
in-interface is routed via a GRE tunnel, it is is handled by firewall chain
forward and its
out-interface is the GRE interface; the GRE packet into which that payload one gets encapsulated is sent by the router itself (so it has no
in-interface defined), and is handled by firewall chain
output.
So whereas the keepalive
request packet is handled by chain
output, the keepalive
response packet is handled by chain
forward.
On Cisco, the philosophy of the firewall is different, and I don't know it good enough to suggest anything.
But if you enable the keepalive only at Cisco side, you can make the command line window at Mikrotik side as wide as your screen allows and run
/tool sniffer quick interface=the-gre-interface-name ip-protocol=gre in it, and it should show you packets with come in via the GRE interface and have a source address of the Mikrotik itself, and a destination address of the Cisco - these are the "prepaid" keepalive responses. If you add the cisco-facing interface name to the
interface list in that command (so it will say
interface=the-gre-interface-name,cisco-facing-interface-name), you should see the keepalive request to arrive through the cisco-facing one, the keepalive response coming in via the GRE interface, and the same response leaving through the cisco-facing one. If the second item on this list is missing, the decapsulation doesn't work which is unlikely; if the third one is missing, the firewall at Mikrotik side blocks it, or you use some policy routing which causes the response to be misrouted.