GRE tunnels not working

Issues related to configuring your network
Post Reply
bighead
Posts: 2
Joined: 2017/10/07 01:34:50

GRE tunnels not working

Post by bighead » 2017/10/07 01:51:58

How do I create a GRE tunnel between to CentOS7 machines?

I've walked through dozen examples from blogs that all seem pretty simple. What am I missing? As the code below shows, the gre7 interface seems up, the routes exist, but i'm not getting any traffic flowing.

Thanks in advance.

Here is my linux version.
$ uname -a
Linux new-host-3 3.10.0-693.el7.x86_64 #1 SMP Tue Aug 22 21:09:27 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

HostA
interface enp0s3 192.168.1.21
gre7 10.10.10.1/24

HostB
interface enp0s3 192.168.1.27
gre7 10.10.10.2/24

HostA

Code: Select all

$ lsmod | grep gre
ip_gre                 22707  0 
ip_tunnel              25163  1 ip_gre
gre                    13144  1 ip_gre
$
$ sudo ip tunnel add gre7 mode gre remote 192.168.1.21 local 192.168.1.27 ttl 255
$ sudo ip link set gre7 up
$ sudo ip addr add 10.10.10.1/24 dev gre7
$ ip route show
default via 192.168.1.1 dev enp0s3 proto static metric 100 
10.10.10.0/24 dev gre7 proto kernel scope link src 10.10.10.1 
192.168.1.0/24 dev enp0s3 proto kernel scope link src 192.168.1.21 metric 100
$ ifconfig gre7
gre7: flags=209<UP,POINTOPOINT,RUNNING,NOARP>  mtu 1476
        inet 10.10.10.1  netmask 255.255.255.0  destination 10.10.10.1
        inet6 fe80::5efe:c0a8:11b  prefixlen 64  scopeid 0x20<link>
        unspec C0-A8-01-1B-00-00-F0-00-00-00-00-00-00-00-00-00  txqueuelen 1  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 46  dropped 0 overruns 0  carrier 46  collisions 0

$ 
HostB

Code: Select all

$ lsmod | grep gre
ip_gre                 22707  0 
ip_tunnel              25163  1 ip_gre
gre                    13144  1 ip_gre
$ sudo ip tunnel add gre7 mode gre remote 192.168.1.27 local 192.168.1.21 ttl 255
$ sudo ip link set gre7 up
$ sudo ip addr add 10.10.10.2/24 dev gre7
$ ip route show
default via 192.168.1.1 dev enp0s3 proto static metric 100 
10.10.10.0/24 dev gre7 proto kernel scope link src 10.10.10.2 
192.168.1.0/24 dev enp0s3 proto kernel scope link src 192.168.1.27 metric 100
ping 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
.


bighead
Posts: 2
Joined: 2017/10/07 01:34:50

Re: GRE tunnels not working

Post by bighead » 2017/10/07 12:35:24

oh the noob.

I was misreading the firewall rules. Once I stopped firewalld then gre worked fine.

Code: Select all

systemctl stop firewalld
note... if you are reading really closely, the original post had the local and remote ip addresses flipped, so I fixed that as well.

Post Reply