leohxj
V2EX  ›  Ubuntu

虚拟机中固定ip问题

  •  
  •   leohxj · Dec 7, 2012 · 3431 views
    This topic created in 4937 days ago, the information mentioned may be changed or developed.
    虚拟机的网络选择了桥接方式。现在想要固定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

    求帮助。谢谢各位。
    Supplement 1  ·  Dec 7, 2012
    sorry, 是ip冲突了。。。
    1 replies    1970-01-01 08:00:00 +08:00
    zl8723
        1
    zl8723  
       Dec 7, 2012
    NAT, DHCP
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1040 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 18:16 · PVG 02:16 · LAX 11:16 · JFK 14:16
    ♥ Do have faith in what you're doing.