[BPI-R64] Imagebuilder R64 ArchlinuxArm, linux-rolling-stable

I guess you need to set dns too.

For the aceipt error: which shell (bash/dash/zsh,…) do you use?

Thanks for reporting the syntax error. I corrected the possible syntax error. Can you remove the buildR64arch folder in total and begin with a fresh new clone? Then test the script unaltered for any syntax errors please.

If successful make the changes.

The

rootfs/etc/systemd/network-AP/10-brlan.network

file needs to look like this:

[Match]
Name=brlan

[Link]
RequiredForOnline=degraded-carrier
#RequiredForOnline=no

[Network]
IPForward=no
Address=10.1.1.4/24
Gateway=10.1.1.1
DNS=8.8.8.8

[BridgeVLAN]
VLAN=1
PVID=1
EgressUntagged=1

There is no [WiFi], you can check here systemd-networkd docs that there is no [WIFI] option in a .network file.

Edit: Just cleaned it up some more, so use the latest commit I commited now.

The first line is

#!/bin/bash

So I would think that he runs it with bash. However, I don’t get an error in that line. I cleaned it up anyway.

while [[ $(mountpoint $rootfsdir) =~  (is a mountpoint) ]]; do
to
while [[ "$(mountpoint $rootfsdir)" =~ "is a mountpoint" ]]; do

Edit: Just cleaned it up some more, so use the latest commit I commited now.

Would re-running the build script erase all the configuring done by the user and replace will a totally fresh install? If that is the case if it possible to allow changing on options that you mention within the Operating System?

Edit:

This seems strange! Needing to be using Arch in-order to run the script to reinstall Arch.

BASH_SOURCE: build.sh Current dir: /home/aaron/Downloads/buildR64arch-main Target device=sdmmc Not running on Bananapi BPI-R64 Not inserted! (Maybe not matching the target device on the card)

Tried running the script on my laptop!

if it possible to allow changing on options that you mention within the Operating System?

First make the changes to ./build.sh (SETUP=“AP”) and brlan.network as described before.

Then execute with the SD card inserted in host computer. Don’t format the SD card, but continue with the next step:

./build.sh -r

It will install packages (already installed), reset network setup (now AP), reset hostapd settings (wifi setup), reset root and user password, set ssh PermitRootLogin yes, and such, but not so much important things anymore.

BASH_SOURCE: build.sh Current dir: /home/aaron/Downloads/buildR64arch-main Target device=sdmmc Not running on Bananapi BPI-R64 Not inserted! (Maybe not matching the target device on the card)

The script outputs Not inserted! If you run the script without arguments, it needs a SD card inserted with successfully installed rootfs, and it can enter chroot on it. This way you can execute commands as if you are running on the BPI-R64. It is described in the readme

The script should run on debian or arch, as stated in the readme. However there seemed to be (at least 1) bug that prevented it from running on a certain environment. I think I have solved that bug, and would be glad to hear from you if it is solved.

Wouldn´t it be better to have one common file for the network settings, etc? I noticed that dns, etc is mention in quite a few file and having the other files referencing once common file would be a easier to edit for information common to all network files for example then having to edit each file individually.

I totally agree, but this is how systemd-networkd is configurated. See:

systemd-networkd.service (www.freedesktop.org)

Then I have two different setups, of which the script will use one, depending on the $SETUP variable. One is located in network-RT and another in network-AP folder. In your case, you only need to concern yourself about the network-AP folder.

You could choose to use netplan, but this is a choice I leave up to the user. Netplan sits as a layer above systemd-networkd or networkmanager. I only make a script that creates the bare minimum with everything functioning. Otherwise the project will get too large for me to maintain. From a working system you can go any direction you like. It is up to the user to setup network via netplan or NetworkManager or ifupdown or iproute2 or any other manager you like, or just stick with systemd-networkd.

Edit: I forgot to mention netctl and ConnMan

@frank-w Did you setup the bridge,network file with:

[BridgeVLAN]
VLAN=100-110

Without PVID and EgressUntagged so that the traffic outside of lanbr0 self port is still tagged?

Oh wait, you used ip to create the bridge… You need the lanbr0 port to not have PVID and Egress set if you attach vlan devices on the vlan-aware bridge. Check with

bridge vlan

Edit: and add vlan id’s 100-110 to the lanbr0 port on the bridge, so this is not blocked. This is missing here: https://lkml.org/lkml/2023/1/21/120 no

Edit2: I believe like so, and I corrected second line 110 to 100.

bridge vlan add vid 100 dev lanbr0 self

ip link add link lanbr0 name lanbr0.100 type vlan id 100

The bridge command without the pvid and untagged switches, so that the traffic from bridge self port leaves with vlan tags untouched and no tags are added when traffic enters bridge via self port (already added by vlan device)

Edit3: you will need to use the bridge vlan add command also on the other port, where the traffic enters the bridge. Then without the self switch.

Perhapse we should start a new topic.

In 10-brlan.network I have

[Match]
Name=brlan

[Link]
RequiredForOnline=degraded-carrier
#RequiredForOnline=no

[Network]
IPForward=no
Address=192.168.1.33/24
Gateway=10.1.1.1
DNS=8.8.8.8

[BridgeVLAN]
VLAN=1
PVID=1
EgressUntagged=1

However, I can not connect to the pi via lan nor are my main network nor the WIFi24 connecting.

See what I posted earlier:

Do you see the difference at the line with Address= ?

Apart from the ip address? No! I must be blind.

Edit:

I tried changing the ip to 10.1.1.4 but still did not work.

Edit 2: when I initially edited the file the ip address was 192.168.5.1 then when I checked the file again manually on my laptop it was 192.168.1.33.

buildR64arch/rootfs/etc/systemd/network-RT/10-brlan.network

Has ip 192.168.5.1. It is for the RouTer setup. You did not post this one in this topic, because it also has [DHCPServer] in the file.

buildR64arch/rootfs/etc/systemd/network-AP/10-brlan.network

Has ip 192.168.1.33

With the script it is copied to SD card. Set SETUP=“AP” and the script copies the one from the network-AP folder.

What finally matters is what’s on the sd card. in:

/etc/systemd/network/10-brlan.network

It should look like the above.

This is what is currently the file:

[Match]
Name=brlan

[Link]
RequiredForOnline=degraded-carrier
#RequiredForOnline=no

[Network]
IPForward=no
Address=10.1.1.4/24
Gateway=10.1.1.1
DNS=8.8.8.8

[BridgeVLAN]
VLAN=1
PVID=1
EgressUntagged=1

Is that in the file in the buildR64arch folder, or is it on the SD card? Did you use the script to get this on the SD card? There are more things to change to setup the network correctly. The script will take care of it, as described above.

When setup is correct, you do need to connect LAN-LAN router AP. All dhcp traffic is forwarded to router.

That is on the sd card. I will try running the build script again.

The AP does not have dhcp server, so you need to attach it to the router, if you connect with automatic IP. It is the easiest setup, on one network to have one dhcp server, which is the router.

When you try to connect (and no router attached) , you need to set the ip on the ethernet/wifi of the laptop manually to 10.1.1.123 or so.

I hope this will help you connect.

Ah! So I need to plug it into the main router first to install software such as a dhcp server then it will work correctly?

if you make a router cascade you have have to make sure using different ip-networks on lan-segments and put a static route for the lan behind r64 in your main-router (or use masquerading (NAT) on “wan”-port of r64)

example:

<public ip>
wan
[main]
lan
<192.168.0.1/24>
| (cable / switch)
<192.168.0.5/24>
wan
[R64]
lan
<192.168.1.1/24>

here you need this static route in main-router:

192.168.1.0/24 via 192.168.0.5

so that your main-router knows the subnet 192.168.1.x is behind your R64 which has 192.168.0.5 in the known subnet 192.168.0.x

make sure gateway matches the subnet of ip the client gets…e.g. client on r64 lan get IP 192.168.1.6, gateway have to be 192.168.1.1 (=fixed lan-address of r64 which is the gateway)

My main router is 10.1.1.1 the switch (4 ports) would be something such as 10.1.1.5 then each device plugged in to the ethernet would either get an ip via dhcp or manual using 10.1.1.5 as the gateway on the device that is connect to the cable.

Edit:

That is how OpenWRT did things.

Were not making a router cascade, but setting up an AP on the same subnet.

     wan
  ROUTER                   ACCESSPOINT
lan lan lan            lan lan lan lan lan
         |              |
         ----------------

Not:

     wan                                
  ROUTER                   
lan lan lan          
         |  
         |
        wan
      ROUTER
  lan lan lan lan

Btw, only the first diagram you can do wifi roaming (if Aaron desires it and his router bridge forwarding database can deal with this)

Actually we add an ethernet switch and an accesspoint to the same subnet