Once again, I've managed to tinker through the problem (but not for too long as the original question and this answer supposes it to be :). I've been through almost a month researching the solution for the problem, and I'll leave it documented here just in case anyone happens to bump at the same problem.
Actually, the loopback interface is really what I knew it to be: an address assigned to a dummy, always up interface on a machine. The connectivity problem between the remote GRE router and my router was due to another problem: GRE keep-alive packets.
It turned out that the remote Cisco router was actually sending me odd GRE-encapsulated packets through the tunnel. These packets encapsulated another GRE packet, and these, on the other hand, carried a protocol number of zero. A quick browse indicated that these packets are GRE keep-alive packets, which are send periodically (in my case, every 10 seconds almost exactly) and, if properly deencapsulated and rerouted by the peer, should be echoed back to the sender, since the innermost destination address contained the sender's source address.
The fact is that the Linux kernel did not properly feed the deencapsulated keep-alive packet again into the routing chain. If it did, the packet would be rerouted back to the sender without further complications. Instead, it delivered the packet to userspace, so that it was possible to write a simple program that listened to such packets in raw mode, and echoed them back to the sender. Running this program and echoing back a couple of packets to the Cisco router, the GRE tunnel went 'up' on the remote side, the PIM routers exchanged hello
s and I finally could listen to the multicast traffic that I expected to listen to.
I've learned a lot from this experience, specially the part that, when messing with obscure protocols (or, at least, obscure protocol features), you can't simply count at all on peer-knowledge. No single network analyst on the remote side could help me in any aspect in this regard, probably because this behavior was undocumented.
If I understood you correctly there's something wrong with your tunnel definition. What you seem to be doing with your current command line is to forward traffic from port 7000 on the current host (I assume it's .224) to port 6999 on .224 itself.
Try this instead:
ssh -N -g -f -C -o CompressionLevel=9 -o Cipher=none eamorr@172.16.1.224 -L 6999:172.16.1.218:7000
Or, if 172.16.1.218:7000 is not directly reachable (I'm guessing it isn't, as you would probably connect to it directly otherwise) you probably mean to connect to 172.16.1.218 instead:
ssh -N -g -f -C -o CompressionLevel=9 -o Cipher=none eamorr@172.16.1.218 -L 6999:localhost:7000
The format for -L
is <localport>:<remotehost>:<remoteport>
. <remotehost>
is relative to the destination host, so in this case localhost
should work.
Note I added -g
in case you want to use the tunnel from a machine different than .224 (I'm assuming you're running ssh on .224).
Best Answer
How to setup a GRE tunnel is described at http://lartc.org/howto/lartc.tunnel.gre.html With iptables you should be able to rewrite packets. Something along the lines of:
iptables -A POSTROUTING -j SNAT -t nat -o gre0 -d 10.y.y.y --to-source 10.q.q.1-10.q.q.254