我正在使用 Ubuntu 12.04。
我的/etc/network/interfaces文件包括:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.58
gateway 192.168.1.1
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 66.212.63.228 66.212.48.10
Run Code Online (Sandbox Code Playgroud)
我运行了命令: /etc/init.d/networking restart
其中回应:
*Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
*Reconfiguring network interfaces...
RTNETLINK answers: File exists
Failed to bring up eth0
[ OK ]
Run Code Online (Sandbox Code Playgroud)
接下来我运行 ping google.com 并收到:
ping: unknown host google.com
Run Code Online (Sandbox Code Playgroud)
我不确定我的界面是否刷新了。如何使用静态 …
我看到有人说设置静态ip的文件还在 /etc/network/interfaces
而且我看到其他人说 18.04 现在开始了/etc/netplan(人们似乎对此不满意)
我试过把这个:
version: 2
renderer: networkd
ethernets:
eth0:
dhcp4: no
dhcp6: no
addresses: [192.168.1.9/24]
gateway4: 192.168.1.1
nameservers:
addresses: [192.168.1.1, 8.8.8.8, 8.8.4.4]
Run Code Online (Sandbox Code Playgroud)
在我/etc/netplan/50-cloud-init.yaml和做中,sudo netplan apply但这只会终止服务器与互联网的连接。
以前,在 Ubuntu 16.04 上,当 Ubuntu 更新安装dnsmasq包、配置它并使其优先于我自己的超稳定、超快和自己配置的 BIND DNS 服务器时,我感到被出卖了。感觉就像 Ubuntu 入侵了我的工作站。
由于我碰巧是系统管理员,这是非常不可接受的。这是一个吓人的电话。这是当您解决问题并在您使用的步骤之一中时,dig或者nslookup当您看到lo界面回复您时感到震惊。恐慌
有没有办法不仅可以解决这个问题,还可以保证/etc/resolv.conf防篡改?