Skip to content

Commit 0c89cd2

Browse files
authored
Merge pull request #9 from drduh/03aug26
move pcengines content to legacy
2 parents 56aaba0 + 416b7a3 commit 0c89cd2

2 files changed

Lines changed: 214 additions & 215 deletions

File tree

README.md

Lines changed: 12 additions & 215 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
> [!IMPORTANT]
2-
> After many years of service, the PC Engines APU platform is now [EOL](https://www.pcengines.ch/eol.htm).
3-
4-
This guide demonstrates how to build a router using the PC Engines [APU platform](https://www.pcengines.ch/apu.htm) and a free operating system like [OpenBSD](https://www.openbsd.org/) or [Debian](https://www.debian.org/distrib/) to be used for [network address translation](https://computer.howstuffworks.com/nat.htm), as a stateful firewall, to filter web traffic, and more.
1+
This guide demonstrates how to build a router using a free operating system like [OpenBSD](https://www.openbsd.org/) or [Debian](https://www.debian.org/distrib/) to be used for [network address translation](https://computer.howstuffworks.com/nat.htm), as a stateful firewall, to filter web traffic, and more.
52

63
This guide is provided "as is" - without warranties of any kind. You are solely responsible for any consequences of following it.
74

5+
See [legacy/pcengines.md](https://github.com/drduh/Router-Guide/blob/main/legacy/pcengines.md) for previous instructions to configure the PC Engines APU platform.
6+
87
# Overview
98

109
The completed router configuration will enable:
@@ -15,211 +14,9 @@ The completed router configuration will enable:
1514
* A local Ethernet interface on `10.8.1.0/24`
1615
* A fourth Ethernet interface is available on the APU4
1716

18-
## Hardware
19-
20-
This guide should work on any PC Engines APU model. Here is a suggested parts list:
21-
22-
Part | Description | Cost
23-
-: | :-: | :-
24-
[apu4c4](https://pcengines.ch/apu4c4.htm) | apu4c4 system board | $117.50
25-
[case1d2bluu](https://pcengines.ch/case1d2bluu.htm) | Enclosure 3 LAN, blue | $9.40
26-
[ac12vus2](https://pcengines.ch/ac12vus2.htm) | AC adapter 12V 2A US plug | $4.10
27-
[msata16g](https://pcengines.ch/msata16g.htm) | SSD M-Sata 16GB MLC, Phison S11 | $15.50
28-
[wle200nx](https://pcengines.ch/wle200nx.htm) | Compex WLE200NX miniPCI express card | $19.00
29-
[pigsma](https://pcengines.ch/pigsma.htm) (x2) | Cable I-PEX -> reverse SMA | $2.70
30-
[antsmadb](https://pcengines.ch/antsmadb.htm) (x2) | Antenna reverse SMA dual band | $4.10
31-
32-
> [!NOTE]
33-
> WLE600VX and WLE900VX cards will likely not work due to [regulatory compliance reasons](https://medium.com/@renaudcerrato/how-to-build-your-own-wireless-router-from-scratch-part-3-d54eecce157f).
34-
35-
To connect over serial, you will need a [USB to Serial (9-Pin) Converter Cable](https://www.amazon.com/gp/product/B00IDSM6BW) and [Modem Serial RS232 Cable](https://www.amazon.com/gp/product/B000067SCH), also available from [PC Engines](https://www.pcengines.ch/usbcom1a.htm).
36-
37-
See [Issue #1](https://github.com/drduh/PC-Engines-APU-Router-Guide/issues/1) for a list of alternative parts.
38-
39-
## Assembly
40-
41-
Clear a workspace and unpack the materials. Follow the [apu cooling assembly instructions](https://www.pcengines.ch/apucool.htm) to install the heat conduction plate.
42-
43-
Install the mSATA drive and miniPCIe wireless adapter in their respective slots.
44-
45-
See the relevant APU series manual for detailed board information:
46-
47-
* [APU2](https://www.pcengines.ch/pdf/apu2.pdf)
48-
* [APU3](https://www.pcengines.ch/pdf/apu3.pdf)
49-
* [APU4](https://www.pcengines.ch/pdf/apu4.pdf)
50-
51-
> [!CAUTION]
52-
> Wireless radio cards are ESD sensitive, especially the RF switch and the power amplifier. To avoid damage by electrostatic discharge, the following installation procedure is [recommended](https://www.pcengines.ch/wle200nx.htm)
53-
54-
1. Touch your hands and the bag containing the radio card to a ground point on the router board (for example one of the mounting holes). This equalizes the electrical potential between the radio card and the router board.
55-
1. Install the radio card in the miniPCI express socket.
56-
1. Install the pigtail cable in the cut-out of the enclosure. This will ground the pigtail to the enclosure.
57-
1. Touch the pigtail's I-PEX connector to a mounting hole to discharge it, then plug it into the radio card.
58-
59-
To avoid arcing, connect the DC jack first, then plug the power adapter into an outlet.
60-
61-
Press `F10` during boot and select `Payload [memtest]` to complete at least one pass.
62-
63-
# Connect over serial
64-
65-
The APU serial connection uses 115200 baud, 8N1 (8 data bits, no parity, and 1 stop bit).
66-
67-
On OpenBSD, use [cu](https://man.openbsd.org/cu):
68-
69-
```bash
70-
doas cu -r -s 115200 -l cuaU0
71-
```
72-
73-
On Linux, use [screen](https://www.gnu.org/software/screen/manual/screen.html):
74-
75-
```bash
76-
screen /dev/ttyUSB0 115200 8N1
77-
```
78-
79-
Or use [minicom](https://linux.die.net/man/1/minicom):
80-
81-
```bash
82-
sudo minicom -D /dev/ttyUSB0
83-
```
84-
85-
Power on the APU and note the firmware version displayed briefly during boot.
86-
87-
# Updating firmware
88-
89-
Check for the latest PC Engines firmware version at [pcengines.github.io](https://pcengines.github.io/)
90-
91-
> [!NOTE]
92-
> As of 2023, PC Engines firmware is no longer being updated. See [announcement](https://docs.dasharo.com/variants/pc_engines/post-eol-fw-announcement/).
93-
94-
To update firmware, first download and extract [TinyCore Linux](https://pcengines.ch/file/apu2-tinycore6.4.img.gz).
95-
96-
Download and import the [firmware signing key](https://github.com/3mdeb/3mdeb-secpack/tree/master/customer-keys/pcengines/release-keys), then check the file signature:
97-
98-
```console
99-
$ curl -LO https://raw.githubusercontent.com/3mdeb/3mdeb-secpack/master/customer-keys/pcengines/release-keys/pcengines-open-source-firmware-release-4.19-key.asc
100-
101-
$ gpg --import pcengines-open-source-firmware-release-4.19-key.asc
102-
gpg: key 0x30A53DE2F5A6D89A: 1 signature not checked due to a missing key
103-
gpg: key 0x30A53DE2F5A6D89A: public key "PC Engines open-source firmware release 4.19 signing key" imported
104-
gpg: Total number processed: 1
105-
gpg: imported: 1
106-
107-
$ gpg apu4_v4.19.0.1.SHA256.sig
108-
gpg: assuming signed data in 'apu4_v4.19.0.1.SHA256'
109-
gpg: Signature made Thu 02 Feb 2023 03:22:57 AM PST
110-
gpg: using RSA key 05CF36F166C3D676A08AB70F30A53DE2F5A6D89A
111-
gpg: Good signature from "PC Engines open-source firmware release 4.19 signing key" [unknown]
112-
gpg: WARNING: This key is not certified with a trusted signature!
113-
gpg: There is no indication that the signature belongs to the owner.
114-
Primary key fingerprint: 05CF 36F1 66C3 D676 A08A B70F 30A5 3DE2 F5A6 D89A
115-
116-
$ shasum -a 256 apu4_v4.19.0.1.rom 2>/dev/null | grep -q $(cat apu4_v4.19.0.1.SHA256 | awk '{print $1}') && echo ok
117-
ok
118-
```
119-
120-
Mount a USB disk and write the TinyCore image, copy the `.rom` file:
121-
122-
```bash
123-
curl -O https://pcengines.ch/file/apu2-tinycore6.4.img.gz
124-
125-
gzip -d apu2-tinycore6.4.img.gz
126-
127-
sha256sum apu2-tinycore6.4.img
128-
f5a20eeb01dfea438836e48cb15a18c5780194fed6bf21564fc7c894a1ac06d7 apu2-tinycore6.4.img
129-
130-
sudo dd if=apu2-tinycore6.4.img of=/dev/sdd bs=1M
131-
132-
sudo mkdir /mnt/usb
133-
134-
sudo mount /dev/sdd1 /mnt/usb
135-
136-
sudo cp -v apu4_*.rom /mnt/usb
137-
138-
sudo umount /mnt/usb
139-
```
140-
141-
Connect the USB disk to the APU. During boot, press `F10` and select the USB disk.
142-
143-
```console
144-
SeaBIOS (version rel-1.14.0.1-0-g8610266a)
145-
146-
Press F10 key now for boot menu
147-
148-
Select boot device:
149-
150-
1. USB MSC Drive Samsung Flash Drive DUO 1100
151-
2. AHCI/0: SB2 ATA-11 Hard-Disk (111 GiBytes)
152-
3. Payload [setup]
153-
4. Payload [memtest]
154-
```
155-
156-
Check the current version:
157-
158-
```console
159-
root@pcengines:~# dmesg | grep apu
160-
[ 0.000000] DMI: PC Engines apu4/apu4, BIOS v4.10.0.1 09/10/2019
161-
```
162-
163-
Save the existing version and write the new one:
164-
165-
```console
166-
root@pcengines:~# cd /media/SYSLINUX
167-
168-
root@pcengines:/media/SYSLINUX# flashrom -p internal -r apu4.rom.$(dmidecode -s baseboard-serial-number|tail -n1).$(date +%F)
169-
[...]
170-
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) mapped at physical address 0xff800000.
171-
Reading flash... done.
172-
173-
root@pcengines:/media/SYSLINUX# flashrom -p internal -w apu4_v4.19.0.1.rom
174-
[...]
175-
Found Winbond flash chip "W25Q64.V" (8192 kB, SPI) mapped at physical address 0xff800000.
176-
Reading old flash chip contents... done.
177-
Erasing and writing flash chip... Erase/write done.
178-
Verifying flash... VERIFIED.
179-
```
180-
181-
Unplug the USB disk and reboot.
182-
183-
**Optional** On reboot, press `F10`, select `Payload [setup]`, press `w` to enable BIOS write protection, then press `s` to save and reboot.
184-
185-
Verify the version by checking serial output during boot:
186-
187-
```
188-
PC Engines apu4
189-
coreboot build 20230131
190-
BIOS version v4.19.0.1
191-
```
192-
193-
From OpenBSD:
194-
195-
```console
196-
$ dmesg | grep bios
197-
bios0 at mainbus0: SMBIOS rev. 2.8 @ 0xcfe8b020 (13 entries)
198-
bios0: vendor coreboot version "v4.19.0.1" date 01/31/2023
199-
bios0: PC Engines apu4
200-
acpi0 at bios0: ACPI 6.0
201-
```
202-
203-
From Debian:
204-
205-
```console
206-
$ sudo dmesg | grep apu
207-
[ 0.000000] DMI: PC Engines apu4/apu4, BIOS v4.19.0.1 01/31/2023
208-
```
209-
210-
APU firmware can also be updated from Debian without rebooting to TinyCore Linux:
211-
212-
```bash
213-
sudo apt install flashrom
214-
wget https://3mdeb.com/open-source-firmware/pcengines/apu4/apu4_v4.19.0.1.rom
215-
sudo flashrom -p internal -w apu4_v4.19.0.1.rom
216-
```
217-
218-
To complete the update, shut down Debian and power off the APU fully, then reboot.
219-
22017
# Prepare OS installer
22118

222-
Use another computer to prepare an installer for either OpenBSD or Debian.
19+
Use another computer to prepare an installer for OpenBSD or Debian.
22320

22421
## OpenBSD
22522

@@ -645,8 +442,8 @@ ssh-add -L | awk '{print $1" "$2}' | xclip
645442
Or generate a new SSH key on the client and copy it to clipboard:
646443

647444
```bash
648-
ssh-keygen -f -C 'sysadm' ~/.ssh/pcengines
649-
xclip ~/.ssh/pcengines.pub
445+
ssh-keygen -f -C 'sysadm' ~/.ssh/router
446+
xclip ~/.ssh/router.pub
650447
```
651448

652449
On the APU, over the serial connection, as the primary user (e.g., `sysadm` - *not* `root`), configure SSH to accept that key by pasting it into `~/.ssh/authorized_keys`:
@@ -660,19 +457,19 @@ $ mkdir ~/.ssh ; cat > ~/.ssh/authorized_keys
660457
SSH from a client will now work:
661458

662459
```console
663-
$ ssh sysadm@10.8.1.1 -i ~/.ssh/pcengines
460+
$ ssh sysadm@10.8.1.1 -i ~/.ssh/router
664461
Host key fingerprint is SHA256:AAAAA
665462

666-
Linux pcengines 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
667-
sysadm@pcengines~ %
463+
Linux router 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64
464+
sysadm@router~ %
668465
```
669466

670467
Configure the connection on a client by editing `~/.ssh/config`:
671468

672469
```
673-
Host pcengines
470+
Host router
674471
HostName 10.8.1.1
675-
IdentityFile ~/.ssh/pcengines
472+
IdentityFile ~/.ssh/router
676473
User sysadm
677474
Port 22
678475
ControlMaster auto
@@ -683,7 +480,7 @@ Host pcengines
683480
Connect using the new alias:
684481

685482
```bash
686-
ssh pcengines
483+
ssh router
687484
```
688485

689486
Download configuration files:

0 commit comments

Comments
 (0)