BPI-R3 Can anyone share how to configure debian to work as a router?

not with the vendor kernel works for you sfp…my image is using newer kernel based on mainline 6.1 and is similar to openwrt

but mine was 5.15…

yes, vendors kernel like i said

well so now i booted on the new image.

let’s start configuring…

root@bpi-r3:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1504 qdisc fq_codel state UP group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
    inet 169.254.141.154/16 brd 169.254.255.255 scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::c190:a54a:e437:2ea8/64 scope link
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 5a:5d:95:34:9b:e4 brd ff:ff:ff:ff:ff:ff
    inet 169.254.82.80/16 brd 169.254.255.255 scope global noprefixroute eth1
       valid_lft forever preferred_lft forever
    inet6 fe80::b55a:4ed1:728:6f74/64 scope link
       valid_lft forever preferred_lft forever
4: wan@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
5: lan1@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
6: lan2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
7: lan3@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
8: lan4@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
9: sfp2@eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state LOWERLAYERDOWN group default qlen 1000
    link/ether 8a:85:b6:bf:23:bd brd ff:ff:ff:ff:ff:ff
10: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 00:0c:43:26:60:00 brd ff:ff:ff:ff:ff:ff
11: wlan1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether 82:0c:43:26:60:00 brd ff:ff:ff:ff:ff:ff
root@bpi-r3:~#

how do we create our lan bridge, wan bridge, set the ip address, set the lan dhcp, and finally the firewall

we first need to know how vendor has setup the network…but it seems completely unconfigured…

look if there is something in /etc/systemd/network and /etc/network

ls -lh /etc/systemd/network
ls -lh /etc/network

temporary you can do this like this

ip a a 192.168.0.5/24 dev wan #change to your subnet
ip r add default 192.168.0.1 #change to your routers lan-address
echo "nameserver 192.168.0.1" >> /etc/resolv.conf #also change ip
date -s "2023-09-03 12:00:00 UTC"

then apt update should work
root@bpi-r3:~# ls -lh /etc/network
total 28K
drwxr-xr-x 2 root root 4.0K Sep 22 03:54 if-down.d
drwxr-xr-x 2 root root 4.0K Sep 22 03:54 if-post-down.d
drwxr-xr-x 2 root root 4.0K Sep 22 03:54 if-pre-up.d
drwxr-xr-x 2 root root 4.0K Sep 22 03:54 if-up.d
-rw-r--r-- 1 root root  134 Sep 22 03:50 interfaces
drwxr-xr-x 2 root root 4.0K Dec 15 14:41 interfaces.d
-rw-r--r-- 1 root root  271 Sep 22 03:54 interfaces.new
root@bpi-r3:~#
root@bpi-r3:~#
root@bpi-r3:~#
root@bpi-r3:~# ls -lh /etc/systemd/network
total 0
lrwxrwxrwx 1 root root 9 Sep 22 03:51 73-usb-net-by-mac.link -> /dev/null
lrwxrwxrwx 1 root root 9 Sep 22 03:51 99-default.link -> /dev/null
root@bpi-r3:~#

yes seems unconfigured…

systemctl status systemd-networkd

if it does not return an error we can use the “new” way with systemd-networkd

you’ll find some basic files here

https://github.com/frank-w/BPI-Router-Images/tree/main/conf/generic/etc/systemd/network

or just do the manual steps and maybe put the commands into a script in your homedir for testing

root@bpi-r3:~# systemctl status systemd-networkd
● systemd-networkd.service - Network Service
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; ve>
     Active: inactive (dead)
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
lines 1-5/5 (END)

Maybe hardware-offloading should be something to worry about later.

First get to setup a simple basic router and get used to using debian through ssh.

Of course there is some speed to be gained, but take it one step at a time if you are not so much used to these things…

1 Like

Nice repo of yours @frank-w !!! Im a new owner of a R3-mini. See that you’r still do not include it as a “supported” device in your scripts, even though for me is only a regular R3 without the bridge (switch). Have you ever tried to build DietPI images instead of vanilla debian…?

Thanks in advance ! :wink:

I have a r3mini since yesterday,but have not booted it yet (try to figure out order of uart pins).

Basicly it is r3,but dts is different (not only missing switch) and we need additional driver for the 2g5 phys (eric is working on it but needs official datasheet). In my kernel-repo i have a 6.6-r3mini tree prepared,but not yet tested by myself. Basicly ot uses bpi-r3 board,and packs the new dts as separate config. Atf/Uboot/gpt is currently same

Nice! Will be testing as well… Have one of those that still not on production environment but if I can help with something, count me !

Found this interesting git repo that attempts to build VyOS boot images for BPI-R3, could be interesting if kernel issues are completed and fork efforts with the developer.