Monday, 21 June 2021

new upgrade commands on 9200 and 9300 switch

Looks like the install/upgrade process has changed a bit on cisco 9200 switch. 


install add file flash:cat9k_lite_iosxe.16.10.01.SPA.bin activate commit

*This command will copy the file to other switches in the stack

If you forget the last 2 keywords you will need to run:

install inactive remove


Full guide

https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst9200/software/release/16-10/release_notes/ol-16-10-9200.html#id_67613


Needed this command when there was no space on the local disk

install add file tftp://172.30.180.160//cat9k_iosxe.17.06.05.SPA.bin activate commit




****

check for this before reboot

#show romvar | in STARTUP

SWITCH_IGNORE_STARTUP_CFG=0


If the variable is set, please:

no system ignore startupconfig switch all


Monday, 14 June 2021

enable advipservices license on ASR 1001-X

Check if its available in your image:

show license all

StoreIndex: 1   Feature: advipservices                     Version: 1.0

        License Type: EvalRightToUse

        License State: Active, Not in Use, EULA not accepted

            Evaluation total period: 8  weeks 4  days 

            Evaluation period left: 8  weeks 4  days 

            Period used: 0  minute  0  second  

        License Count: Non-Counted

        License Priority: None


Enable the license level you need, needs a reboot:

conf t

license boot level advipservices

Once you changed the boot variable, the CLI will ask you to change and accept the EULA agreement, so you need to enter YES, and then save configuration and perform a reload on the ASR.

Once the ASR boots up again, you should now see that the license level is advipservices and you can confirm that using the command “Router# show version | i Lice”


EVAL license will last for 60 days after that it will switch to right to use. You should buy the right license from cisco but it sounds like RTU will continue to work without but I have not tested it.



Tuesday, 8 June 2021

setup duo with RDP on windows server

1 - Make sure you have a windows username who is enrolled/activated in duo and has phone number attached, good idea to test logging in with this user on your working duo install. I would say ensure you have a back way in. Physical console or VMware console and a local user setup.

2 - Docs/instructions are here www.duo.com/docs/rdp

4 - Log into duo portal on the PC you are going to protect so you can download files and copy paste some details

5 - Log into duo portal -> applications -> protect and app. Select MS RDP

Record details

  • ikey
  • skey
  • api

6 - Run the installer, fill in the recorded details. In my case I chose to only protect RDP not windows logins.

7 - After install is complete test logging in with RDP, make sure to use RDP (MSTSC) and not local console you have been working on.

Thursday, 27 May 2021

convert pfx to separate private key and cert files with openssl

n this article I’m going to show you the commands you need to convert your .PFX Certificate file to a seperate certificate and keyfile. This article can come in handy when you need to import your certificates on devices like Cisco routers/loadbalancers etc. where you probably need to import the certificates and keyfiles in plain text (unencrypted). My tool of choice (but there might be others) is OpenSSL for Windows, which can be downloaded here

So after you installed OpenSSL you can start it from it’s Bin folder. I’d like to put OpenSSL\Bin in my path so I can start it from any folder. Fire up a command prompt and cd to the folder that contains your .pfx file. First type the first command to extract the private key:

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file.  This is the password that you used to protect your keypair when you created your .pfx file.  If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!.  Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.

Now let’s extract the certificate:

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

Just press enter and your certificate appears.

Now as I mentioned in the intro of this article you sometimes need to have an unencrypted .key file to import on some devices.  I probably don’t need to mention that you should be carefully. If you store your unencrypted keypair somewhere on an unsafe location anyone can have a go with it and impersonate for instance a website or a person of your company.  So always be extra careful when it comes to private keys! Just throw the unencrypted keyfile away when you’re done with it, saving just the encrypted one.

The command:

openssl rsa -in [keyfile-encrypted.key] -out [keyfile-decrypted.key]

Again you need to enter an import password. This time you need to enter the new password that you created in step 1.  After that you’re done. You decrypted your private key. In the folder you ran OpenSSL from you’ll find the certifcate (.crt) and the two private keys (encrypted and unencrypted).

Update 07-07-2014:

In some cases you might be forced to convert your private key to PEM format. You can do so with the following command:

openssl rsa -in [keyfile-encrypted.key] -outform PEM -out [keyfile-encrypted-pem.key]

From

https://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/




Wednesday, 26 May 2021

cisco ASA FQDNs in a group

ASA needs to be configured to use DNS


dns server-group DefaultDNS

 name-server 8.8.8.8

 name-server 1.1.1.1

 domain-name rn.lgov


object network obj-thulleultinn.club

 fqdn thulleultinn.club


object-group network MALWARE-SOURCES

 network-object host 192.99.178.145

 network-object object obj-thulleultinn.club


Get firepower sensor (sfr) details from ASA CLI

Gives sensor IP and manager IP (FMC)

show modules sfr detail

Thursday, 20 May 2021

cisco asa debug commands for S2S vpn

Set the debug on just your peer

debug crypto condition peer x.x.x.x


Ikev1 / ipsec

debug crypto ikev1 255

debug crypto ipsec 255

ikev2


debug crypto ikev2 protocol 127
debug crypto ikev2 platform 127

Debug crypto ikev2 255

Debug crypto ikev2 platform 255

Debug crypto ikev2 protocol 255


If you need more detail you can enable more

Debug crypto ipsec 255

Debug crypto ike-common 10

Debug crypto engine 255 (causes too much output)


logging console debugging


https://www.cisco.com/c/en/us/support/docs/security/asa-5500-x-series-next-generation-firewalls/113574-tg-asa-ipsec-ike-debugs-main-00.html#anc6

IKEv2 Notes
IKEv1 had clear phase 1 (ikev1) and phase 2 (ipsec).
IKEv2 does it all in one phase but broken into 3 sections:

IKE_SA_INIT
IKE_AUTH
CHILD_SA