I have an ubuntu server behind a router that I am configuring to have a GRE tunnel to another remote device across the interwebs.
in the config, I add the line:
pre-up iptunnel add tun1 mode gre local [local ip] remote [remote ip] ttl 255
Since the ubuntu server is behind a router, should the [local ip] be the wan ip of the router? or the actual local ip of the ethernet interface i wish the tunnel to connect through?
The router the server sits behind doesn't say anywhere anything about forwarding GRE 47 to lan devices, so I just DMZ'd the server (no ideal in product, but I am just testing using GRE to allow for multicast discovery from 1 subnet to another)
Here is the full script (with local ip set as lan ip of ubuntu server)
auto tun1
iface tun1 inet static
address 10.0.33.1
netmask 255.255.255.0
pre-up iptunnel add tun1 mode gre local 192.168.33.72 remote x.x.x.x ttl 255
up ifconfig tun1 multicast pointopoint 10.0.33.2
post-down iptunnel del tun1
The IP is the IP of the server and not the IP of router.
So let say you have 1.2.3.4/24 configured on eth0, with 1.2.3.1 being the the default gw/router, then the command would be: