LinuxSir.cn,穿越时空的Linuxsir!

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

求助:VM中的Debian设置静态IP不能联网INTERNET

[复制链接]
发表于 2009-7-29 10:44:10 | 显示全部楼层 |阅读模式
各位好,小弟的问题是这样的
我在XP中使用VM虚拟工具安装了DEBIAN的虚拟机,使用桥接模式。
当Debian使用DHCP模式时,是可以访问INTERNET的
但是当我把Debian设置为静态IP时(IP 和DNS得设置保持和DHCP自动获得的一致),我XP机器的IP,网关,DNS IP都可以PING通,但是就是访问不了INTERNET。
$ nslookup www.google.com
Server:         10.100.1.12
Address:        10.100.1.12#53

Non-authoritative answer:
www.google.com  canonical name = www.l.google.com.
Name:   www.l.google.com
Address: 66.249.89.104
Name:   www.l.google.com
Address: 66.249.89.147
Name:   www.l.google.com
Address: 66.249.89.99


ping www.google.com
ping 66.249.89.147
都不通,但是为什么在DHCP模式下就可以呢?
发表于 2009-7-29 11:12:31 | 显示全部楼层
网关不对,仔细查查。
回复 支持 反对

使用道具 举报

发表于 2009-7-29 13:22:01 | 显示全部楼层
debian 网络设置

三个配置文件 configure file:
/etc/hostname
/etc/network/interfaces     //最好把DNS comment
/etc/resolv.conf               //dns server

------------------------------------------------------------------
# /etc/network/interfaces     //最好把DNS comment
# 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 eth0
iface lo inet loopback

# The primary network interface
        allow-hotplug eth0
        iface eth0 inet static
        address 192.168.1.158
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255
        gateway 192.168.1.1

------------------------------------------------------------------
# /etc/resolv.conf               //dns server
#search ns.buaa.edu.cn
nameserver 202.106.0.20

------------------------------------------------------------------
ifconfig  
ifconfig -a

ifconfig eth0 up
ifconfig eth0 down
回复 支持 反对

使用道具 举报

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

本版积分规则

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