一、简介

CiscoIOU 全称是Cisco IOS on Unix ,最早的版本是运行于Solaris ,后来出现了iMACUNIX 版本。目前的IOU 只有L3IOU ,对于模拟交换机的L2IOU 还没放出来。

IOU 包含以下文件:

i86bi_linux-adventerprisek9-ms               // 带有IOS 高级特性的IOU

i86bi_linux-ipbase-ms                         // 带有基本IP 路由功能的IOU

i86bi_linux-tpgen+ipbase-ms.PAGENT.4.7.0    // 带有基本IP 路由功能和流量生成工具的IOU

iourc                                        // 就目前来说功能就是lisence

NETMAP                                        // 类似GNS3 中NET 文件,用于构成网络TOP

wrapper-linux                                  //IOU 的管理控制器

 

二、使用方法

安装相应的包:

For Debian/Ubuntu 32bit

apt-get -y install libgcrypt11 libgcrypt11-dev

 

For Debian/Ubuntu 64bit

apt-get -y install libgcrypt11 libgcrypt11-dev ia32-libs

 

For CentOS/Redhat 32bit

yum -y install openssl-devel

 

For Centos/Redhat 64bit

yum -y install openssl-devel glibc

 

安装完相应的包后执行 :

ln -s /usr/lib/libcrypto.so.0.9.8 /usr/lib/libcrypto.so.4     // 不执行会提示动态库找不到

 

三、 IOU 用法

对于以 i86bi 开头的文件,以下参数是通用的

Usage: <p_w_picpath> [options] <application id>

<p_w_picpath>: unix-js-m | unix-is-m | unix-i-m | ...

<application id>: instance identifier (0 < id <= 1024)

Options:

-e <n>          Number of Ethernet interfaces (default 2)  指定ethernet 的模块数量

-s <n>          Number of Serial interfaces (default 2)    指定serial 的模块数量

-n <n>          Size of nvram in Kb (default 16KB)         指定nvram 的大小,默认16K

-b <string>     IOS debug string                          

-c <name>       Configuration file name

-d              Generate debug information

-t              Netio message trace

-q              Suppress informational messages

-h              Display this help

-C              Turn off use of host clock

-m <n>          Megabytes of router memory (default 128MB)  指定路由器的内存,默认128M

-L              Disable local console, use remote console   关闭本地CONSOLE ,使用远程Console

-u <n>          UDP port base for distributed networks     基于分布式网络的UDP 端口号

-R              Ignore options from the IOURC file         忽略IOURC 文件

-U              Disable unix: file system location

-W              Disable watchdog timer

-N               Ignore the NETMAP file                     忽略NETMAP 文件

 

 

举例:启动一个路由器,并且Ethnetnet 模块数为4 ,Serial 模块为4, 默认内存为128M ,路由器的进程名为1

./i86bi_linux-adventerprisek9-ms -e 4 -s 4 2

-e 4   //4 ethernet 模块,每个模块4 个接口,接口从0-3

-s 4   //4 Serial 模块,每个模块4 个接口,接口从0-3

2      // 路由器的进程名

在此例中

Ethernet 的接口16 个,从Ethernet0/0----Ethernet3/3

Serial 的接口16 个,从Serial4/0----Serial7/3

接口的规律大家仔细看看就知道了

 

这样启动一个路由器实例默认是用本地CONSOLE 控制的,终止该路由器实例可以使用Ctrl+C

 

 

四、使用NETMAP 建立网络TOP ,并用wrapper-linux 管理器启动一个或多个路由器实例

 

使用i86bi 开头的IOU 来启动路由器实例是很不方便的事,所以可以使用wrapper-linuxNETMAP 结合的方式启动多个路由器实例并组建更复杂的TOP

 

wrapper-linux 用法:

./wrapper-linux [-v] -m<p_w_picpath name> -p<port number> -- [iou options] <router ID>

where <port number> is in the range <1024-65550>

all options after the '--' are passed to iou

[-v] Display version

-m :指定iou p_w_picpath

-p :指定用于telnet 的端口,端口范围是1024-65550

-- :用于传递iou 参数

 

举例:

./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 2000 -- -e 4 -s 4 1

iou p_w_picpath  i86bi_linux-adventerprisek9-ms
telnet
 端口为2000

指定该路由器实例有4 个Ethernet 模块和4 个Serial 模块

1 代表此路由器实例的名字

 

NETMAP 文件的书写格式:

路由器实例名: 插槽号: 该插槽上的接口号

 

1:0/0 2:0/0

1:3/0 2:3/0

第一行意思路由器实例1 的e0/0 连接路由器实例2 的e0/0

第二行意思路由器实例1 的s3/0 连接路由器实例2 的s3/0

如果ethernet 模块数为n ,则serial 的起始插槽号为(n+1 )

IOU 启动的时候不加-e -s 参数的话默认都是2 ,所以Serial 接口的起始插槽号是2+1,s3/0代表该Serial 接口位于第三插槽的第一个接口

 

NETMAP 文件中的路由器实例名要与IOU 启动参数中的路由器实例名要一致!!!

 

PS: 思科设备的接口表示方法:接口类型 插槽号/ 该插槽上的接口号

 

根据TOP 书写NETMAP 文件

 

点击查看原图

 

NETMAP 文件内容:

1:0/0 2:0/0

1:0/1 3:0/0

2:3/0 3:3/0

 

启动三个路由器

./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 2000 -- -e 4 -s 4 1 &

./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 2001 -- -e 4 -s 4 2 &

./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 2002 -- -e 4 -s 4 3 &

 

每条命令后都有& ,这个代表后台运行此程序