Skip to content

Commit e77c718

Browse files
committed
add static IP config
1 parent c86260f commit e77c718

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

docs/advanced/troubleshooting.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,44 @@
1010
- 在分区时,需要额外分出一个 2M 大小的 BIOS boot 模式的分区,此分区无需进行格式化与挂载。
1111
- 在安装引导程序时,对应的命令修改为: `grub-install --target=i386-pc /dev/vda` 以及 `grub-mkconfig -o /boot/grub/grub.cfg`。其中,第一条命令中的`/dev/vda`为安装 GRUB 的磁盘,而非分区。具体的名字根据安装者的实际情况进行更改。
1212

13+
### 静态 IP 设置
14+
15+
虽然使用可以自动获取 ip 地址的工具可以覆盖绝大多数场景,但是仍有部分特殊场景,如校园网,VPS 等环境下需要进行静态 IP 的设置。本小节给出一个简略的设置静态 IP 的方式。如需要设置静态 IP,需要首先禁用 dhcpcd 或 NetworkManager 等自动获取 ip 的工具。
16+
17+
```bash
18+
sudo systemctl stop dhcpcd NetworkManager
19+
sudo systemctl disable dhcpcd NetworkManager
20+
```
21+
22+
接下来启用 systemd-networkd
23+
24+
```bash
25+
sudo systemctl enable --now systemd-networkd
26+
```
27+
28+
使用`ip ad`命令查看当前网卡的名字,如这里使用名字 ens3。随后创建配置文件`/etc/systemd/network/10-static-ens3.network`。接下来在其中填入内容。其中的 ip 地址和网关需要从你的网络提供商处获取。其中的 DNS 设置同样需要在`/etc/resolv.conf`中按照前文中的方式进行设置。
29+
30+
```conf
31+
[Match]
32+
Name=ens3
33+
34+
[Network]
35+
Address=YOUR_IPV4_ADDRESS/MASK
36+
Gateway=YOUR_IPV4_GATEWAY
37+
DNS=8.8.8.8
38+
39+
[Network]
40+
Address=YOUR_IPV6_ADDRESS/MASK
41+
Gateway=YOUR_IPV6_GATEWAY
42+
DNS=2001:4860:4860::8888
43+
```
44+
45+
最后,重启服务即可。
46+
47+
```bash
48+
sudo systemctl restart systemd-networkd
49+
```
50+
1351
### 鼠标出现按键不灵敏或失灵的现象
1452

1553
一般来说大多数鼠标都是即插即用的,但 5.14 内核前后更新后可能遇到失灵的情况。根据自身鼠标品牌安装对应的驱动即可解决。[[1]](https://openrazer.github.io/#arch)

docs/uk/advanced/troubleshooting.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,44 @@ Although there are fewer and fewer installation scenarios using traditional BIOS
1010
- When partitioning, you need to separate a 2M BIOS boot mode partition, this partition does not need to be formatted and mounted.
1111
- When installing the bootloader, the corresponding commands are modified to: `grub-install --target=i386-pc /dev/vda` and `grub-mkconfig -o /boot/grub/grub.cfg`. Among them, `/dev/vda` in the first command is the disk where GRUB is installed, not a partition. The specific name is changed according to the actual situation of the installer.
1212

13+
### Static IP Settings
14+
15+
Although the use of tools that can automatically obtain IP addresses can cover most scenarios, there are still some special scenarios, such as campus networks, VPS and other environments that require static IP settings. This section gives a brief way to set a static IP. If you need to set a static IP, you need to disable the tools that automatically obtain IP such as dhcpcd or NetworkManager.
16+
17+
```bash
18+
sudo systemctl stop dhcpcd NetworkManager
19+
sudo systemctl disable dhcpcd NetworkManager
20+
```
21+
22+
Next enable systemd-networkd
23+
24+
```bash
25+
sudo systemctl enable --now systemd-networkd
26+
```
27+
28+
Use the `ip ad` command to view the name of the current network card, for example, the name ens3 is used here. Then create the configuration file `/etc/systemd/network/10-static-ens3.network`. Then fill in the content in it. The ip address and gateway need to be obtained from your network provider. The DNS settings also need to be set in `/etc/resolv.conf` in the same way as above.
29+
30+
```conf
31+
[Match]
32+
Name=ens3
33+
34+
[Network]
35+
Address=YOUR_IPV4_ADDRESS/MASK
36+
Gateway=YOUR_IPV4_GATEWAY
37+
DNS=8.8.8.8
38+
39+
[Network]
40+
Address=YOUR_IPV6_ADDRESS/MASK
41+
Gateway=YOUR_IPV6_GATEWAY
42+
DNS=2001:4860:4860::8888
43+
```
44+
45+
Finally, restart the service.
46+
47+
```bash
48+
sudo systemctl restart systemd-networkd
49+
```
50+
1351
### The mouse button is insensitive or malfunctioning
1452

1553
Generally speaking, most mice are plug and play, but may experience failure after the 5.14 kernel update. It can be solved by installing the corresponding driver according to your own mouse brand. [[1]](https://openrazer.github.io/#arch)

0 commit comments

Comments
 (0)