nano /etc/network/interfaces
ps:保存退出:CTRL+X 问你是否保存 敲入 Y 文件名不变
1、查看是否有双网卡
ifconfig -a //得到eth0、 eth1、 eth*.....等网卡信息
注意:如果只有一个eth0,则需在VM机中添加 网络适配器 —— 主机模式
2、nano /etc/network/interfaces
以下为配置说明:
网卡通过DHCP自动获取IP地址
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(配置环回口)
# 开机自动激lo接口
auto lo
# 配置lo接口为环回口
iface lo inet loopback
# The primary network interface (配置主网络接口)
#开机自动激活eth0接口
auto eth0
#配置NDS,可省
# dns-* options are implemented by the resolvconf package, if installed(DNS设置)
#dns-nameservers 61.153.177.196 61.153.177.197
#dns-search fireteam.org