ubuntu的网络配置基础

[ 2010-07-19 00:04:29 | Author: Admin ]
Font Size: Large | Medium | Small
 Ubuntu的网络参数保存在文件 /etc/network/interfaces中,默认设置使用dhcp,内容如下:

  # The primary network interface

  auto eth0

  iface eth0 inet dhcp

  设置静态ip的方法如下:

  1) 编辑 /etc/network/interfaces

  1.1)将dhcp 一行屏蔽

  # The primary network interface

  auto eth0

  #iface eth0 inet dhcp

  1.2)添加和静态ip有关的参数

  # The primary network interface

  iface eth0 inet static

  address 192.168.0.10

  netmask 255.255.255.0

  gateway 192.168.0.1

  2)编辑 /etc/resolv.conf,设置dns

  nameserver 202.96.134.133

  nameserver 202.106.0.20

  3)执行下面两个命令,启用新设置

  $sudo ifdown eth0

  $sudo ifup eth0

也可以用/etc/init.d/networking start
Comments Feed Comments Feed: /mine/feed.asp?q=comment&id=328

There is no comment on this article.

Post Comment
Smilies
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
Enable UBB Codes
Auto Convert URL
Show Smilies
Hidden Comment
Username:   Password:   Register Now?
Security Code * Please Enter the Security Code