blob: 186ddfe077456ead630fa85fc601bfb55c9ae376 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
|
Networking
==========
This document describes how to configure networking on **Alice Linux** using `eiwd`/`wpa_supplicant` + `udhcpc`/`dhcpcd`.
---
Overview
--------
Alice Linux uses simple, modular networking tools:
**Link (connection)**
* LAN: automatic (cable)
* Wi-Fi: `eiwd` or `wpa_supplicant`
**IP configuration**
* `udhcpc` - BusyBox DHCP client
* `dhcpcd` - DHCP client
---
Establish Network Link
----------------------
Wired (LAN)
---------------
Bring interface up:
```
ip link set eth0 up
```
A physical cable connection is usually sufficient.
> runit service enabled later will automatically bring up the interface.
Wi-Fi
-------
Bring interface up first:
```
ip link set wlan0 up
```
> runit service enabled later will automatically bring up the interface.
Then choose ONE method:
---
**Option A: eiwd**
Install `eiwd` and `resolvconf`
```
# apkg -I eiwd resolvconf
```
To prevent iwd from scanning continuously while not connected, add the following lines to `/etc/iwd/main.conf`:
```
[Scan]
DisablePeriodicScan=true
```
To prevent iwd from destroying / recreating wireless interfaces at startup, add the following line to `[General]`;
```
UseDefaultInterface=true
```
Add network configuration.
```
# printf 'password\n' | iwd_passphrase ssid > /var/lib/iwd/<ssid>.psk
```
> The iwd daemon monitors /var/lib/iwd and automatically loads new network configurations.
Enable `eiwd` service:
```
# ln -s /etc/eiwd /var/service
```
---
**Option B: wpa_supplicant**
Install `wpa_supplicant` package.
```
# apkg -I wpa_supplicant
```
Configure `wpa_supplicant.conf`:
```
wpa_passphrase "SSID_NAME" "PASSWORD" > /etc/wpa_supplicant.conf
```
Enable `wpa_supplicant` service:
```
# ln -s /etc/wpa_supplicant /var/service
```
---
Obtain IP Address (DHCP)
------------------------
Once the interface is connected (LAN or Wi-Fi), obtain an IP address.
> This step is identical for both LAN and Wi-Fi.
---
**Option A: udhcpc (BusyBox)**
Enable `udhcpc` service:
```
# ln -s /etc/sv/udhcpc /var/service
```
> Interface and DNS settings can be adjusted in /etc/sv/udhcpc/conf.
---
**Option B: dhcpcd**
Install `dhcpcd` first:
```
# apkg -I dhcpcd
```
Enable `dhcpcd` service:
```
# ln -s /etc/sv/dhcpcd /var/service
```
---
Static Network Configuration
-----------------------------
To use a static configuration instead of DHCP:
```
# vi /etc/sv/net-static/conf
```
Set the following variables:
* IFACE
* IP
* NETMASK
* GATEWAY
```
# ln -s /etc/sv/net-static /var/service
```
---
Troubleshooting
---------------
Check interfaces:
```
ip addr
```
Test connectivity:
```
ping -c 3 8.8.8.8
```
Test DNS:
```
ping -c 3 google.com
```
---
Quick Reference
---------------
LAN (DHCP)
```
# ip link set eth0 up
# ln -s /etc/sv/udhcpc /var/service
```
Wi-Fi (iwd + DHCP)
```
# ip link set wlan0 up
# printf 'password\n' | iwd_passphrase ssid > /var/lib/iwd/<ssid>.psk
# ln -s /etc/sv/eiwd /var/service
# ln -s /etc/sv/udhcpc /var/service
```
Wi-Fi (wpa_supplicant + DHCP)
```
# ip link set wlan0 up
# wpa_passphrase "SSID" "PASS" > /etc/wpa_supplicant.conf
# ln -s /etc/sv/wpa_supplicant /var/service
# ln -s /etc/sv/udhcpc /var/service
```
|