LinuxSir.cn,穿越时空的Linuxsir!

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

各位看看我的IP配置有问题吗?

[复制链接]
发表于 2005-11-8 16:49:45 | 显示全部楼层 |阅读模式
http://www.linuxsir.cn/bbs/attac ... tid=30377&stc=1

eth0  配置是192.168.0.69 255.255.255.0 gw是192.168.0.1
DNS是192.168.0.2

但是就使上不了网,不知为何。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2005-11-8 17:33:27 | 显示全部楼层
cat /etc/network/interfaces

route -n

看看!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-8 17:53:03 | 显示全部楼层
看啥?有啥用?

谁有/etc/network/interfaces的模版,我想直接修改这个文件,但是不知道怎么写。

谁给个模版看看?
回复 支持 反对

使用道具 举报

发表于 2005-11-8 17:57:17 | 显示全部楼层
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# auto eth1
iface eth1 inet dhcp

auto eth0
iface eth0 inet static
        address 10.1.31.6
        netmask 255.255.255.0
        network 10.1.31.0
        broadcast 10.1.31.255
        gateway 10.1.31.254
回复 支持 反对

使用道具 举报

发表于 2005-11-8 18:01:41 | 显示全部楼层
auto eth0表示开机时自动启用
iface eth0 inet static
表示eth0设置的静态IP地址
iface eth1 inet dhcp
表示eth1设置的是动态ip地址,在启用eth1时将动态获取

修改后
ifdown eth0
ifup eth0就可以用新的设置了。

route -n是查看路由信息的。
如果多个接口均设置了gateway的话,可能导致路由异常。
回复 支持 反对

使用道具 举报

发表于 2005-11-8 19:17:42 | 显示全部楼层
auto eth0表示开机时自动启用
iface eth0 inet static
表示eth0设置的静态IP地址
iface eth1 inet dhcp
表示eth1设置的是动态ip地址,在启用eth1时将动态获取

修改后
ifdown eth0
ifup eth0就可以用新的设置了。

route -n是查看路由信息的。
如果多个接口均设置了gateway的话,可能导致路由异常。
回复 支持 反对

使用道具 举报

发表于 2005-11-8 20:22:49 | 显示全部楼层
你确定DNS是192.168.0.2吗?它有域名解析的功能吗


http://hngyzx.cn
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-11-9 14:32:53 | 显示全部楼层
我是在虚机上装的Linux,我在windows下面的dns就是192.168.0.2。
应该是吧。
回复 支持 反对

使用道具 举报

发表于 2005-11-9 21:22:56 | 显示全部楼层
虚拟机中:
应该是dhcp

auto eth0
iface eth0 inet dhcp
回复 支持 反对

使用道具 举报

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

本版积分规则

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