Archive

‘学习笔记’ 分类存档

网络设备信息采集脚本

在常规测试中,经常需要在测前、测后抓取大量信息留存,不同厂商命令又不一样,黏贴复制采集工作量巨大,效率又低,所以需要写一个自动化脚本帮助自动化采集。自动化脚本有很多种方法编写,这里主要使用简单易用的Python,由于使用的是SecureCRT,所以直接选择了Python与SecureCRT的组合自动化脚本,其实之前写过一些,不过此篇用到了多个Session;

SecureCRT最开始支持VB脚本,后来逐步转到Python。官网也有很多example可以供参考,如果感兴趣可以参考:

https://www.vandyke.com/support/securecrt/python_examples.html 

https://www.vandyke.com/support/tips/tabscripts.html

脚本功能

此自动化脚本可以复用,根据需求任意更改,简单上手;另外Juniper带“table”的命令会扰乱SecureCRT的脚本,更改后恢复正常,代码正文中的是最终版本,同时也去掉了等待时间;其实脚本还可以优化下,但为了简单点,就写了10多个函数;

  1. 指定路径并按照“日_时分”格式自动创建文件夹;
  2. SecureCRT自动登录14台路由设备,并开启记录log功能;
  3. 采集14台设备信息,自动保存log,以“年-月-日-时-分”命名log文件;
  4. 采集后自动关闭Session;
show route yyyyyyyy extensive table C-CT |no-more\r
完整阅读

Install EVE-NG by KVM in CentOS

安装KVM组件

此步骤略,具体信息可以自行查阅

通过Virsh管理KVM

[root@host] $ virsh list
 Id    Name                           State
----------------------------------------------------

[root@host] $ virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     centos-test                    shut off

[root@host] $
[root@host] $ brctl show
bridge name     bridge id               STP enabled     interfaces
br0             8000.b8599f1ef79e       no              eth2
virbr0          8000.5254004de69f       yes             virbr0-nic
[root@host] $
[root@host] $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         172.16.211.1    0.0.0.0         UG    0      0        0 br0
169.254.0.0     0.0.0.0         255.255.0.0     U     1007   0        0 br0
172.16.211.0    0.0.0.0         255.255.255.0   U     0      0        0 br0
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
完整阅读

Enable Wireguard in Synology 918+

Some applications only working in same broadcast, so vpn feature is must have when access personal resource (e.g: NAS) from Internet. The artical only cover Wireguard, but not include theory.

Install APP

Follow up by the Github for synology-wireguard, not summarized again. Just put the spk that base on DSM7.0:

Follow base on DSM7.2:

完整阅读

EVPN ELAN over SRTE

在此篇文章里,简单总结下通过SRTE调度EVPN ELAN的流量,然后通过show信息,来查看引流及相关内容,并熟悉EVPN,EVPN基础部分,可以参考之前的文章,里面包含Route Type的信息:EVPN Summary

另外对于ELAN的引流,有很多种选择,常见的是通过对RT1打Color,调用单播流量;对RT3打Color,调用多播流量;对于RT1我们可以看成L3VPN中的“VRF”,也就是基于“VRF”颗粒度进行引流,这么理解可能更好理解

物理拓扑

完整阅读

How To Deploy STC VM by QEMU?

Introduction

Virtual STC inclulde 3 components:

  • License Server VM
  • Application: Spirent TestCenter
  • Virtual TestCenter: STC port VM

Different platoform have diff version, e.g Virtual TestCenter have ESXi platform or QEMU platform, different platform have diff License, if use incorrect platform or License, will have alarm, e.g:

So I summarized hwo to deploy STC VM by QEMU in the article.

完整阅读
blonde teen swallows load.xxx videos