Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routing Hardware - EspressoBIN πŸ‘Ž #12

Closed
3 tasks done
darkdrgn2k opened this issue Jun 13, 2020 · 6 comments
Closed
3 tasks done

Routing Hardware - EspressoBIN πŸ‘Ž #12

darkdrgn2k opened this issue Jun 13, 2020 · 6 comments
Assignees
Labels
network Network Planning, Design and Operations

Comments

@darkdrgn2k
Copy link
Contributor

darkdrgn2k commented Jun 13, 2020

This initial comment is collaborative and open to modification by all.

Task Summary

🎟️ Re-ticketed from: #
πŸ“… Due date: N/A
🎯 Success criteria: Instructions to build a working espressoBIN router for babeld

πŸ˜• Found u-boot hung a few times. I was messing with it at the time but still not a good thing
βœ”οΈ Able to re-flash from uboot
βœ”οΈ Almost full gig transfer when direct connection
βœ”οΈ Almost full gig transfer when bridging
❌ Routed dropped down to ~350Mbps
❌ A reboot can cause it to enter into a UBOOT freeze and requires to be power cycled.

To Do

  • Figure out how to flash without taking out SD card
  • Benchmark Router
  • Figure out config for roof-top router
@darkdrgn2k
Copy link
Contributor Author

darkdrgn2k commented Jun 13, 2020

EspressoBIN v7 comes with a weird case that you cannot remove the SD card without unscrewing the whole thing. Having the ability to field-reflash the sd card without removing it would be a huge time saver.

By inserting a FAT formatted USB drive with an image into USB port you can re-flash the SD card from the SERIAL CONSOLE over U-BOOT

  • The image is to big to fit all into memory so you need to flash it in two chunks.
  • fatload uses bytes in hex
  • mmc write uses blocks in hex
  • blocks are bytes/512 (or bytes/0x200 if in hex)

${loadaddr} is a position in RAM where you can dump stuff.

# Enable USB 
usb start

# Load first part (0x35000000‬ bytes) of the image into memory starting at position 0
fatload usb 0 ${loadaddr}  Armbian_20.05.2_Espressobin_buster_current_4.19.126.img 35000000‬ 0
# Write from memory into MMC position  0 0x1A8000 Blocks
mmc write ${loadaddr} 0 1A8000
‬
# Load the remaining (0) of the file starting at 0x35000000‬ into memory 
fatload usb 0 ${loadaddr}  Armbian_20.05.2_Espressobin_buster_current_4.19.126.img 0 35000000‬

# Calculate Remainder of file starting at block 0x1A8000‬ 
# Result = "704643072 bytes read in 11818 ms (56.9 MiB/s)"
# 704643072/512 converted into HEX = 150000

# Write from memory to MMC 
mmc write ${loadaddr} 1A8000‬ 150000

@darkdrgn2k
Copy link
Contributor Author

darkdrgn2k commented Jun 13, 2020

Benchmark

[iperfclient]--gige---[iperserver espressobin]
βœ”οΈ 931/Mbits/sec Mbits/sec

[iperfserver]--gige---[espressobin bridged]----iperfclient
βœ”οΈ 936/947 Mbits/sec

[iperfserver]--gige---[espressobin routed]----iperfclient
❌ 335/403 Mbits/sec

[iperfserver exit node]--gige wan---[espressobin iperfclient]
❌ 199/199 Mbits/sec MAX drops to 20

@darkdrgn2k darkdrgn2k added the network Network Planning, Design and Operations label Jun 14, 2020
@darkdrgn2k
Copy link
Contributor Author

darkdrgn2k commented Jun 14, 2020

Disable armbian bridging

sudo rm -rf /etc/systemd/network/*

Enable individual interfaces
wan= SECTOR1 10.0.1.1/24
lan0= SECTOR2 10.0.2.1/24
lan1= SECTOR3 10.0.3.1/24

apt-get install dnsmasq

cat <<"EOF"> /etc/network/interfaces.d/eth0
auto eth0
iface eth0 inet manual
EOF

cat <<"EOF"> /etc/network/interfaces.d/wan
auto wan
iface wan inet static
address 100.64.1.1
netmask 255.255.255.0
EOF

cat <<"EOF"> /etc/network/interfaces.d/lan0
auto lan0
iface lan0 inet static
address 100.64.2.1
netmask 255.255.255.0
EOF

cat <<"EOF"> /etc/network/interfaces.d/lan1
auto lan1
iface lan1 inet static
address 100.64.3.1
netmask 255.255.255.0
EOF

@darkdrgn2k
Copy link
Contributor Author

darkdrgn2k commented Jun 14, 2020

Babeld

wget http://node2.meshwithme.online/deb/repos/apt/debian/pool/main/b/babeld/babeld_1.9.1-dirty_arm64.deb
dpkg -i babeld_1.9.1-dirty_arm64.deb    

cat <<"EOF"> /etc/babeld.conf
interface wan
interface lan0
interface lan1
redistribute if wan
redistribute if lan0
redistribute if wan1
redistribute deny
EOF

@darkdrgn2k
Copy link
Contributor Author

darkdrgn2k commented Jun 14, 2020

Wire Guard

apt-get install wireguard

wg genkey > privatekey
privatekey=$(cat privatekey)
publickey=$(wg pubkey < privatekey)

cat <<EOF> /etc/wireguard/wg-100-127-0-4.conf
[Interface]
Address = 100.127.0.4/32
Address = fe80::c4bc:2128:a33f:991/64
PrivateKey = $privatekey

[Peer]
PublicKey = 1zR1mOMjfzyEtnJk5eafvKiuh1HdjD7dGJxWVO5mmTA=
AllowedIPs = 0.0.0.0/0
AllowedIPs = ::/0
PersistentKeepalive = 25
Endpoint = 199.195.250.209:51444
EOF

systemctl start wg-quick@wg-100-127-0-4
systemctl enable wg-quick@wg-100-127-0-4

Add this to /etc/babeld.conf

interface wg-10-127-0-4
redistribute if wg-10-127-0-4

@darkdrgn2k
Copy link
Contributor Author

Router is not stable enough for field work. A reboot can cause it to enter into a UBOOT freeze and requires to be power cycled.

@darkdrgn2k darkdrgn2k changed the title Routing Hardware - EspressoBIN Routing Hardware - EspressoBIN πŸ‘Ž Jul 12, 2020
@makew0rld makew0rld mentioned this issue Aug 3, 2020
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
network Network Planning, Design and Operations
Development

No branches or pull requests

1 participant