GNS3-IOUVM 更改IP地址为静态

在GNS3 IOU VM1.3.9中使用的是 Debian Linux。

Debian中网卡的设置能够经过/etc/network/interfaces文件来进行,

具体可分为三种不一样的配置方式,这里只说2种:DHCP自动获取、静态分配IP地址。
具体设置以下: 在进行配置以前,首先进入/etc/network目录中,编辑interfaces文件,且IOU vm 1.3.9中集成的是nano编辑器
具体命令以下:

nano /etc/network/interfaces
ps:保存退出:CTRL+X  问你是否保存  敲入 Y  文件名不变

一、查看是否有双网卡

ifconfig -a     //获得eth0、 eth一、  eth*.....等网卡信息
注意:若是只有一个eth0,则需在VM机中添加 网络适配器 —— 仅主机模式

二、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


#配置eth0接口为DHCP自动获取
iface eth0 inet dhcp

#开机自动激活eth1接口
auto eth1

#配置eth1接口为静态设置IP地址,(固然也能够DHCP获取,我试的没成功,郁闷)
iface eth1 inet static
address 192.168.56.128
netmask 255.255.255.0
network 192.168.56.0
broadcast 192.168.56.255

#配置网关,可省
gateway 192.168.56.1

#配置NDS,可省
# dns-* options are implemented by the resolvconf package, if installed(DNS设置)
#dns-nameservers 192.168.1.1 
#dns-search test.com


interfaces正文如上


配置完毕后保存,重启计算机(reboot)或网络

重启网络服务便可将网卡配好。(service networking restart)编辑器