Skip to content

Instantly share code, notes, and snippets.

- hosts: IOS
user: aimless
gather_facts: no
tasks:
- name: ter len 0
raw: ter len 0
- name: show ins status
raw: show int status
# more /etc/dhcp/dhclient-exit-hooks
#!/bin/bash
FIRST=`/sbin/ifconfig eth0|grep -i global|cut -d ":" -f2,3,4,5`
SECOND=`/sbin/ifconfig eth0|grep -i global|cut -d ":" -f6,7,8,9|cut -d "/" -f1`
IPV6=$FIRST:a$SECOND
for SUFFIX in `echo {0..9}`;do ifconfig eth0 inet6 add $IPV6$SUFFIX/64 > /dev/null 2>&1; done;
for SUFFIX in `echo {a..f}`;do ifconfig eth0 inet6 add $IPV6$SUFFIX/64 > /dev/null 2>&1; done
# more /etc/dhcp/dhclient-eth0.conf
send vendor-class-identifier "anaconda-Linux 2.6.32-358.el6.x86_64 x86_64";
@kongou-ae
kongou-ae / FortiGate FW policy (.conf)
Last active August 29, 2015 13:57
FortiGate FW policy (.conf)
config firewall policy
edit 13
set srcintf "VLAN-200"
set dstintf "wan1"
set srcaddr "192.168.200.0/24"
set dstaddr "all"
set action accept
set utm-status enable
set identity-based enable
set nat enable
@kongou-ae
kongou-ae / FortiGate FW policy (json)
Last active August 29, 2015 13:57
FortiGate FW policy (json)
{
"config firewall policy": {
"13": {
"srcintf": "VLAN-200",
"dstintf": "wan1",
"srcaddr": "192.168.200.0/24",
"dstaddr": "all",
"action": "accept",
"utm-status": "enable",
"identity-based": "enable",
@kongou-ae
kongou-ae / IOS XRv default config
Created April 2, 2014 13:40
IOS XRv default config
RP/0/0/CPU0:ios#show running-config
Wed Apr 2 13:37:49.326 UTC
Building configuration...
!! IOS XR Configuration 5.1.1
!! No configuration change since last restart
!
interface MgmtEth0/0/CPU0/0
shutdown
!
interface GigabitEthernet0/0/0/0
@kongou-ae
kongou-ae / first login
Created April 2, 2014 15:07
first login
# screen /dev/ttyS0
!!!!!!!!!!!!!!!!!!!! NO root-system username is configured. Need to configure root-system username. !!!!!!!!!!!!!!!!!!!!
--- Administrative User Dialog ---
Enter root-system username: aimless
Enter secret:
Enter secret again:
@kongou-ae
kongou-ae / result of SessionTutorial.py
Created April 4, 2014 03:44
result of SessionTutorial.py
cisco@onepk:~/onePK-sdk-1.2.0.173/python/tutorials/session$ ./SessionTutorial.py -a 10.10.10.110 -R /home/cisco/ca.pem
Enter Username : xxxxxx
Enter Password :
INFO:onep:SessionTutorial:
********* INITIALIZE AND CONNECT *******
INFO:onep:SessionTutorial:Got a NetworkElement -
NetworkElement [ 10.10.10.110 ]
INFO:onep:SessionTutorial:Successfully connected to NetworkElement -
NetworkElement [ 10.10.10.110 ]
@kongou-ae
kongou-ae / BaseTutorial
Created April 4, 2014 15:00
BaseTutorial
cisco@onepk:~/study-onepk$ cat ../onePK-sdk-1.2.0.173/python/tutorials/BaseTutorial.py
#!/usr/bin/env python
# Copyright (c) 2010-2013 by Cisco Systems, Inc.
#
# THIS SAMPLE CODE IS PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY
# BY CISCO SOLELY FOR THE PURPOSE of PROVIDING PROGRAMMING EXAMPLES.
# CISCO SHALL NOT BE HELD LIABLE FOR ANY USE OF THE SAMPLE CODE IN ANY
# APPLICATION.
@kongou-ae
kongou-ae / show_ip_route.py
Created April 6, 2014 10:52
show_ip_route.py
#/usr/bin/env python
# -*- coding: utf-8 -*-
from onep.element import *
from onep.interfaces import *
from onep.routing import *
def getRouteList(network_element):
# 対象機器のルーティングオブジェクトを取得する