本文主要是介绍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 文件名不变
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
#配置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)
这篇关于GNS3-IOUVM 更改IP地址为静态的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!