1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
raspberrypi-build/README.md

131 lines
3.9 KiB
Markdown
Raw Normal View History

2017-07-03 09:59:39 -04:00
barnacleos/build
2017-06-30 17:32:33 -04:00
================
Tool used to create the [BarnacleOS](https://github.com/barnacleos) images.
Based on [pi-gen](https://github.com/rpi-distro/pi-gen) tool used to create
2017-07-02 11:12:22 -04:00
the official [raspberrypi.org](https://raspberrypi.org) Raspbian images.
2017-06-30 17:36:04 -04:00
2017-07-09 12:53:10 -04:00
Table of contents
-----------------
* [Dependencies](#dependencies)
* [Network interfaces](#network-interfaces)
* [eth0](#eth0)
* [eth1](#eth1)
* [System configuration](#system-configuration)
* [Internal network](#internal-network)
2017-06-30 17:36:04 -04:00
Dependencies
------------
2016-04-11 02:25:30 -04:00
On Debian-based systems:
```bash
2017-07-07 12:42:48 -04:00
apt-get install bash quilt parted qemu-user-static debootstrap zerofree zip \
2017-07-03 03:13:19 -04:00
dosfstools libcap2-bin grep rsync
```
2017-07-02 00:19:03 -04:00
The file `depends` contains a list of tools needed. The format of this
2017-07-02 02:55:42 -04:00
file is `<tool>[:<debian-package>]`.
2017-07-06 18:03:27 -04:00
2017-07-09 12:27:50 -04:00
Network interfaces
------------------
Each network interface of Raspberry Pi can be used to connect to the Internet or
2017-07-09 12:38:25 -04:00
to be the gateway for [the internal network](#internal-network).
2017-07-09 12:27:50 -04:00
The [barnaconfig](https://github.com/barnacleos/barnaconfig) utility can be used
to configure the role of each network interface.
However some initial configuration may be required to use the default BarnacleOS
image, such as Wi-Fi drivers installation. It can be done via SSH. Network
interfaces [eth0](#eth0) and [eth1](#eth1) have default configurations to help
you to connect.
### eth0
`eth0` is configured by default to get IPv4 address from router via DHCP
without any assumptions about subnet configuration. You can just plug
your Raspberry Pi to router with Ethernet cable, discover which address
was given to it in router's web interface or with `nmap` utility and connect
to it via SSH.
Let's say your router has address `192.168.0.1`, subnet is `192.168.0.0/24`
(netmask `255.255.255.0`), your computer has address `192.168.0.2`.
Do the following:
```
$ sudo apt-get install nmap
$ nmap -sn 192.168.0.0/24
Starting Nmap 6.47 ( http://nmap.org ) at 2017-07-09 15:39 UTC
Nmap scan report for 192.168.0.1
Host is up (0.0039s latency).
Nmap scan report for 192.168.0.2
Host is up (0.00078s latency).
Nmap scan report for 192.168.0.3
Host is up (0.00104s latence).
Nmap done: 256 IP addresses (3 hosts up) scanned in 7.97 seconds
```
So your Raspbbery Pi has address `192.168.0.3`. Connect to it via SSH:
```
$ ssh user@192.168.0.3
```
### eth1
`eth1` is configured by default to be the gateway and the DHCP server
2017-07-09 12:38:25 -04:00
for the IPv4 subnet `192.168.82.0/24` (netmask `255.255.255.0`,
[the internal network](#internal-network)) with static address `192.168.82.1`.
If your Raspberry Pi has two Ethernet ports, you can just plug your computer
to it, run DHCP client on the corresponding network interface and connect
to it via SSH.
2017-07-09 12:27:50 -04:00
Let's say your computer has network interface `eth42` which is plugged to
Raspberry Pi. Do the following to connect to Raspberry Pi via SSH:
```
$ printf "allow-hotplug eth42\niface eth42 inet dhcp\n" | sudo tee /etc/network/interfaces.d/eth42
$ sudo ifup eth42
$ ssh user@192.168.82.1
```
2017-07-06 19:38:56 -04:00
System configuration
--------------------
2017-07-09 12:35:09 -04:00
The following information can be helpful when you connect to BarnacleOS router
and configure it:
2017-07-06 19:38:56 -04:00
* Root login via SSH is disabled
2017-07-07 12:29:43 -04:00
* Root password is disabled
2017-07-06 19:38:56 -04:00
* User `user` has access via SSH with password `password`
* SSH host keys are generated at first startup,
so fingerprint is different for each installation of the same image
* User has passwordless sudo
2017-07-09 12:32:15 -04:00
2017-07-09 12:38:25 -04:00
Internal network
----------------
2017-07-09 12:32:15 -04:00
2017-07-09 12:47:08 -04:00
BarnacleOS is the typical IPv4 router with it's own internal network. Multiple
devices can be connected to it. DHCP server assigns IPv4 addresses to devices.
As a gateway, it sends all traffic from internal network to the Internet through
[the Tor network](https://torproject.org). The local traffic is not encrypted.
Here is the internal network configuration:
2017-07-09 12:32:15 -04:00
* Hostname: `barnacleos`
* FQDN: `barnacleos.local`
* Subnet: `192.168.82.0/24` (netmask `255.255.255.0`)
* Gateway: `192.168.82.1`
* Broadcast: `192.168.82.255`
* IP range: `192.168.82.2` to `192.168.82.254`