修改静态ip,将这个ubuntu系统作为服务器,以便于我们远程连接,方便操作。
- * 给系统的网络连接方式改为“桥接网卡“ *
* 启动虚拟机,查看当前网络配置信息 *
ifconfig
* 修改配置文件 *
- ubuntu网络配置文件为:/etc/network/interfaces
sudo vi /etc/network/interfaces
- 修改如下:
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet static
address 192.168.20.90
netmast 255.255.255.0
gateway 192.168.20.1
dns-nameservers 202.106.196.115
- * 重启网络使配置生效 *
sudo /etc/init.d/networking restart
重启之后网络及DNS均能正常使用 - * 之后我们就可以通过mac终端连接服务器 *
sudo ssh limngxia@192.168.20.90