Home > 系统管理 > [Linux]Ubuntu配置修改网络连接配置

[Linux]Ubuntu配置修改网络连接配置

Ubuntu的网络配置与CentOS相比区别不大,具体方法如下:

1.使用编辑器打开网卡的配置文件,这里默认使用eth0

vi /etc/network/interfaces

键入以下内容

# The loopback network interface
auto lo
iface lo inet loopback
 
# The primary network interface
auto eth0 #自动配置eth0
iface eth0 inet static #设置为静态配置,需要动态获取ip时可选dhcp
address 192.168.0.100 #IP地址
broadcast 192.168.0.255 #对应的子网广播地址
netmask 255.255.255.0 #子网掩码
network 192.168.0.0 #网络地址
gateway 192.168.0.1 #网关地址,可选设定


2.修改DNS解析,编辑resolv.conf文件

vi /etc/resolv.conf

键入

nameserver 8.8.8.8 
nameserver 8.8.4.4

修改完resolv.conf后dns解析会立即生效

3.重启网络配置

/etc/init.d/networking restart
Categories: 系统管理 Tags: , ,
  1. July 3rd, 2014 at 17:50 | #1

    Properly just considered i’d say howdy. Terrific web site Ian.

  2. July 8th, 2014 at 15:56 | #2

    Its great to be here!Wish you all a pleased time.

  3. August 4th, 2014 at 18:24 | #3

    Good to determine all people posting! Great luck to all, except against me!

  4. August 21st, 2014 at 09:32 | #4

    all dear,meet the following with exact same interest.

  1. No trackbacks yet.
You must be logged in to post a comment.