服务器公司为我的专用服务器分配了一些 IP,但我不知道如何更改它。我应该手动更改 /etc/network/interfaces 中的 IP 号码吗?我的/etc/network/interfaces
文件如下;
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eno1
iface eno1 inet static
address 106.***.***.250
netmask 255.255.255.248
network 106.***.***.248
broadcast 106.***.***.255
gateway 106.***.***.249
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 8.8.8.8
dns-search newenglanddns.io
答案1
如果您的数据中心没有运行 DHCP,您必须执行以下操作:
# device: eth0
auto eth0
iface eth0 inet static
address 10.20.30.40
netmask 255.255.255.0
gateway 10.20.30.1
dns-nameservers 8.8.8.8