This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Jeff Loughridge | |
# July 2014 | |
# jeffl at brooksconsulting-llc.com | |
# enable IPv6 forwarding and ND proxying | |
echo net.ipv6.conf.all.proxy_ndp=1 >> /etc/sysctl.conf | |
echo net.ipv6.conf.all.forwarding=1 >> /etc/sysctl.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Jeff Loughridge | |
# July 2014 | |
# jeffl at brooksconsulting-llc.com | |
# This script provides an example of setting up IPv6 static | |
# ND proxy entries. Edit the V6_START to match | |
# what you see in the DO control panel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Jeff Loughridge | |
# July 2014 | |
# jeffl at brooksconsulting-llc.com | |
# first argument to script must be IPv6 address from DO-allocated | |
# space that is not part of the first /126 (e.g. 0x4 to 0xF as last | |
# hex character |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Demonstrates the use of the 'command' tag to execute arbritrary 'show' commands. | |
# This code was inspired by Ebben Aries's command-jnpr.py at | |
# https://github.com/leopoul/ncclient/blob/master/examples/juniper/command-jnpr.py | |
# | |
# usage: python ncclient_demo.py <show command> <xpath expression> | |
# python ncclient_demo.py 'show route 2600::/64' '//rt-entry/nh' | |
# | |
# Jeff Loughridge | |
# August 2014 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
To use this to mimic the EC2 metadata service entirely, run it like: | |
# where 'eth0' is *some* interface. if i used 'lo:0' i got 5 second or so delays on response. | |
sudo ifconfig eth0:0 169.254.169.254 netmask 255.255.255.255 | |
sudo ./mdserv 169.254.169.254:80 | |
Then: | |
wget -q http://169.254.169.254/latest/meta-data/instance-id -O -; echo | |
curl --silent http://169.254.169.254/latest/meta-data/instance-id ; echo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
function get_ip { | |
# Obtain the IPv4 or IPv6 address | |
VERSION=$1 | |
# Use arp to find the IP address you're looking for via its MAC address: | |
IP=$(ip -$VERSION neighbor show | grep $MAC_ADDRESS | awk '{ print $1 }' ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env snabbswitch | |
local app = require("core.app") | |
local config = require("core.config") | |
local pcap = require("apps.pcap.pcap") | |
local link = require("core.link") | |
local RawSocket = require("apps.socket.raw") | |
local c = config.new() | |
config.app(c, "capture", pcap.PcapReader, "input.pcap") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from jnpr.junos import Device | |
def build_dict(xml): | |
jflow = {} | |
# 1st entry in xml is <inline_jflow_flow_information> | |
inline_jflow_flow_information = xml[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import yaml | |
from jnpr.junos.factory.factory_loader import FactoryLoader | |
from jnpr.junos import Device | |
yml = ''' | |
--- | |
RsvpTable: | |
rpc: get-rsvp-session-information |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import sys | |
from jnpr.junos.utils.config import Config | |
from jnpr.junos import Device | |
from jnpr.junos.exception import * | |
jdev = Device(user='jeffl', host='10.10.10.1', password='pass123') | |
jdev.open(gather_facts=False) |
OlderNewer