[BPI-R3] GRE tunnel problem

Hello everyone

I bought banana Pi R3 and I installed debian11 image , I downloaded from the BPI R3 page on this link

Banana_Pi_BPI-R3#Debian

Until now all is good but I have problem when trying to setup GRE tunnel and IPIP, for example :slight_smile:

CMD: sudo ip tunnel add gre2 mode gre local 192.168.10.57 remote 192.168.1.62 ttl 64 Result: add tunnel “gre0” failed: No such device

Please note all routing works, the problem with config set of gre tunnel

I tiried to :slight_smile:

1- sudo modprobe ip_gre

2- CMD: echo “ip_gre” | sudo tee -a /etc/modules Resualt: ip_gre

3- CMD: sudo modprobe ip_gre Resualt: modprobe: FATAL: Module ip_gre not found in directory /lib/modules/5.15.77

4- I downloaded linux-6.7.3 and from sudo make menuconfig, I enabled “GRE tunnel” from network option , then I execute sudo make -j $(nproc) for Compile Kernel, it takes 2h and the SDcard full but after that gre keep not working .

5- sudo make modules_install

I tried to reboot after all steps but gre not working.

Is there any this I miss ? what should I do for resolve this problem ?

Thank you

are you sure your new kernel is used? you can check with uname -a

as you come from original image the way is maybe different to my debian image (using uEnv.txt in BPI-BOOT partition to set fit).

i do not know gre-tunnel…is this plain generic software or does it require hw specific handling?

Hi frank-w

This is result :

uname -a Linux 5.15.77 #2 SMP Sun Nov 20 19:04:00 CST 2022 aarch64 GNU/Linux

Gre tunnel is: Generic Routing Encapsulation (GRE) tunnel connects two endpoints (a firewall and another appliance) in a point-to-point, logical link. The firewall can terminate GRE tunnels; you can route or forward packets to a GRE tunnel.

I did the same gre tunnel with raspberry pi R4 with debian11 (I download it from debian11 website)and it works fine.

Thank you

So you do not boot your self compiled kernel :stuck_out_tongue: but you have to figure out how your image gets the right kernel to boot…in worst case backup old kernel and rename your one to its old filename

So it sounds like software tunnel without hw offloading…so if you manage to boot your kernel it should work. You can also build an image with my router images repo and replace kernel with one built from my kernel-repo. You can also build kernel first and use pack option and set this tarball as kernelsource for the imagebuilder

echo "board=bpi-r3" >> build.conf
./build.sh importconfig
./build.sh config
./build.sh

choose option 1 (pack) afterwards and copy the tarfile to the folder where you cloned the images-repo

sourcefiles_bpi-r3.conf:

kernelfile=kernelpackage.tar.gz
skipkerneldownload=1
./buildimg.sh bpi-r3 bookworm
1 Like

Thanks for the tip.

Added

CONFIG_NET_IPGRE=m
CONFIG_NET_IPGRE_DEMUX=m

To my image as well

Ok thanks for all of you I will try it And make some updates

It included to mine but the problem is after compiling the config not set

I will try frank image, and find out

Thank you frank I will try it But please note I am building firewall and router similar to openwrt but easer in my opinion. This is why I am adding tunnels and other technologies

Hello I did all of these stepes and the “./build.sh” has been finished, but the gre still not working

please note after the step : ./buildimg.sh bpi-r3 bookworm

it return :

./buildimg.sh bpi-r3 bookworm
needed: python3 parted qemu-user-static debootstrap binfmt-support
please install python3
please install parted
please install qemu-user-static
please install debootstrap
please install binfmt-support
./buildimg.sh: line 57: return: can only `return' from a function or sourced script
sudo: unable to resolve host bpi-r3: Name or service not known
create image for bpi-r3 (arm64) bookworm 6.1
./buildimg.sh: line 77: python3: command not found
ls: cannot access 'sourcefiles_bpi-r3.conf': No such file or directory
sourcefiles_bpi-r3.conf file missing

is there any other way or Idea ?

thank you

You need to install the packages the script tells you to build the image

Fixed the error with return,please pull code again before starting again (after installed packages) and post output in code tags

And it seems you have not created the conf file i’ve posted above

I did with following steps:

I forgate to say when I execute ./buildimg.sh bpi-r3 bookworm it return :slight_smile: -bash: ./buildimg.sh: No such file or directory

I am trying to install python3 but no free space(SD card space 64GB and it seems full now)

why do you start the script from sd? it is designed to run on a host-system (ubuntu x86_64), not on the target board itself

First 2 lines should go into the conf file with filename i posted above the block (replace kernelpackage.tar.gz with filename you get after compiling+packing kernel and copied to the imagebuilder directory)

hello Is there any other way to have an image preconfigured with gre/ipip tunnels and netllink ?

added GRE to bpi-r3 defconfig of my 6.6-main branch, after pipeline is finished you can create image with my image-builder script. make sure you have latest code as i recently changed default kernel from 6.1 to 6.6

Ok thank you Frank, I will try it

Not working, it gets error(Out of memory) after download the git and resolving it, I get error :slight_smile:

 git clone https://github.com/frank-w/BPI-Router-Linux.git
Cloning into 'BPI-Router-Linux'...
remote: Enumerating objects: 11292392, done.
remote: Counting objects: 100% (165773/165773), done.
remote: Compressing objects: 100% (30981/30981), done.
remote: Total 11292392 (delta 134513), reused 165675 (delta 134430), pack-reused 11126619
Receiving objects: 100% (11292392/11292392), 3.70 GiB | 11.95 MiB/s, done.
[ 3815.914374] NetworkManager invoked oom-killer: gfp_mask=0x1100cca(GFP_HIGHUSER_MOVABLE), order=0, oom_score_adj=0
[ 3815.924665] CPU: 3 PID: 999 Comm: NetworkManager Not tainted 5.15.77 #2
[ 3815.931273] Hardware name: Bananapi BPI-R3 (DT)
[ 3815.935789] Call trace:
[ 3815.938224]  dump_backtrace+0x0/0x1c8
[ 3815.941886]  show_stack+0x14/0x28
[ 3815.945194]  dump_stack_lvl+0x64/0x7c
[ 3815.948848]  dump_stack+0x14/0x2c
[ 3815.952152]  dump_header+0x40/0x1a0
[ 3815.955632]  oom_kill_process+0x134/0x1f8
[ 3815.959632]  out_of_memory+0xd0/0x318
[ 3815.963283]  __alloc_pages_slowpath.constprop.166+0x76c/0x9d8
[ 3815.969018]  __alloc_pages+0x1d4/0x250
[ 3815.972757]  pagecache_get_page+0x1d4/0x410
[ 3815.976929]  filemap_fault+0x4d0/0x7b0
[ 3815.980667]  __do_fault+0x30/0x128
[ 3815.984064]  __handle_mm_fault+0x5c0/0x9c8
[ 3815.988152]  handle_mm_fault+0xd0/0x1e8
[ 3815.991980]  do_page_fault+0x134/0x398
[ 3815.995729]  do_translation_fault+0x3c/0x48
[ 3815.999924]  do_mem_abort+0x3c/0xa8
[ 3816.003409]  el0_ia+0x40/0xa8
[ 3816.006399]  el0t_64_sync_handler+0x70/0xb0
[ 3816.010599]  el0t_64_sync+0x158/0x15c
[ 3816.014330] Mem-Info:
[ 3816.016607] active_anon:318 inactive_anon:487421 isolated_anon:0
[ 3816.016607]  active_file:97 inactive_file:0 isolated_file:0
[ 3816.016607]  unevictable:4 dirty:0 writeback:0
[ 3816.016607]  slab_reclaimable:4019 slab_unreclaimable:5189
[ 3816.016607]  mapped:46 shmem:1 pagetables:1401 bounce:0
[ 3816.016607]  kernel_misc_reclaimable:0
[ 3816.016607]  free:5063 free_pcp:33 free_cma:0
[ 3816.051337] Node 0 active_anon:1284kB inactive_anon:1949684kB active_file:276kB inactive_file:4kB unevictable:16kB isolated(anon):0kB isolated(file):0kB mapped:184kB dirty:0kB writeback:0kB shmem:4kB writeback_tmp:0kB kernel_stack:2080kB pagetables:5604kB all_unreclaimable? no
[ 3816.075861] DMA free:20276kB min:20400kB low:22440kB high:24480kB reserved_highatomic:0KB active_anon:1284kB inactive_anon:1949684kB active_file:828kB inactive_file:0kB unevictable:16kB writepending:0kB present:2097152kB managed:2041564kB mlocked:16kB bounce:0kB free_pcp:452kB local_pcp:0kB free_cma:0kB
[ 3816.102695] lowmem_reserve[]: 0 0 0 0
[ 3816.106356] DMA: 0*4kB 6*8kB (U) 622*16kB (U) 188*32kB (UE) 72*64kB (UE) 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 20624kB
[ 3816.118379] 1430 total pagecache pages
[ 3816.122134] 1273 pages in swap cache
[ 3816.125701] Swap cache stats: add 50615, delete 49342, find 593/1241
[ 3816.132049] Free swap  = 172kB
[ 3816.135094] Total swap = 102396kB
[ 3816.138395] 524288 pages RAM
[ 3816.141301] 0 pages HighMem/MovableOnly
[ 3816.145128] 13897 pages reserved
[ 3816.148343] Tasks state (memory values in pages):
[ 3816.153066] [  pid  ]   uid  tgid total_vm      rss pgtables_bytes swapents oom_score_adj name
[ 3816.161714] [    513]     0   513     8162       87    77824      149          -250 systemd-journal
[ 3816.170751] [    877]     0   877     5055      136    61440      443         -1000 systemd-udevd
[ 3816.179633] [    992]   103   992    22024      189    65536        0             0 systemd-timesyn
[ 3816.188686] [    996]   108   996     1778      114    45056        0             0 avahi-daemon
[ 3816.197477] [    997]     0   997     1674       62    40960        0             0 cron
[ 3816.205579] [    998]   104   998     2038      210    45056        0          -900 dbus-daemon
[ 3816.214283] [    999]     0   999    63890      464   122880      300             0 NetworkManager
[ 3816.223246] [   1000]   108  1000     1723       76    40960        1             0 avahi-daemon
[ 3816.232032] [   1013]     0  1013    58493      172    86016        0             0 polkitd
[ 3816.240372] [   1023]     0  1023    55221      244    73728        0             0 rsyslogd
[ 3816.248819] [   1025]     0  1025     3592      198    57344        0             0 systemd-logind
[ 3816.257793] [   1027] 65534  1027     1371       56    40960        0             0 thd
[ 3816.265826] [   1028]     0  1028    98196      247   122880      219             0 udisksd
[ 3816.274187] [   1034]     0  1034     3513      158    57344      129             0 wpa_supplicant
[ 3816.283150] [   1050]     0  1050    23073       30    49152        0             0 rngd
[ 3816.291243] [   1060]     0  1060    61046      215   102400      173             0 ModemManager
[ 3816.300022] [   1132]     0  1132     3030      160    57344        2             0 login
[ 3816.308208] [   1297]     0  1297     3977      291    65536        0             0 systemd
[ 3816.316569] [   1301]     0  1301    42137      471    86016      185             0 (sd-pam)
[ 3816.325012] [   1317]     0  1317     2004        1    45056      402             0 bash
[ 3816.333109] [   1762]     0  1762    21122        1    53248      444             0 git
[ 3816.341117] [   1763]     0  1763     2335        1    45056       55             0 git
[ 3816.349110] [   1764]     0  1764    25271        0    94208     1629             0 git-remote-http
[ 3816.358163] [   1767]     0  1767   553583   482727  4120576    21284             0 git
[ 3816.366182] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-0.slice/session-c1.scope,task=git,pid=1767,uid=0
[ 3816.381889] Out of memory: Killed process 1767 (git) total-vm:2214332kB, anon-rss:1930908kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:4024kB oom_score_adj:0
error: index-pack died of signal 9
fatal: index-pack failed

Why do you download to r3? Don’t you have a build system on more powerful host? If not you can try downloading single branch.