Linux-Ubuntu8.10下固定IP设置

来源:互联网 发布:中兴软件南昌公司如何 编辑:程序博客网 时间:2024/04/23 16:56

在Ubuntu8.10版本中直接通过“系统-首选项-Network Configuration-有线”中通过编辑“Auto eth0”的IPV4设置。可是每次设置后,重启计算机都恢复到原样了。

为了永久的保存固定IP,需要通过命令设置,基本需要操作的有2个文件,总共4个步骤
1、编辑/etc/network/interfaces
2、编辑/etc/resolv.conf
3、重启网卡
4、重启计算机


具体内容:

步骤一中需要添加的代码(IP内容):
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
    address 192.168.1.98
    netmask 255.255.255.0
    gateway 192.168.1.1

步骤二中需要添加的代码(DNS服务器):
# Generated by NetworkManager
nameserver 202.100.199.8
nameserver 202.100.192.68

步骤三中重启网卡:
sudo /etc/init.d/networking restart

步骤四中重启计算机:
sudo shutdown -r 0

文章出处:DIY部落(http://www.diybl.com/course/6_system/linux/Linuxjs/20090824/170618.html)

原创粉丝点击