Add network interfaces docs
This commit is contained in:
parent
7feda5e8f8
commit
587a359d5f
1 changed files with 63 additions and 0 deletions
63
README.md
63
README.md
|
@ -22,6 +22,69 @@ file is `<tool>[:<debian-package>]`.
|
|||
|
||||
|
||||
|
||||
Network interfaces
|
||||
------------------
|
||||
|
||||
Each network interface of Raspberry Pi can be used to connect to the Internet or
|
||||
to be the gateway for [the internal Tor network](#network-configuration).
|
||||
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
|
||||
for the IPv4 subnet `192.168.82.0/24` (netmask `255.255.255.0`) with static
|
||||
address `192.168.82.1` ([see also](#network-configuration)). 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.
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
|
||||
|
||||
Network configuration
|
||||
---------------------
|
||||
|
||||
|
|
Reference in a new issue