So I'm trying to tunnel all traffic from server A to server B through GRE. That works fine. But my problem is, that I want to add an alias interface on server B with the external IP from server A to bind services to it and somehow that doesn't work as I'd expect it to. That's what I do:
Server A
---
External IP: 1.2.3.4
Internal GRE IP: 10.10.10.1
Server B
---
External IP: 1.2.3.5
Internal GRE IP: 10.10.10.2
What I do on server A:
Code:
ip tunnel add gre1 mode gre local 1.2.3.4 remote 1.2.3.5 ttl 255
ip addr add 10.10.10.1/30 dev gre1
ip link set gre1 up
iptables -t nat -A POSTROUTING -s 10.10.10.0/30 -j SNAT --to-source 1.2.3.4
iptables -t nat -A PREROUTING -d 1.2.3.4 -j DNAT --to-destination 10.10.10.2
iptables -A FORWARD -d 10.10.10.2 -j ACCEPT
What I do on server B:
Code:
ip tunnel add gre1 mode gre local 1.2.3.5 remote 1.2.3.4 ttl 255
ip addr add dev gre1 10.10.10.2 peer 10.10.10.1/30
ip link set gre1 up
ip addr add 1.2.3.4 dev eth0 label eth0:99
echo "285 blah" >> /etc/iproute2/rt_tables
ip rule add from 1.2.3.4 table blah
ip route add default via 10.10.10.1 dev gre1 table blah
Where do I fail? If I don't add the eth0 label and stick with routing tables for the internal IPs only, it's working fine.