我正在使用Ubuntu,并试图将我的连接设置为具有静态IP,而不是动态IP。但是,每当我将它输入/etc/网络/接口时,
auto wlan0
iface wlan0 inet static
address 192.168.1.68
netmask 255.255.255.0
gateway 192.168.1.64我的服务器不能连接到互联网。运行类似sudo apt-get的升级,会产生错误,因为我没有连接到互联网。这是怎么回事?
发布于 2012-07-01 20:12:26
您需要指定DNS服务器。当启用DHCP时,您的服务器将自动获取此信息,这将不适用于静态IP。
发布于 2014-08-06 19:39:43
根据,您确实修改了/etc/network/接口,如下所示。
auto eth0
iface eth0 inet static
address 10.0.0.100
netmask 255.255.255.0
gateway 10.0.0.1
dns-nameservers 8.8.8.8 8.8.8.4
dns-search mydomain.com然后关闭并重新启动接口:
~$ sudo ifdown eth0 && sudo ifup eth0https://help.ubuntu.com/14.04/serverguide/network-configuration.html#ip-addressing
https://askubuntu.com/questions/158413
复制相似问题