Chinaunix首页 | 论坛 | 博客
  • 博客访问: 50631
  • 博文数量: 30
  • 博客积分: 25
  • 博客等级: 民兵
  • 技术积分: 80
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-29 19:00
文章分类
文章存档

2014年(1)

2013年(25)

2012年(4)

我的朋友

分类: LINUX

2014-03-06 12:04:13

一、网卡地址配置
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 *.*.*.*

阅读(870) | 评论(0) | 转发(0) |
0

上一篇:win7下硬盘安装rhel6

下一篇:没有了

给主人留下些什么吧!~~