Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


gre tunnel setup
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

gre tunnel setup

J1021J1021 Member

I'm trying to setup a grep tunnel between a Linode and a BuyVM VPS. I've been following this guide.

I've ran the following on the BuyVM.

echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf
sysctl -p
iptunnel add gre1 mode gre local BUYVM_PROTECTED_IP remote LINODE_IP ttl 255
ip addr add 192.168.168.1/30 dev gre1
ip link set gre1 up

I've ran the following on the Linode.

iptunnel add gre1 mode gre local BUYVM_UNPROTECTED_IP remote BUYVM_PROTECTED_IP ttl 255
ip addr add 192.168.168.2/30 dev gre1
ip link set gre1 up

So you can see I've tried to configure that the protected IP at BuyVM is tunnelled over the non-protected IP to Linode. Should this work? Currently I am unable to ping each other via the tunnel.

Comments

  • On the linode VPS it should be your linode IP then buyvm protected ip

    Thanked by 1J1021
  • aggressivenetworks said: On the linode VPS it should be your linode IP then buyvm protected ip

    Thank you, that's got it working.

  • Since this is solved :) any ideas on how to create a GRE tunnel when one endpoint has a dynamic IP address? I haven't found any good articles for that case..

  • jemaltz said: Since this is solved :) any ideas on how to create a GRE tunnel when one endpoint has a dynamic IP address? I haven't found any good articles for that case..

    Have the endpoint connect to the other server over OpenVPN and then configure the gre tunnel to the OpenVPN internal IP address?

  • That's kind of an ugly setup - OpenVPN already establishes a GRE tunnel, so you'd have a tunnel-within-a-tunnel, plus encryption overhead (which, I know, can be disabled), and the need for external software. The nice thing about a basic GRE tunnel is its simplicity.

  • SetsuraSetsura Member
    edited January 2015

    @jemaltz said:
    Since this is solved :) any ideas on how to create a GRE tunnel when one endpoint has a dynamic IP address? I haven't found any good articles for that case..

    I've actually been wanting to do this as well, I read somewhere that some iptable versions would allow hostnames instead of an IP as long as it didn't have a port involved in the hostname. I haven't actually had the chance to test or confirm this though. If that doesn't work then I do think what @kcaj said is the only option.

  • @Setsura said:
    I've actually been wanting to do this as well, I read somewhere that some iptable versions would allow hostnames instead of an IP as long as it didn't have a port involved in the hostname. I haven't actually had the chance to test or confirm this though. If that doesn't work then I do think what kcaj said is the only option.

    Come on, there are tons of ways to do things. No hostname lookup? Then look up the hostname first, and pass the IP as a variable. If it's an IP that changes frequently, run a cron job that will look for DDNS changes and update accordingly.

    In theory, it's not too difficult - it just touches on a few things that I'm not super experienced with, so if someone else pieces it together...even better ;)

Sign In or Register to comment.