Linux – Transparent Ethernet over GRE not forwarding traffic

forwardinggrelinuxroutingtunneling

I am running on Linux 2.6.30.9 and have been trying to setup a transparent ethernet over GRE tunnel. The network topology used is as follows:

enter image description here

I want to bridge PC1 and PC2 using Transparent Ethernet over GRE. RouterA is connected to internet via ppp0 as RouterB. Both internet connections are PPPOE (PPPoEoA PVCs).

So i do:

In RouterA (linux 2.6.30.9):

ip link add testgre type gretap remote 193.152.243.206 local 95.121.205.77 ttl 255
brctl addif br0 testgre
ip link set testgre up

In RouterB (linux 2.6.30.9):

ip link add testgre type gretap remote 95.121.205.77 local 193.152.243.206 ttl 255
brctl addif br0 testgre
ip link set testgre up

Some commands output:

In RouterA (similar output in RouterB):

# ip link show testgre
36: testgre: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1442 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 5f:79:cd:4d:c6:57 brd c1:98:f3:ce:ff:ff

# brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.5f79cd4dc657       no              eth0.5
                                                        eth0.4
                                                        eth0.3
                                                        eth0.2
                                                        wlan0
                                                        testgre

Then i do PING request from PC1 to PC2:

ping 192.168.1.33

I run tcpdump in RouterA and I see the ARP Request frame over ppp0 (pcap file opened with Wirehark):

enter image description here

I run tcpdump in RouterB attached to ppp1 and i see that the ARP Request has arrived, but its not forwarded at L2 to PC2. I dont see the ARP request in PC2.

I try with statics ARP entries but the ICMP Request has the same problem, it is not forwarded to PC2.

There are not ebtables rules. Nor iptables rules (Default action is ACCEPT for ebtables and iptables). Should i add ppp0 to bridge interface or something like that? Any suggestions are welcomed.

Best Answer

The problem was related with the question I asked here on Server Fault IP/GRE compiled in kernel but gre0 interface doesnt exist.

I solved the first question by letting GRE demultiplexer driver in gre.c to register the GRE protocol handler in kernel. But I have found that when a GRE packet arrives GRE handler is not pointing to any ip_gre.c function (GRE demultiplexer driver is suposed to check GRE version in packet and pass the bucket to the right protocol handler but in my case it points NULL).

I commented the piece of code where gre.c registers GRE protocol handler and I have uncommented the piece of code where ip_gre.c registers GRE protocol handler. Now when a GRE packet arrives it is well decapsulated and commited to next layer, now i can ping from PC1 to PC2 without any problem. I think this issue is happening to many people in their embedded devices because I searched with google for the error message https://www.google.com/search?q=ipgre+init%3A+can%27t+add+protocol when IP GRE driver can not start because GRE demultiplexer driver had yet registered a GRE handler and I have found several devices with this error.