Ubuntu配置网络

1. 激活服务器的网卡,命令如下:

sudo nano /etc/network/interfaces

在 interfaces 中添加以下内容:

auto eth0
iface eth0 inet static
address 202.113.235.181
netmask 255.255.255.0
gateway 202.113.235.1

这其中,斜体部分标注的 IP 地址是服务器的设置,您需要根据您的具体情况修改。当然,如果服务器使用的是 DHCP 来分配 IP 地址,只需要写上 iface eth0 inet dhcp 就可以了,无需设置 address/netmask/gateway。

注意:使用的是 ADSL,需要装上 pppoe,在 interfaces 中添加以下内容:

auto lo
iface lo inet loopback 

2. 修改 resolv.conf 配置 DNS 服务器

sudo nano /etc/resolv.conf

 

3. 添加您的 DNS 服务器地址:

nameserver 202.113.16.10
nameserver 202.113.16.11

4. 重新启动 networking 服务:

sudo /etc/init.d/networking restart

 

引用:

http://blog.istef.info/2008/10/02/setup-ssh-server-on-ubuntu-server/

 

 

 

 

原文地址:https://www.cnblogs.com/panxihua/p/2657974.html