安装在 vmware 12 里的 ubuntu14.04 64 位,网络模式使用桥接,按照该博客(链接: http://www.cnblogs.com/vincedotnet/p/4013099.html )提供的方法设置静态 ip 后,无法 ssh 登陆,请问该如何设置静态 ip ?
![]() | 1 ICU 2016-06-29 10:21:24 +08:00 在 Ubuntu 中装 ssh 了吗? |
3 zjj2008se 2016-06-29 10:45:23 +08:00 via Android sudo apt-get install openssh-server |
![]() | 4 kozora 2016-06-29 10:52:39 +08:00 ![]() 网络模式使用直接复制物理模式 然后在 /etc/network/interfaces 修改 我把我的例子给你看看 # 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 网卡名 iface 网卡名 inet static address 192.168.1.3 netmask 255.255.255.0 network 192.168.1.1 broadcast 192.168.2.255 gateway 192.168.1.1 dns-nameservers 223.5.5.5 223.6.6.6 |
![]() | 5 zh10086 2016-06-29 10:58:19 +08:00 你看下你能否 ping 外网,你本地连接网络是不是 wifi 连接, wifi 连接的 vm 貌似不能设置静态 ip ,检查 ssh 的端口是不是默认的 22 ,检查防火墙是否开启 |
![]() | 6 ICU 2016-06-29 14:27:38 +08:00 ![]() 解决了没,要不试一下动态的 与楼上那位兄弟的一样的修改方法: 在 /etc/network/interfaces 修改 # 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 网卡名 iface 网卡名 inet dhcp //此处修改为 dhcp 虚拟机的网卡还是保持桥接的模式,之前我连 ubuntu-server16.04 是这么弄的没问题 |
8 Neveroldmilk 2016-06-29 16:46:57 +08:00 默认没启用 SSH ,另外既然是 14.04 那就可以用 networkmanager 设置。 |