LinuxQuestions.org

LinuxQuestions.org (http://www.linuxquestions.org/questions/index.php)
-   Linux - Networking (http://www.linuxquestions.org/questions/forumdisplay.php?f=3)
-   -   GRE alias iface (http://www.linuxquestions.org/questions/showthread.php?t=4175454984)

r00t 03-21-2013 07:27 AM

GRE alias iface
 
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.

r00t 04-09-2013 05:34 PM

No one?

r00t 05-21-2013 04:11 PM

Still looking for a solution.

r00t 02-17-2014 06:07 PM

Come on, it's impossible that no one knows a solutions to this one here.

Lantzvillian 02-18-2014 12:40 PM

It make more sense to use routable subnets

r00t 02-18-2014 02:07 PM

How would such a setup look like?


All times are GMT -5. The time now is 03:32 PM.