I have two debian machines in difference locations and want to enable routing between the two internal subnets via GRE.
My general routing is already working, meaning any internal machine directs traffic towards the two machines which are connected via GRE and also traffic is send through the tunnel, but when receiving this traffic it's not forwarded into the local subnet anymore.
My configuration on those two machines (not using actual IPs):
Host A (172.19.0.1):
ip tunnel add tun0 mode gre remote 172.20.0.1 local 172.19.0.1
ip addr add 10.10.10.1/24 dev tun0
ip link set tun0 up
Host B (172.20.0.1):
ip tunnel add tun0 mode gre remote 172.19.0.1 local 172.20.0.1
ip addr add 10.10.10.2/24 dev tun0
ip link set tun0 up
echo 1 > /proc/sys/net/ipv4/ip_forward
Pinging either machine on the tunnel interface IPs (10.10.10.1 and 10.10.10.2) works flawlessly, but when I try to ping an internal IP through the tunnel by e.g. running ping 10.100.77.8 -I tun0
on Host A I don't get a response. tcpdump
shows that there is not even one generated which indicates that the packet never hit's the interface after being unpacked by the GRE.
root@hostb:~# tcpdump -i any host 172.19.0.1
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
10:36:10.983403 IP 10.10.10.1 > 172.20.0.1: GREv0, length 88: IP 10.10.10.1 > 10.100.77.8: ICMP echo request, id 20422, seq 8, length 64
10:36:10.983419 IP 10.10.10.1 > 10.100.77.8: ICMP echo request, id 20422, seq 8, length 64
10:36:11.991415 IP 10.10.10.1 > 172.20.0.1: GREv0, length 88: IP 10.10.10.1 > 10.100.77.8: ICMP echo request, id 20422, seq 9, length 64
10:36:11.991427 IP 10.10.10.1 > 10.100.77.8: ICMP echo request, id 20422, seq 9, length 64
I cannot see the ICMP packet coming in on target machine 10.100.77.8. There are no rules in iptables configured while default action is always ACCEPT
.