ASR1k OTV的三个时间戳

1. ARP的老化时间

OTV有ARP suppress feature – ARP ND Cache,它只会允许通过第一个ARP,并记在缓存中,后续的到同样地址的ARP会被阻止,由OTV设备代理回复,这个时间是600s,10分钟,用”show otv detail“可以查看,这个时间不能更改,但可以关闭!在一些特殊的环境中可能需要!
otv-time-01

ASR1004-1#sh otv de | i ARP
 ARP Suppression Enabled  : Yes
 ARP Cache Timeout        : 600 seconds
ASR1004-1#
ASR1004-1#sh otv arp-nd-cache 
Overlay0 ARP/ND L3->L2 Address Mapping Cache
BD     MAC            Layer-3 Address  Age (HH:MM:SS) Local/Remote
16     1c1d.8646.5ec4 21.21.21.253     00:00:04       Remote

ASR1004-1(config)#int overlay 0
ASR1004-1(config-if)#no otv suppress arp-nd ?

完整阅读

ASR9k + Freeradius

Refer to IOX + Freeradius article that very less on Internet and lots of IOS with Freeradius, after study that, I summarized that by follow:

1: Install freeradius
You need install free radius first, ignore the part, you can check it by yourself or check my last article <RHEL7 install freeradius>

2: Config freeradius
clients.conf

[root@frank radius]# more /etc/raddb/clients.conf
client 10.x.x.x {
        secret = cisco123
        shortname = iox-5.2.2
        nas_type = cisco
}

users

Notes: as follow, we can assign a group for user “frank”, now priv5 is custom group, you can assign default group, e.g:
Cisco-avpair = “shell:task=#netadmin,#sysadmin,#cisco-support”

Btw, you can direct defined priv15 by follow:
Cisco-AVPair = “shell:priv-lvl=15”

Or direct defined cmd by follow:
Cisco-AVpair = “shell:cmd=show”

If you assign cisco-support group first, and then to limit command by “cmd=show”, cmd will unavailable; and vice versa.

[root@frank radius]# more /etc/raddb/users
frank   Cleartext-Password := "frank"
                Service-Type = NAS-Prompt-User,
                Reply-Message = "Hello!",
                Login-Service = Telnet,
                Cisco-AVPair = "shell:tasks*=#priv5,"

完整阅读

RHEL7 Install/Use Freeradius

原来一直在windows上用Freeradius,使用步骤简单,没仔细想工作原理,不过win版本总有些小问题。昨天把它装到RHEL7上了,折腾了一天,总算基本搞明白了里面的大概结构,如下所示:

安装部分

为了解决继承关系问题,最好安装做好的rpm包,对于freeradius有很多包,不用困惑,这是由于freeradius可以跟其他组件组合使用如LDAP或MYSQL等。我直接安装了一个干净的包,不带其他组件:
完整阅读

Python mini project backup

Python的课程终于结束了,真的很费时间,虽然拿到的分不高,但总算是从头到尾学了一遍,收获还是有的,下面是最终成绩:
Grade Achieved: 91.5% with Distinction

很期待用学到的知识去优化我之前写的CRT+python的脚本~
下面是课程备份,这些程序可能或多或少都存在一些问题,仅供自己以后复习:
Mini-project # 0 – “We want… a shrubbery!”
http://www.codeskulptor.org/#user37_anyV44QTvc_0.py

Mini-project # 2 – “Guess the number” game”
http://www.codeskulptor.org/#user38_bvOh0huwfS_8.py
完整阅读

Python 如何交互删除集合中的元素?

下面是老师提到的方法,感觉不错就拿到这来了:

rock_group=set(["A", "B", "C", "D"])
#里面有4个陨石
def get_rid_of(rock_group, rock_del):
    remove_set = set([])
    #把要remove的陨石放到这个空集合中
    for i in rock_group:
    #遍历rock_group集合,每次i被集合中的元素赋值,一次一个,直到遍历全部
        if i == rock_del:
            remove_set.add(i)
            #如果是碰撞的陨石,加到remove集合中
    rock_group.difference_update(remove_set)
    #打印rock_group和remove两个集合不同的元素
    
get_rid_of(rock_group,"D")
print rock_group
blonde teen swallows load.xxx videos