![lubuntu 上的静态 IP 地址不起作用](https://linux22.com/image/1149951/lubuntu%20%E4%B8%8A%E7%9A%84%E9%9D%99%E6%80%81%20IP%20%E5%9C%B0%E5%9D%80%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我设置了一些旧电脑并安装了 lubuntu。我自己买了一些旧硬盘,这样我就可以把它作为备用电脑。决定设置一个静态 IP。但由于某种原因,它就是无法工作。我尝试了多种方法来编辑并重启网络和电脑几次。如果有人能分享一些智慧的话那就太好了 =(
ifconfig:
enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.102 netmask 255.255.255.0 broadcast 192.168.0.255
inet6 fe80::a990:4cb5:ba68:f595 prefixlen 64 scopeid 0x20<link>
inet6 fec0::a846:a947:b483:fe1d prefixlen 64 scopeid 0x40<site>
inet6 fec0::e8eb:5a15:e68:702b prefixlen 64 scopeid 0x40<site>
ether 00:1a:4d:f2:50:68 txqueuelen 1000 (Ethernet)
RX packets 13 bytes 3383 (3.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 127 bytes 17382 (17.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
原始 /etc/network/interface 文件显示:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
我像这样编辑它:
iface enp3s0 inet static
address 192.168.0.115
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
有些指南建议编辑 resolv.conf 文件。原始文件:
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53