最近抽空在EVE上配置测试了下Cisco BNG,把IPoE和PPPoE的功能验证下,记录下来,后续如果遇到排查BNG故障的问题可以借助模拟器验证一些命令和配置之类的。

实验准备

  •  XRv9K: xrv9k-fullk9-x-6.6.3
    • vBNG好像不支持在xrv的镜像上运行,不支持RP base的session,所以这里用XRv9K这个镜像。
  •  CSR 1000v: csr1000vng-universalk9.17.03.02-serial
    • CRS 1000v 用来当DHCP server/DHCP Client/PPPoE Client, 版本没什么特殊的要求。
  •  Freeradius
    • 这里我桥接一个网卡到我的一个linux主机上,上面用docker起了一个freeradius。有关Freeradius相关的配置过程可以参考我的另一篇文章,Configure ASR9K AAA with Freeradius

实验拓扑

https://rory-1251435693.cos.ap-beijing.myqcloud.com/img/image-20220527223117714.png
Read the rest of this entry »

最近有在考DevNet的认证,所以Mark一下如何去查认证考试代码。

参考一下思科certification的介绍页面, Associate -> NA, Professional -> NP, Expert -> Expert.

https://rory-1251435693.cos.ap-beijing.myqcloud.com/img/image-20220520001247684.png

主要记录下DevNet各个考试的代码,以便后续查找.

DevNet Associate(100题)

NamePrice
200-901 DEVASCDevNet Associate Exam v1.0300$

DevNet Professinal

Professinal 对应的是NP, 需要2门考试才为NP; 两门考试一门为Core Exam, 一门Concentration Exam; Concentation Exam 有多个方向, 选择一个方向的考试考过即可。

Core Exam(100题)

NamePrice
350-901 DEVCORDeveloping Applications using Cisco Core Platforms & APIs400$

Concentration Exam (50题)

NamePrice
300-435 ENAUTOAutomating and Programming Cisco Enterprise Solutions v1.0300$
300-835 CLAUTOAutomating Cisco Collaboration Solutions300$
300-635 DCAUTOAutomating and Programming Cisco Data Center Solutions v1.0300$
300-535 SPAUTOAutomating and Programming Cisco Service Provider Solutions300$
300-735 SAUTOAutomating and Programming Cisco Security Solutions v1300$
300-910 DEVOPSImplementing DevOps Solutions and Practices using Cisco Platforms300$
300-915 DEVIOTDeveloping Solutions using Cisco IoT & Edge Platforms300$
300-920 DEVWBXDeveloping Applications for Cisco Webex and Webex Devices300$

DevNet Expert

需要先行通过350-901 Core Examp, 然后需要通过8h Lab Exam才可获得。

Note

  •  DevNet Associate (200-901)
  •  DevNet Professinal
    •  Core Exam (350-901)
    •  Concentration Exam (To Cont…)

使用的MIB 库为CISCO-PING-MIB, 具体步骤如下:

# 清除之前操作
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 6
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 6

#创建实例编号为 111 的条目
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 5

#设置ping 的name
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.15.111 s test
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"

# 设置 ping的包位IP 包
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.2.111 i 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1

# 设置ping的地址位 9.1.0.6 > hex 09010006
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.3.111 x 09010006
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06

#设置ping的个数
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.4.111 i 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5

#设置vrf name
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.17.111 s 123
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"
[root@server1 ~]#
[root@server1 ~]#

#检查设置的参数
[root@server1 ~]# snmpwalk -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.5.111 = INTEGER: 100
SNMPv2-SMI::enterprises.9.9.16.1.1.1.6.111 = INTEGER: 2000
SNMPv2-SMI::enterprises.9.9.16.1.1.1.7.111 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.16.1.1.1.8.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.14.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"
[root@server1 ~]#
[root@server1 ~]#

# 执行Ping 操作

[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 1
[root@server1 ~]#

#检查ping的结果
[root@server1 ~]# snmpwalk -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.2.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.3.111 = Hex-STRING: 09 01 00 06
SNMPv2-SMI::enterprises.9.9.16.1.1.1.4.111 = INTEGER: 5
SNMPv2-SMI::enterprises.9.9.16.1.1.1.5.111 = INTEGER: 100
SNMPv2-SMI::enterprises.9.9.16.1.1.1.6.111 = INTEGER: 2000
SNMPv2-SMI::enterprises.9.9.16.1.1.1.7.111 = INTEGER: 0
SNMPv2-SMI::enterprises.9.9.16.1.1.1.8.111 = INTEGER: 2
SNMPv2-SMI::enterprises.9.9.16.1.1.1.9.111 = Counter32: 5          <<<< send packet
SNMPv2-SMI::enterprises.9.9.16.1.1.1.10.111 = Counter32: 5        <<<< receive packet
SNMPv2-SMI::enterprises.9.9.16.1.1.1.11.111 = INTEGER: 1           <<<< Minrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.12.111 = INTEGER: 1           <<<<Avgrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.13.111 = INTEGER: 1           <<<<Maxrtt
SNMPv2-SMI::enterprises.9.9.16.1.1.1.14.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.15.111 = STRING: "test"
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 1
SNMPv2-SMI::enterprises.9.9.16.1.1.1.17.111 = STRING: "123"

#删除ping 实例
[root@server1 ~]# snmpset -v 2c -c  cisco 172.18.120.183 1.3.6.1.4.1.9.9.16.1.1.1.16.111 i 6
SNMPv2-SMI::enterprises.9.9.16.1.1.1.16.111 = INTEGER: 6

In general, the structure of the syslog messages generated by IOS-XR has the following format:

<PRI><messageid>: <hostname> <linecard>:<datetime>: <process-name>[<process-id>]: %<facility-name>-<severity>-<tag>: <MSG>

  • messageid: The ID number of the message.
  • hostname: The device that generated the message.
  • linecard: The linecard slot.
  • datetime: The time when the message was generated in the format: MMM dd hh:mm:ss.fff or MMM dd hh:mm:ss.fff ZZZ.
  • process-name: The name of the process that generated the mesage.
  • process-id The PID of the process that generated the message.
  • facility-name: The name of the Facility.
  • severify: The value of the Severity.
  • tag: The syslog message tag.
<PRI>

<PRI> 包含两个内容5 bit Facility 和 3 bit Log Level.

Facility 用来表示log信息的来源或者说是log 信息的类别,默认IOS XR设备使用的是LOCAL 7 , id 23。

我们可以在log server 上进行定义不同Facility存储在不同文件中,或者具有不同的format格式, 如下。

[root@server1 ~]# grep  local /etc/rsyslog.conf 
local7.*                                                /var/log/boot.log
local6.*                                                /var/log/syslog

IOS XR中可以修改facility , 命令如下

RP/0/RP0/CPU0:CRS-L(config)#logging  facility     ?
  auth    Authorization system
  cron    Cron/at facility
  daemon  System daemons
  kern    Kernel
  local0  Local use
  local1  Local use
  local2  Local use
  local3  Local use
  local4  Local use
  local5  Local use
  local6  Local use
  local7  Local use
  lpr      Line printer system
  mail    Mail system
  news    USENET news
  sys10   System use
  sys11   System use
  sys12   System use
  sys13   System use
  sys14   Systemcode use
  sys9    System use
  syslog  Syslog itself
  user    User process
  uucp    Unix-to-Unix copy system
  <cr>    
<hostname>

默认传递的syslog 中是不包含设备的hostname的,如下是在log server上记录的log,第一行中不包含hostname; 通过在IOS XR 设备上添加配置”logging hostname <WORD>”可以传递自己自定义的hostname,见第二行输出。

Apr 14 23:34:38 10.1.1.1 462388: LC/0/6/CPU0:Apr 15 09:02:48 : plim_xge[301]: %L2-PLIM-4-XFP_WARN_RX_PWR : Interface TenGigE0/6/0/9, RX Low power warning occurred 
Apr 14 23:50:04 10.1.1.1 462620: CRS-L RP/0/RP0/CPU0:Apr 15 09:18:13 : config[65956]: %MGBL-CONFIG-6-DB_COMMIT : Configuration committed by user 'xuxing'. Use 'show configuration commit changes 1000000229' to view the changes.

TWAMP(Two-Way Active Measurement Protocol,双向主动测量协议)是一种用于IP链路的网络质量测量技术,它使用UDP报文测量网络双向路径时延、抖动及丢包率。TWAMP-light是TWAMP协议的轻量级架构,简化了建立性能测量会话的控制协议,提高了测试性能。

如下TWAMP 与TWAMP light 主要区别在于Twamp 需要先使用TCP建立控制层面。

TWAMP

rfc5357

TWAMP light

rfc5357
Read the rest of this entry »

在上篇文章中使用了ISE作为AAA server,ISE功能上虽然较多,但是对于新手操作起来还是有些繁琐。所以我在想是否能找到AAA server替代品,只需要简单的配置就可以满足我认证测试的需求,然后我就找到freeradius。所以本文就介绍下我在测试freeradius时遇到的一些坑以及排错。

freeradius/freeradius-server

Starting the server

docker run --rm --name my-radius -d freeradius/freeradius-server

使用上述命令就可以快速创建一个radius server,添加“–rm”使容器停止后自动删除.

由于这个容器中没vi/nano command,我无法去编辑配置文件,所以在将docker run起来后进去将配置文件copy 出来一份,在本地进行修改。

[root@server1 ~]# docker exec -it my-radius /bin/bash
root@3c05e2ec2770:/# cd /etc/raddb
root@3c05e2ec2770:/etc/raddb# ls -al
total 148
drwxr-s--x. 9 freerad freerad  4096 Oct  7 19:58 .
drwxr-xr-x. 1 root    root       66 Feb 22 02:21 ..
-rw-r--r--. 1 root    root    20819 Oct  7 17:00 README.rst
drwxr-s--x. 2 freerad freerad  4096 Oct  7 20:00 certs
-rw-r-----. 1 root    freerad  8323 Oct  7 17:00 clients.conf
-rw-r--r--. 1 root    freerad  1440 Oct  7 17:00 dictionary
-rw-r-----. 1 root    freerad  2661 Oct  7 17:00 experimental.conf
lrwxrwxrwx. 1 root    root       28 Oct  7 17:00 hints -> mods-config/preprocess/hints
lrwxrwxrwx. 1 root    root       33 Oct  7 17:00 huntgroups -> mods-config/preprocess/huntgroups
drwxr-xr-x. 2 root    root     4096 Oct  7 19:58 mods-available
drwxr-xr-x. 9 root    root      126 Oct  7 19:58 mods-config
drwxr-xr-x. 2 root    root     4096 Oct  7 19:58 mods-enabled
-rw-r--r--. 1 root    root       52 Oct  7 17:00 panic.gdb
drwxr-s--x. 2 freerad freerad   205 Oct  7 19:58 policy.d
-rw-r-----. 1 root    freerad 28825 Oct  7 17:00 proxy.conf
-rw-r-----. 1 root    freerad 31521 Oct  7 17:00 radiusd.conf
drwxr-s--x. 2 freerad freerad  4096 Oct  7 19:58 sites-available
drwxr-s--x. 2 freerad freerad    41 Oct  7 19:58 sites-enabled
-rw-r--r--. 1 root    root     3470 Oct  7 17:00 templates.conf
-rw-r--r--. 1 root    root     8536 Oct  7 17:00 trigger.conf
lrwxrwxrwx. 1 root    root       27 Oct  7 17:00 users -> mods-config/files/authorize
root@3c05e2ec2770:/etc/raddb# 
root@3c05e2ec2770:/etc/raddb# 
root@3c05e2ec2770:/etc/raddb# cat clients.conf
root@3c05e2ec2770:/etc/raddb# cat mods-config/files/authorize
root@3c05e2ec2770:/etc/raddb# cat /etc/freeradius/sites-enabled/default
root@3c05e2ec2770:/etc/raddb# exit
exit
[root@server1 ~]# docker stop  my-radius      <<< 停止容器,因为后面我们要使用自己定义的配置文件启动
my-radius
[root@server1 ~]# 
Read the rest of this entry »

Reference

本文章是自己配置ISE过程的总结,主要参考的是上面文章, 其中最主要的是第一篇(知乎),我认为是最全的ISE配置介绍。

ISE Setup(3.1)

ISE启用设备管理

Administration->System->Deployment

Read the rest of this entry »

Notes.

aaa authorization exec console local
aaa authentication login console local
aaa authorization commands console none

line console
 authorization commands console
 login authentication console
 authorization exec console

在变更AAA配置之前一定要确保将console 配置为本地认证授权, 防止错误的配置导致无法修改配置.

或者在变更AAA配置时不使用commit,使用”commit confirmed minutes x“.

这条命令的意思是如果不进行第二次”commit“ 操作,配置将在x分钟后进行配置回滚

RP/0/RSP0/CPU0:ios(config)#commit confirmed minutes 5
测试AAA, 测试无误后再进行commit
RP/0/RSP0/CPU0:ios(config)#commit

default VRF

tacacs source-interface Loopback0 vrf default
tacacs-server host 10.70.79.177 port 49
 key 7 110A1016141D
!
aaa accounting commands default start-stop group tacacs+
aaa authorization exec console local
aaa authorization exec default group tacacs+ local
aaa authorization commands console none
aaa authorization commands default group tacacs+ none
aaa authentication login console local
aaa authentication login default group tacacs+ local

non-default VRF

tacacs source-interface MgmtEth0/RSP0/CPU0/0 vrf MGMT
tacacs-server host 10.70.79.177 port 49
 key 7 110A1016141D
!
aaa accounting commands default start-stop group XU
aaa group server tacacs+ XU
 server 10.70.79.177
 vrf MGMT
!
aaa authorization exec console local
aaa authorization exec default group XU local
aaa authorization commands console none
aaa authorization commands default group XU none
aaa authentication login console local
aaa authentication login default group XU local
Read the rest of this entry »

« Older entries § Newer entries »