ROS软路由论坛 ROSABC.com 网络方案网络工程交流

 找回密码
 会员注册

QQ登录

只需一步,快速开始

查看: 3879|回复: 1

[Default默认分类] [MetaRouter 介绍] MetaRouter 是 RouterOS 从 4.0beta1 和 3.21 版本开始

[复制链接]
发表于 2013-4-21 04:53:01 | 显示全部楼层 |阅读模式

马上注册成为ROSABC会员,随时发帖回复。

您需要 登录 才可以下载或查看,没有账号?会员注册

x
MetaRouter 介绍

MetaRouter 是 RouterOS 从 4.0beta1 和 3.21 版本开始新增加的功能,当前 MetaRouter,只能用于 RB400 系列,用于创建虚拟机,在以后会有更多的硬件平台增加此功能。每一个 Metarouter 是使用设备相同的资源, 建立独立的 RouterOS 系统。每一个 Metarouter 至少需要 16M 的 RAM。16M 是绝对最小的值,建议为每一 个 Metarouter 使用更大的 RAM。

当前可以创建 8 个 Metarouter 虚拟机,将来新的版本会增加到 16 个。在主设备上,你可以创建 8 个虚拟接口 连接到 MetaRouter,唯一可以增加接口的方式只能通过 VLAN。现在 MetaRouter 虚拟机还不能支持外部存 储设备。

MetaRouter 功能常用于允许客户或者低特权用户访问自己的“路由”,并根据他们需要自己配置参数,这样不 需要另外一个真实的路由器。例如:一个 ISP 能创建一个虚拟路由器,允许特定的用户通过以太接口访问,并 定义他们自己的防火墙规则,但只有又不会影响主设备的运行。

在/metarouter 目录下给出了一下命令:

-- add – 允许你创建一个新的虚拟路由器

-- print – 通过列表显示当前所有虚拟路由器

-- enable – 启用一个虚拟路由器

-- disable – 禁用一个虚拟路由器

-- console – 访问一个虚拟路由器的控制台

-- interface – 映射相应的网络接口

创建一个 MetaRouter


[admin@RB_Meta] /metarouter> add name=mr0 memory-size=32 disk-size=32000 disabled=no

[admin@RB_Meta] /metarouter> print
Flags: X - disabled
# NAME MEMORY-SIZE DISK-SIZE USED-DISK STATE

0 mr0 16MiB 0kiB 377kiB running

-- name: 虚拟路由器的名称

-- memory-size: 分配给虚拟路由器的 RAM 大小

-- disk-size: HDD 的容量,通过 KB 分配给虚拟路由器 (如果设置为 0, 容量默认为动态分配) *

-- used-disk: 当前使用的硬盘空间 currently used disk space

-- state: MetaRouter 运行的状态

注意:MetaRouter 在使用的动态 HDD 空间时,启用代理功能会占用你所有的 HDD 存储!

默认配置

如果你添加一个新的 MetaRouter 没有指定任何参数,默认会添加动态的 HDD 长度,和 16M 的 RAM:


[admin@RB_Meta] /metarouter> add name=mr1
[admin@RB_Meta] /metarouter> print
Flags: X - disabled
# NAME MEMORY-SIZE DISK-SIZE USED-DISK STATE
1 mr1 16MiB 0kiB 3kiB running

添加接口

首先需要添加一个新的接口到你的虚拟路由器上,这个操作在 Interface 目录完成,Interface 命令如下面:


[RouterOS@ROSABC] /metarouter> interface add

comment disabled dynamic-mac-address type virtual-machine copy-from dynamic-bridge static-interface vm-mac-address

我们添加一个接口:


[RouterOS@ROSABC] /metarouter> interface add virtual-machine=mr1 type=dynamic

在物理路由器的 interface 出现一个虚拟接口:



[admin@MikroTik] > /interface print Flags: D - dynamic, X - disabled, R - running, S - slave # NAME TYPE MTU
8 R ether9 ether 1500
9 R test bridge 1500
10 DR vif1 vif 1500

连接虚拟机

连接你的虚拟机,使用 console 命令:

/metarouter console 0

你可以看到你最新添加的虚拟接口:


[admin@mr0] > interface print
Flags: D - dynamic, X - disabled, R - running, S - slave
# NAME TYPE MTU
0 R ether1 ether 1500

从 MetaRouter 的虚拟机控制台断开,按 CTRL + A 和 Q 退回到物理路由器:


[RouterOS@ROSABC] >
[Q - quit connection] [B - send break]
[A - send Ctrl-A prefix] [R - autoconfigure rate] Q
Welcome back!

发表于 2017-6-17 18:00:12 | 显示全部楼层
这个有什么用处
您需要登录后才可以回帖 登录 | 会员注册

本版积分规则

不良信息举报Q:2000617

软路由

不良信息举报Q:2000617|Archiver|ROS软路由论坛 ROSABC.com 网络方案网络工程交流

GMT+8, 2024-5-4 03:50 , Processed in 0.121677 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表