LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1371|回复: 7

菜鸟问题:如何把当前DHCP方式改成指定的IP地址?

[复制链接]
发表于 2005-10-20 00:59:35 | 显示全部楼层 |阅读模式
装DEBIAN的机器连在路由上
安装的时候自动使用的是DHCP
SO
每次内网IP都动态分配访问起来很不爽

请问如何才能把DHCP方式修改为指定内网IP地址和DNS?
多谢
发表于 2005-10-20 01:37:01 | 显示全部楼层
改/etc/network/interface
把里面的dhcp改成static下面加上address,netmask,broadcast,gateway等。
DNS好像在/etc/resolv.conf里写
nameserver *****
回复 支持 反对

使用道具 举报

发表于 2005-10-20 01:37:38 | 显示全部楼层
有图形界面的话按照提示配置一下网卡,字符界面的话在/etc/network/interface里写如固定ip和dns
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-20 01:46:42 | 显示全部楼层
Post by starboys
改/etc/network/interface
把里面的dhcp改成static下面加上address,netmask,broadcast,gateway等。
DNS好像在/etc/resolv.conf里写
nameserver *****

谢谢
可否给个示例文件
我的interface下边没有address,netmask,broadcast,gateway。。。等设置


我的interface
  1. # This file describes the network interfaces available on your system
  2. # and how to activate them. For more information, see interfaces(5).

  3. # The loopback network interface
  4. auto lo
  5. iface lo inet loopback

  6. # The primary network interface
  7. auto eth0
  8. iface eth0 inet dhcp
复制代码

多谢!
回复 支持 反对

使用道具 举报

发表于 2005-10-20 01:50:25 | 显示全部楼层
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 202.116.90.137
        netmask 255.255.255.0
        network 202.116.90.0
        broadcast 202.116.90.255
        gateway 202.116.90.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 202.116.64.1
        dns-search whm.com
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-10-20 01:59:21 | 显示全部楼层
Post by troyme
# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
        address 202.116.90.137
        netmask 255.255.255.0
        network 202.116.90.0
        broadcast 202.116.90.255
        gateway 202.116.90.1
        # dns-* options are implemented by the resolvconf package, if installed
        dns-nameservers 202.116.64.1
        dns-search whm.com

many tnx!!!!
回复 支持 反对

使用道具 举报

发表于 2005-10-20 09:00:07 | 显示全部楼层
原来dns也可以写在/etc/network/interface里,我按照gentoo手册里一直是在/etc/resolv.conf里改。
回复 支持 反对

使用道具 举报

发表于 2005-10-20 11:21:14 | 显示全部楼层
也有简单配置界面
etherconf

#apt-get install etherconf

安装后有向导,以后要用时可以

#dpkg-reconfigure etherconf
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表