July 04, 2017

landscape

apt-get install landscape-client

cd /etc/landscape

wget https://letsencrypt.org/certs/letsencryptauthorityx3.pem.txt

mv letsencryptauthorityx3.pem.txt letsencryptauthorityx3.pem

landscape-config --computer-title "TEMP" --account-name standalone  --url https://control.wjw.nz/message-system --ping-url https://control.wjw.nz/ping --ssl-public-key /etc/landscape/letsencryptauthorityx3.pem

June 19, 2017

Let's Encrypt Cisco IOS

letsencrypt --manual --perferred-challenges dns certonly -d home-router.wjw.nz



openssl rsa -des -in /etc/letsencrypt/live/home-router.wjw.nz/privkey.pem -out /etc/letsencrypt/live/home-router.wjw.nz/privkey-enc.pem

cat /etc/letsencrypt/live/home-router.wjw.nz/privkey-enc.pem

openssl pkey -des -in /etc/letsencrypt/live/home-router.wjw.nz/privkey.pem -pubout /etc/letsencrypt/live/home-router.wjw.nz/pubkey.pem

crypto key import rsa home-router.wjw.nz.pem exportable pem encryption terminal @Password@

Paste the contents of public key pubkey.pem and type quit on a single line.
Paste the contents of the password protected private key privkey-enc.pem and type quit on a single line.
If the key is accepted, you should read

https://community.letsencrypt.org/t/tutorial-get-lets-encrypt-on-cisco-routers-switches/7139

June 06, 2017

Domain Suffix Search - Cisco Option 119

#!/usr/bin/python
import sys
hexlist = []
for domain in sys.argv[1:]:
    for part in domain.split("."):
        hexlist.append("%02x" % len(part))
        for c in part:
            hexlist.append(c.encode("hex"))
    hexlist.append("00")
print "".join([(".%s" % (x) if i and not i % 2 else x) \
    for i, x in enumerate(hexlist)])


root@control:/home/billw# ./ios-search.py wjw.local wjw.nz
0377.6a77.056c.6f63.616c.0003.776a.7702.6e7a.00


ip dhcp pool inside
 network 192.168.1.0 255.255.255.0
 update dns override
 dns-server 192.168.1.24 192.168.1.14 
 domain-name wjw.local
 default-router 192.168.1.1 
 option 119 hex 0377.6a77.056c.6f63.616c.0003.776a.7702.6e7a.00

June 02, 2017

FritzBox, SipGate, DTMF Tones

Edit Telephone Number
set DTMF Transmission to In-Band

May 30, 2017

TCL Script to ping subnet

foreach subnet {
1
41 } {
for {set i 1} {$i < 255} {incr i} {
ping 192.168.$subnet.$i re 2 ti 0
}
}


001d.46c2.70c0

tcl script for WakeonLAN - IOS 15

home# tclsh
home(tclsh)#

proc WakeOnLan {broadcastAddr macAddr} {
     set net [binary format H* [join [split $macAddr -:] ""]]
     set pkt [binary format c* {0xff 0xff 0xff 0xff 0xff 0xff}]

     for {set i 0} {$i < 16} {incr i} {
        append pkt $net
     }

     # Open UDP and Send the Magic Paket.
     set udpSock [udp_open]
     fconfigure $udpSock -translation binary \
          -remote [list $broadcastAddr 4580] \
          -broadcast 1
     puts $udpSock $pkt
     flush $udpSock;
     close $udpSock
}

home(tclsh)# WakeOnLan 255.255.255.255 000f13cd80a1

 00:11:32:39:87:25

00:11:32:38:E8:EF

April 23, 2017

Using a Dynamic DNS hostname in an Access List on IOS

class-map type inspect match-any Internet_To_Trusted
 match access-group name Allowed-Traffic
 match access-group name IPv6-Allowed-Traffic
 match access-group name uk-nas
!
ip access-list extended uk-nas
 permit tcp host xxx.xxx.xxx.xxx any
!
kron occurrence day8am at 8:00 recurring
 policy-list policy-day8am
!
kron policy-list policy-day8am
 cli tclsh gethostip
!

#gethostip TCL Script on flash

tclsh
# Clear cached DNS Entry
exec clear host xxxxx.synology.me
# Remove ACL
ios_config "no ip access-list uk-nas"
# Add ACL - DNS Lookup will be done at this time.
ios_config "ip access-list extended uk-nas" "permit tcp host xxxxx.synology.me any"