PnetLab添加自己制作的镜像

编程入门 行业动态 更新时间:2024-10-28 03:33:36

随着技术的发展许多厂商都发布了基于虚拟化的网络设备镜像,这些镜像默认在PnetLab是没有的,需要我们手动添加,把第三方的qcow2设备镜像添加到PnetLab中主要分三步。

1.上传镜像文件

将镜像文件上传到/opt/unetlab/addons/qemu,镜像文件目录名一定要为xxx-xxx如:hillstone-sg6000,test-1,镜像文件名为hda.qcow2,hdd.qcow2,按照顺序排列

2.创建模板文件

在/opt/unetlab/html/templates/目录下下创建xxx.yml,所有的templates文件都放在/opt/unetlab/html/templates/目录里面,可以复制一个已有的来修改保存,也可以自己创建一个

eve-ng模板文件目录按cpu做了区分/opt/unetlab/html/templates/intel/ |/opt/unetlab/html/templates/amd/
模板文件内容
huaweiusg6kv.yml

---
type: qemu
description: Huawei USG6000v
name: HUSG6000v
cpulimit: 1
icon: Firewall.png
cpu: 2
ram: 4096
ethernet: 6
console: vnc
qemu_arch: x86_64
qemu_version: 4.1.0
qemu_nic: virtio-net-pci
qemu_options: -machine type=pc,accel=kvm -vga std -usbdevice tablet -boot order=cd
...

3.修改config文件

第一次需要创config.php文件

mv /opt/unetlab/html/includes/config.php.distribution /opt/unetlab/html/includes/config.php

修改config.php文件,添加新设备的模板名称和版本

<?php
// TEMPLATE MODE .missing(显示所有的设备) or .hided(隐藏没有镜像文件设备)
DEFINE('TEMPLATE_DISABLED','.missing') ;
/*   Define custom templates:
 *
 *   Create for exemple /opt/unetlab/html/templates/mytemplate.yaml and Create /opt/unetlab/html/templates/othertemplate.yaml
 *   Then uncomment lines below
 */
   $custom_templates =  Array(
   			//模板名称		 版本
           'hillstone' => 'hillstone5.5R1',
   );
?>

启动镜像需要cpu开启虚拟化
更多内容请关注bogl

更多推荐

PnetLab添加自己制作的镜像

本文发布于:2023-10-23 20:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1521873.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:镜像   PnetLab

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!