我有一个Ubuntu 9.10服务器,我需要设置一个静态的公共IP。
我们的办公室已经有思科的networking设置,所以路由器被configuration为将请求转发到服务器。
以下是来自ISP的信息:
静态IP的:
xyz59
xyz60
xyz61
xyz62
网关:
xyz33
子网掩码:
255.255.255.224
主要名称服务器:
abc245
备用名称服务器:
abc30
我只需要知道在Ubuntu(非graphics)中运行的命令来设置此服务器的静态IP: xyz61
谢谢
我将编辑/etc/network/interfaces来具有以下内容:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo inet loopback address 127.0.0.1 netmask 255.0.0.0 auto eth0 iface eth0 inet static address xyz61 netmask 255.255.255.224 gateway xyz33
虽然您可能需要根据您的系统使用eth0以外的东西。 运行ifconfig会给你一个networking接口列表。 然后你可以为你的DNS条目编辑/etc/resolv.conf :
nameserver abc245 nameserver abc30
最后发出命令
sudo /etc/init.d/networking restart
networkingconfigurationlogging在https://help.ubuntu.com/9.10/serverguide/C/network-configuration.html