OpenWrt Forum Archive

Topic: Ethernet over GRE tunneling

The content of this topic has been archived on 5 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I have been Googling for a bit and I have not found any information about GRE tunneling on openwrt.  I have found a kmod called gre but I do not see any documentation on how to use it.  I am trying to create a virtual interface that is doing ethernet over GRE to a remote gateway.  Any assistance that can point me in the right direction would be helpful.

Hi,

  I'm trying to do the same thing. Any news from your research?

  Maybe we can work together in this subject.

  Thanks ...

Yes, I finally figured it out. My first mistake was not knowing the difference between a tap and a tunnel.  I needed a tap.  Here was my commands to setup a bridge between an Openwrt AP to another gateway.

ip link add greETH type gretap remote {gw IP} local {AP IP}
ip link set dev greETH up
ip link show greETH

hello,

I am using Barrier Breaker openwrt. I need a little help in creating gretap interface and ping between two routers.
I have configured physical interface as a bridge.
by giving in config file "/etc/config/network"

for eth0 I gave
option type 'bridge'

Now I have two AP.Lets call as AP1 AND AP2

AP1
========
br-lan -> has ip address 192.168.188.251

AP2
========
br-lan -> has ip address  192.168.188.250

This is the commands I ran to create gretap interface

IN AP1
=============
ip link add gretap1 type gretap local 192.168.188.251 remote 192.168.188.250
sleep 1
ip link set gretap1 up
sleep 1
ip addr add 10.0.1.1 dev gretap1
sleep 1                         
ip route add 10.0.2.0/24 dev gretap1
sleep 1
brctl addif br-lan gretap1
sleep 1
brctl show
ip link show gretap1



IN AP2
==============
ip link add gretap1 type gretap local 192.168.188.250 remote 192.168.188.251
sleep 1
ip link set gretap1 up
sleep 1
ip addr add 10.0.2.1 dev gretap1   
sleep 1                             
ip route add 10.0.1.0/24 dev gretap1
sleep 1
brctl addif br-lan gretap1
sleep 1
brctl show
ip link show gretap1

IMP OBSERVATION
=============
br-lan MTU was 1462
gretap1 MTU was 1462


Now the tunnel is created, I did ping from AP1 "ping 10.0.2.1". I dont see ping going out!!! After some time one of my AP reboots. Dont know the reason. Not even a crash log is shown in dmesg.



*************************************************************************************



NOW I TRIED IN A DIFFERENT WAY

I removed that option type 'bridge' for eth0
An ran below commands

AP1
=======
ip link add gretap1 type gretap local 192.168.188.251 remote 192.168.188.250
sleep 1
ip link set gretap1 up
sleep 1
ip addr add 10.0.1.1 dev gretap1
sleep 1
ip route add 10.0.2.0/24 dev gretap1
sleep 1


AP2
=======
ip link add gretap1 type gretap local 192.168.188.250 remote 192.168.188.251
sleep 1
ip link set gretap1 up
sleep 1
ip addr add 10.0.2.1 dev gretap1
sleep 1
ip route add 10.0.1.0/24 dev gretap1
sleep 1


IMP OBSERVATION
=============
eth0 MTU was 1500
gretap1 MTU was 1462

I did ping from AP1 "ping 10.0.2.1" ==> IT PINGED (I GRE SEE ENCAPSULATED PACKET)
I did ping from AP2 "ping 10.0.1.1" ==> IT PINGED (I SEE GRE ENCAPSULATED PACKED)

Now my question is what is happening in first case. I need to bridge gretap1. Any one know how to make gretap work in bridge mode ?? Thanks in advance.

-Puneeth Srinivas

(Last edited by puneeth.srinivas on 16 May 2015, 16:21)

Hi,

We are trying to create a GRETAP interface between two operWRT APs
Following are the commands we have used

Host A
---------
ip link add gre11 type gretap local 100.68.168.233 remote 100.72.110.239 ttl 255 nopmtu
ip addr add 10.0.1.1/30 dev gre11
ip link set gre11 up
iptables -I FORWARD -i gre11 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1024
iptables -I FORWARD -o gre11 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1024
ip route add 100.72.110.239  via 10.0.1.2

Host B
---------
ip link add gre11 type gretap local 100.72.110.239 remote 100.68.168.233   ttl 255 nopmtu
ip addr add 10.0.1.2/30 dev gre11
ip link set gre11 up
iptables -I FORWARD -i gre11 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1024
iptables -I FORWARD -o gre11 -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --set-mss 1024
ip route add 100.68.168.233  via 10.0.1.1


But we are not able to ping the tunnel IPs i.e. there is no data transfer across the tunnel end points
i.e, no response for the follwoing pings
Host A:
ping -I gre1110.0.12...no reply
ping -I gre11 100.72.110.239...no reply

tcpdump at gre11 interface shows the ARPs sent, but no response

We want to know if we are missing anything for creating a gretap interface. Any pointers in this regard would be of great help. Thanks

Hi,

use

ip link add gretap1 type gretap local <ip> remote <ip> dev eth3


remember to give
dev <your main interface >

Regards,
PS

Cyrusff => GRE is working fine but the issue is with  EoGRE.
Puneet => We have tried the command you have given earlier but the data transfer thro the tunnel is not successful.


We ( Including Lakkappa) are able to create the tunnel but unable to do the data transfer.

Puneet,
which version of the kernel are you using?
Would it be possible to give  the complete sequence of configuration, it would be great.

Thanks and regards,
Sushanth

Hi,

Method I have mentioned at the last works. you check my post "2015-05-16 20:21:03"
Can I know which openwrt you guys are using ?
I want to know what exactly you guys are trying to do.

Regards,
PS

We were able to identify the issue which we posted last month, i.e, EoGRE tunnel is getting created but there is no data transfer. Issue is that the parameters passed in command line are not parsed properly. Hence the remote IP address passed in the following command is not passed to the kernel module
ip link add gre11 type gretap remote x.x.x.x

We observed that in ip_gre.c file, daddr is '0' and hence data is not sent of gretap interface

In iplink.c, we observed that there is a function to parse the parameters when the type is 'vlan'. But for gretap, we have not seen any code that parses the command line parameters

We are using the Busybox for ip utility

Please let us know if anyone has observed a similar issue. It would be helpful to us if someone can let us know the working IP utility version  that has been used for setting gretap tunnels

when I create a tunnel using the command from the shell, the port is created and ifconfig showing :
gre0 Link encap:Ethernet HWaddr 2E:79:41:BD:0C:88
BROADCAST MULTICAST MTU:1462 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

But when the same command I used in the code runs through system() call, the port is created, but the ifconfig showing:

gre0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-10-07-00-00-00-00-00-00-00-00
NOARP MTU:1476 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

Could you please tell me where I am making mistake?

what happens if we change the tunnel destination on fly. By changes the ip_tunnel.param.dest address??

The discussion might have continued from here.