V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
leohxj
V2EX  ›  Ubuntu

虚拟机中固定ip问题

  •  
  •   leohxj · 2012-12-07 10:40:58 +08:00 · 2817 次点击
    这是一个创建于 4182 天前的主题,其中的信息可能已经有所发展或是发生改变。
    虚拟机的网络选择了桥接方式。现在想要固定ip.
    修改了 /etc/network/interfaces,设置如下:
    auto lo
    iface lo inet loopback

    # The primary network interface
    #auto eth0
    #iface eth0 inet dhcp
    iface eth0 inet static
    address 192.168.100.22
    netmask 255.255.255.0
    gateway 192.168.100.1
    auto eth0

    现在能ping同同网络的主机,但是ping不通网关(192.168.100.1),也ping不通外网的ip地址。
    route -e如下:
    Kernel IP routing table
    Destination Gateway Genmask Flags MSS Window irtt Iface
    default 192.168.100.1 0.0.0.0 UG 0 0 0 eth0
    192.168.100.0 * 255.255.255.0 U 0 0 0 eth0

    求帮助。谢谢各位。
    第 1 条附言  ·  2012-12-07 12:09:52 +08:00
    sorry, 是ip冲突了。。。
    1 条回复    1970-01-01 08:00:00 +08:00
    zl8723
        1
    zl8723  
       2012-12-07 11:55:42 +08:00
    NAT, DHCP
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   994 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:00 · PVG 04:00 · LAX 13:00 · JFK 16:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.