虚拟机的网络选择了桥接方式。现在想要固定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
求帮助。谢谢各位。
修改了 /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
求帮助。谢谢各位。