我确信我看起来很蠢,但是我在网上找不到任何有用的东西。
任何帮助都将不胜感激,目标是获得一个静态 IP 地址。
ip -a 给出如下结果:
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: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether ec:f4:bb:5a:a4:39 brd ff:ff:ff:ff:ff:ff
altname enp0s25
3: wlp4s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether 44:39:c4:5a:ed:9a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.23/24 brd 192.168.1.255 scope global dynamic noprefixroute wlp4s0
valid_lft 85658sec preferred_lft 85658sec
inet6 2a01:cb18:86e8:8f00:af3b:1ddb:bddf:b21e/64 scope global temporary dynamic
valid_lft 1781sec preferred_lft 581sec
inet6 2a01:cb18:86e8:8f00:8726:a333:495b:f2f3/64 scope global dynamic mngtmpaddr noprefixroute
valid_lft 1781sec preferred_lft 581sec
inet6 fe80::b6bf:3baa:48c0:e9b4/64 scope link noprefixroute
valid_lft forever preferred_lft forever
我尝试了这个(以及其他方法):
network:
version: 2
renderer: NetworkManager
ethernets:
wlp4s0:
addresses: [192.168.1.200/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4]
dhcp4: no
dhcp6: no
eth0:
addresses: [192.168.1.200/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4]
dhcp4: no
dhcp6: no
但当然失败了
感谢您的帮助