Friday, 13 July 2018

pipe not working in citrix reciever on linux mint

What a pain, someone figured it out.

OS Keyboard: Irish
~/.ICAClient/wfclient.ini :British
~/.ICAClient/wfclient.ini : KeyboardMappingFile = automatic.kbd
Terminal Server Regional Settings: Irish (this is the citrix desktop you log onto)
Works.

http://andrewmorgan.ie/2015/10/citrix-receiver-for-mac-and-british-keyboard-tomfoolery/

Thursday, 5 July 2018

regular expressions



^ start of line
$ end of line


Find lines starting with Vlan and select to the end of the line
^Vlan.*$

Find lines starting with Vlan and select the next line also
^Vlan.*[\r\n].*[^\r\n].*


Finding switch ports that are admin down and
^GigabitEthernet.*down,.*[\r\n].*[^/r/n]output\s\d.*


Find an IP group
(\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3})

First group is called $1, second is $2 etc

In sublime we can to find
(\d{1,3}\.\d{1,3}.\d{1,3}\.\d{1,3})
replace
insert something $1

that would find 
192.168.0.1
replace 
insert something 192.168.0.1

Find
(Printer)
Replace 
set address $1

find free switchports cisco switch

The best way is to maintain a list of patches / descriptions on ports. After that having a monitoring system to monitor ports would show you graphs of the port activity. If you don't have this you can try the following. Its not perfect, its still an educated guess.

Step 1: Find switch ports that are down
sh ip int br | i down

This lets us see the ports that are either admin down, or line down (no cable plugged in or PC off). However just because a PC is off at the time we check does not mean the port is free to be used. A user could be away on holiday or a PC/Printer is only booted once a week/month for a specific task.

Now we need to look at some other things

sh int | inc line protocol is|Last input

Look for ports that are down and last output is old. Last input is almost always "never".


Copy output to file

Run regular expression on it
^GigabitEthernet.*down,.*[\r\n].*[^/r/n]output\s\d.*

Find all
Copy and paste into new file


Good command (not sure its working):
show int | i proto.*notconnect|proto.*administratively down|Last in.* [6-9]w|Last in.*[0-9][0-9]w|[0-9]y|disabled|Last input never, output never, output hang never


Other method
Take a list of the interface counters per port
Clear the counters
Wait a few weeks and take the counters again
Then compare with winmerge or other diff tool
  • sh interface counters
  • clear counters
  • wait some time
  • sh interface counters
Other useful commands:
show interfaces | include (FastEthernet|GigabitEthernet|TenGigabitEthernet).*input packets
show interfaces | include (GigabitEthernet|TenGigabitEthernet)|Last input|packets input

RegEx (find the interfaces that are down/down and no last input)
GigabitEthernet\d/\d/\d is down, line protocol is down \(notconnect\).\n..Last input never, output never, output hang never\n.....0 packets input

critical light on cisco router ASR 1001 x

Router was working fine but critical light on the front

Run:
sh facility-alarm status

Output:
Source                     Time                   Severity      Description [Index]
------                     ------                 --------      -------------------
xcvr container 0/0/0       May 02 2018 07:57:09   INFO          Transceiver Missing [0]
xcvr container 0/0/1       May 02 2018 07:57:09   INFO          Transceiver Missing [0]
xcvr container 0/0/5       May 02 2018 07:57:09   CRITICAL      Transceiver Missing - Link Down [1]
xcvr container 0/0/6       May 02 2018 07:57:09   INFO          Transceiver Missing [0]
xcvr container 0/0/7       Jul 05 2018 03:51:37   INFO          Transceiver Missing [0]
GigabitEthernet0           May 02 2018 07:57:06   INFO          Physical Port Administrative State Down [2]

However xcvr container 0/0/5 does not match up to gig0/0/5 as you might assume. I looked around the configured interfaces and found there was a port that was admin up but line down. It was a test port someone in IT had configured for their laptop.

Run
sh ip int br

Output:
GigabitEthernet0/0/0   x.x.x.x   YES NVRAM  up                    up    
GigabitEthernet0/0/1   y.y.y.y YES NVRAM  up                    up    
GigabitEthernet0/0/2   z.z.z.z      YES NVRAM  up                    up    
GigabitEthernet0/0/3   a.a.a.a     YES NVRAM   down down

We can see gig0/0/3 is the problem.

Fix
int gig0/0/3
shut

The critical light on the front went off. The problem was  we  had an interface configured and "no shut" but no cable plugged in.

Wednesday, 20 June 2018

firepower FTD resources

https://communities.cisco.com/docs/DOC-30977

https://communities.cisco.com/community/partner/security

Thursday, 7 June 2018

How to save anyconnect client connections

C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile

Make a file customer.xml

<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">;
  <ServerList>
    <HostEntry>
      <HostName>CUSTOMER-100.200.300.10</HostName>
      <HostAddress>100.200.300.10</HostAddress>
    </HostEntry>
  </ServerList>
</AnyConnectProfile>

See also
https://www.tunnelsup.com/locating-the-cisco-anyconnect-profiles/

Quick Powershell script to create them as you need

Write-Host 'Must be run as administrator so it can create the file'
Write-Host 'C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile'
$DisplayName = Read-Host Prompt 'Enter customer diplay name (eg CUST)'
$XML = Read-Host Prompt 'Enter xml file name (eg cust.xml)'
$Peer = Read-Host Prompt 'Enter anyconnect IP or URL (eg 100.10.10.1)'


$FileName = "C:\ProgramData\Cisco\Cisco AnyConnect Secure Mobility Client\Profile\" + $XML

$FileText = @"
<?xml version="1.0" encoding="UTF-8"?>
<AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/">;
  <ServerList>
    <HostEntry>
      <HostName>$($DisplayName)</HostName>
      <HostAddress>$($Peer)</HostAddress>
    </HostEntry>
  </ServerList>
</AnyConnectProfile>
"@

$FileText | Out-File -FilePath $FileName -Encoding utf8

Wednesday, 16 May 2018

claim PAKS from Cisco

http://www.cisco.com/go/license

smart account -> virtual account

PAKs or TOKENS view is default

Get licenses -> From a new PAK -> Next

Usually you need the serial number from the device. If updating ASA always use the serial from the primary ASA.