metadata fixes
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
---
|
||||
title: "wifi"
|
||||
title: "network"
|
||||
tags: [ "Networking" ]
|
||||
---
|
||||
|
||||
# Netstat Stuff
|
||||
|
||||
Stats on local net usage within domain.
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "wireguard"
|
||||
tags: [ "Networking", "VPN" ]
|
||||
tags: [ "networking", "VPN" ]
|
||||
---
|
||||
<!--
|
||||
from
|
||||
@@ -11,25 +11,22 @@ https://engineerworkshop.com/blog/how-to-set-up-wireguard-on-a-raspberry-pi/
|
||||
|
||||
Install `wireguard-tools` on the server.
|
||||
|
||||
```bash
|
||||
sudo -i
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
su root
|
||||
cd /etc/wireguard
|
||||
```
|
||||
|
||||
umask 077
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wg genkey | tee server_private_key | wg pubkey > server_public_key
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wg genkey | tee client_private_key | wg pubkey > client_public_key
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
echo "
|
||||
[Interface]
|
||||
Address = 10.0.0.1/24
|
||||
@@ -98,6 +95,6 @@ Add multiple peers by copying the `[peer]` section (they each get called `peer`)
|
||||
|
||||
Make a standard client configuration, then:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
qrencode -t ansiutf8 < /etc/wireguard/mobile_user.conf
|
||||
```
|
||||
|
@@ -1,60 +1,63 @@
|
||||
---
|
||||
title: "wireless"
|
||||
tags: [ "Networking" ]
|
||||
tags: [ "networking" ]
|
||||
---
|
||||
|
||||
# Check wifi's working
|
||||
```bash
|
||||
Check wifi's working
|
||||
|
||||
```sh
|
||||
lspci -k
|
||||
```
|
||||
|
||||
Or for usb wifi:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
dmesg | grep usbcore
|
||||
```
|
||||
|
||||
... and hopefully it'll say the new interface is registered.
|
||||
...and hopefully it'll say the new interface is registered.
|
||||
|
||||
# Check if a wifi interface has been created
|
||||
Check if a wifi interface has been created
|
||||
|
||||
```bash
|
||||
```sh
|
||||
ip link
|
||||
```
|
||||
|
||||
or
|
||||
...or
|
||||
|
||||
```bash
|
||||
```sh
|
||||
iw dev
|
||||
```
|
||||
|
||||
Assuming it's wlan0, bring it up with
|
||||
|
||||
```bash
|
||||
```sh
|
||||
ip link set wlan0 up
|
||||
```
|
||||
|
||||
Error messages probably means your wireless chipset requires a firmware to function. In this case, check the kernel messages for firmware being loaded
|
||||
|
||||
```bash
|
||||
```sh
|
||||
dmesg | grep firmware
|
||||
```
|
||||
|
||||
# Utilities
|
||||
|
||||
iw doesn't do wpa/wpa2. wpa_supplicant does everything. iwd does everything except WEXT encryption.
|
||||
- `iw` doesn't do wpa/wpa2.
|
||||
- `iwd` does everything except WEXT encryption.
|
||||
- `wpa_supplicant` does everything.
|
||||
|
||||
# Connecting
|
||||
|
||||
Get the link status:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
iw dev wlan0 link
|
||||
```
|
||||
|
||||
Scan for available points:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
iw dev wlan0 scan
|
||||
```
|
||||
|
||||
|
@@ -3,55 +3,55 @@ title: "wpa_supplicant"
|
||||
tags: [ "Networking" ]
|
||||
---
|
||||
|
||||
wpa_supplicant configurations are stored in /etc/wpa_supplicant/wpa_supplicant-wlan0 (or equivalent).
|
||||
`wpa_supplicant` configurations are stored in `/etc/wpa_supplicant/wpa_supplicant-wlan0` (or equivalent).
|
||||
|
||||
## WiFi Connection
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wpa_cli
|
||||
```
|
||||
|
||||
Once in, scan the network, add an empty place to store credentials, then input them.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
scan
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
scan_results
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
add_network
|
||||
```
|
||||
|
||||
This outputs a network number, e.g. '3'. This is the new network you'll work with.
|
||||
|
||||
```bash
|
||||
```sh
|
||||
set_network *3* ssid *"Kosachok Cafe"*
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
set_network 3 psk *"Kosachok2019"*
|
||||
```
|
||||
|
||||
OR (for no password)
|
||||
|
||||
```bash
|
||||
```sh
|
||||
set_network *3* key_mgmt NONE
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
enable_network 3
|
||||
```
|
||||
|
||||
```bash
|
||||
```sh
|
||||
save_config
|
||||
```
|
||||
|
||||
This takes a while to connect, so to speed things up, restart the service:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
sudo sv restart wpa_supplicant
|
||||
```
|
||||
|
||||
@@ -59,13 +59,13 @@ sudo sv restart wpa_supplicant
|
||||
|
||||
You can script like this:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wpa_cli add_network
|
||||
```
|
||||
|
||||
That returns an ID, so you can say:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
newNetwork="$(wpa_cli add_network)"
|
||||
```
|
||||
|
||||
@@ -73,19 +73,19 @@ Then `$newNetwork` would equal that number, and you can add/ remove networks wit
|
||||
|
||||
But remember to escape the quotes, so adding a network would be:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wpa_cli set_network *3* psk *\""passphrase"\"*
|
||||
```
|
||||
|
||||
## Generating Keys Manually
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wpa_passphrase [ssid] [password]
|
||||
```
|
||||
|
||||
For example:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
wpa_passphrase 'Cafe Kosachok' 'Kosachok2019'
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user