Chinaunix首页 | 论坛 | 博客
  • 博客访问: 109236
  • 博文数量: 10
  • 博客积分: 234
  • 博客等级: 二等列兵
  • 技术积分: 137
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 01:24
文章分类

全部博文(10)

文章存档

2012年(10)

我的朋友

分类: LINUX

2012-03-04 10:05:34

一、网卡地址配置
Ubuntu的网络配置文件是:/etc/network/interfaces
1、以DHCP 方式配置网卡
   auto eth0
   iface eth0 inet dhcp
用sudo /etc/init.d/networking restart命令使网络设置生效

2、为网卡配置静态IP地址
sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart

3、设定第二个IP地址(虚拟IP地址)
sudo vi /etc/network/interfaces
auto eth0:1
iface eth0:1 inet static
address 192.168.1.101
netmask 255.255.0
gateway 192.168.1.1
sudo /etc/init.d/networking restart

4、设置主机名称(hostname)
使用下面的命令来查看当前主机的主机名称:
  sudo /bin/hostname
使用下面的命令来设置当前的主机名称:
  sudo /bin/hostname newname

5、配置DNS
   (1) /etc/hosts中加入一些主机名称和这些主机名称对应的IP地址,这是本机的静态查询
   (2) /etc/resolv.conf 
       nameserver *.*.*.*

阅读(42414) | 评论(0) | 转发(2) |
给主人留下些什么吧!~~