我正在使用 Arch Linux,我想拥有一个始终为 的静态私有 IP 192.168.1.10
。我该怎么做?我正在使用 systemd-networkd,我可以通过运行实现我想要的功能,sudo ip address add 192.168.1.10/24 broadcast + dev wlan0
但是这在重新启动后不起作用。非常感谢您的帮助。
以下是的当前输出ip addr
:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
link/ether 48:2a:e3:7a:4e:49 brd ff:ff:ff:ff:ff:ff
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b8:9a:2a:6f:88:49 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.143/24 scope global dynamic noprefixroute wlan0
valid_lft 83499sec preferred_lft 83499sec
inet6 fe80::ba9a:2aff:fe6f:8849/64 scope link
valid_lft forever preferred_lft forever