Monday 23 November 2020

DHCP scope full of BAD_ADDRESS Entries

This one comes up a lot. I've come across the following causes:

1 - Malware just filling up your DHCP scope to break it. 

2 - Rouge DHCP server

3 - Broken NIC on some device, never completes the DHCP steps and keeps taking IP's (some times fixed with driver update)

3 - Proxy arp issue. Similar to above. The client gets DHCP offer but before it accepts it will arp the IP to see if anyone is using it. The firewall responds to the arp so the client rejects the IP and starts DHCP request again multiple clients fill up the DHCP rules. Check NAT rules and make sure they have "no-proxy-arp" even if the NAT rule matches different traffic. Look for any any nat rules.

You can look in DHCP logs on the DHCP server

Check arp -a and wireshark looking for dhcp request/offers on the DHCP server.

If the DHCP is being forwarded by an IP helper you'll need to take the capture on the LAN and can check arp on the device that is doing the IP helper

If its just one mac address a quick work around is to make a reservation for that MAC so it always gets the same IP. That way it won't fill up your DHCP scope. Then clear out the DHCP scope.

You also have the option of setting the DHCP lease times down lower. You can get a script/scheduled task to stop/start the DHCP service (clearing down the scope). If you have scripting skills you can look for "BAD_IPADDRESS" entries and delete those with a script.

The longer/better fix is to find the device(s) that are causing the issue and sort them out. 

You may also have the option to enable DHCP snooping on your switch. You can configure the switch ports to your DHCP servers so they are the only ones allow to respond to DHCP requests.

https://www.petenetlive.com/KB/Article/0001651



Tuesday 10 November 2020

Internet browsing and webpages loading slow for no reason

I have hit an issue where internet browsing is slow but when looking at wireshark the round trip time on TCP 3WHS is always good. Not seeing delays in packets. Network graphs show the connection is not being maxed out. Network speed looks good yet the users report that page load times are slow.


I had to allow google and facebook tracking IP block/ranges

The traffic I saw was UDP 443


Google URLS

admin.google.com

ssl.google-analytics.com

*.google.com

www.google-analytics.com

www.google.com

code.google.com

update.googleapis.com

talk.google.com

*.gstatic.com

clientservices.googleapis.com

www.googleapis.com

accounts.google.com

clients4.google.com

*.googleapis.com

oauthaccountmanager.googleapis.com

clients2.googleusercontent.com

update.googleapis.com


Have also seen windows updates using up all the bandwidth so windows updates can be blocked during business hours or controlled with WSUS etc.


MS URLs

login.microsoftonline.com

aadcdn.msauth.net

*.microsoft.com

autologon.microsoftazuread-sso.com


IP's

FB ranges

31.13.64.0/18

66.220.144.0/20

69.171.224.0/19

69.63.176.0/20


Google Ranges

74.125.0.0/16

172.253.0.0/16

209.85.128.0/17

216.58.192.0/19

172.217.0.0/16

64.233.160.0/19

108.177.0.0/17

66.102.0.0/20

173.194.0.0/16


Friday 23 October 2020

internal dialing phone issue

Needed to set these commands on router

 10.100.200.10 is the voice router

h323-gateway voip bind srcaddr 10.100.200.10
h323-gateway voip interface 

Also had to reset the voice card

Friday 2 October 2020

find what objects an IP is a member of in cisco ASA CLI

 sh run object-group network | i object-group|192.168.1.100


It will spit out all the object-groups and you scroll down until you see the one that has your IP inside.


It will look like this. we found 192.168.1.100 is a member of DNS_FORWARDERS

object-group network DomainControllers

object-group network DNS_FORWARDERS

 network-object host 192.168.1.100

object-group network smtprelay_group

object-group network Office365relayIPs_Group

remember to keep scrolling as it could be a member of more groups.


Wednesday 23 September 2020

Cisco to juniper CLI cheat sheet

 https://www.tunnelsup.com/cisco-asa-to-juniper-ssg-command-reference-cheat-sheet/


QOS

IntServ - RSVP - hardcore reserves bandwidth even not in use
DiffServ - distinguishes between different type of traffic and gives priority
FIFO - first in first out - no priority unless we enable QoS

Quality of Service is a collection of tools

Classification
Recognising a certain type of traffic

Marking
Assign a marking based on the classification. (DSCP marking is modern one)

Policing and shaping
Sets a speed limit
Policing drops traffic over the limit. If its TCP traffic it will try again.
Shaping sets a speed limit but it puts it in a buffer until bandwidth is available

Congestion management = Queuing
Big data packets come in and queue up. Lets say a voice packet comes in next, without qos it will have to wait to get out leading to bad call quality.
If we classify/marking taffic we can create queues for each type of traffic
Create a voice bucket and a "everything else" bucket into best effort bucket
If a bucket fills up and spills over the packets will be dropped.

The two most used queuing mechanisms used today
Class based weighted fair queuing
Low latency fair queuing

How much bandwidth does priority traffic get

Congestion avoidance on switch is weighted tail drop
Congestion avoidance is weighted RED. The thing with weighted RED is that there is only 1 bucket and when it fills up packets are dropped and everyone suffers.
RED sacrifices the needs of the few for the good of the many.

Link efficiency
Not as much of a big deal these days as WAN links are fast these days
On lower speed circuits, voice packets can get stuck behind big data packets so we are waiting for our chance to get across the WAN.

We should classify and mark traffic as close to the source as possible

To enable
#mls qos

To enable per vlan
#mls qos vlan-based

interface vlan 50
service-policy input test
exit
interface gig 1/0/7 (is a member of vlan 50)
mls qos vlan-based (take qos policy settings from vlan 50)

Port based classification options
L2 - CoS value, MAC ACL
L3 - IP precedence, DSCP value, L3 ACL

3 first bits to ToS (type of service) 8 possible values but two reserved by cisco.
DSCP has up to 63 values, this is the one that tends to be used.

Some times non IP based packets will arrive with a CoS value already. We can alter it below.
mls qos cos [0-7] (cisco reserved 6 or 7)
mls qos cos override

We can trust certain cos marking
CoS marking is L2 marking, gets stripped off when moving between routers, it gets set to 0.

Trust the cos value coming from cisco phones (two commands)
mls qos trust cos
mls qos trust device cisco phone

The switch uses cdp to know its attached to a phone.

We can say if you have cos value 3, set dscp vale 23. DSCP doesn't get stripped off when traversing routers.

Show all the mapping tables in the switch
sh mls qos maps

See just the cos to dscp mapping
sh mls qos maps cos-dscp

Best practice for mapping cos to dscp

mls qos map cos-dscp 0 8 16 24 32 46 48 56

Each value matches up to the 0-7 cos values

cos - dscp
0 - 0
1 - 8
2 - 16
3 - 24
4 - 32
5 - 46
6 - 48
7 - 56

sh mls qos maps cos-dscp

Dscp mutation
If it comes in with one dscp value change it to another

mls qos map dscp-mutation MUTATE 24 26 28 30 to 24
int gig 1/0/8
mls qos trust dscp
mls qos dscp-mutation MUTATE

If traffic comes in with any of dscp markings 24 26 28 30, change it to 24

Drop probability is not related to ip precedence
Lets say we have voice with priority 1 drop prob 2
And we have http with priority 2  drop prob 0
Voice traffic will be sent first, but if the buffer fills voice traffic will be dropped over http.

(match any of the protocols listed below)
class-map match-any EMAIL
match protocol pop3
match protocol imap

class-map VOICE
match protocol rtp

class-map BITTORRENT
match protocol bittorrent

sh class-map

policy-map QOS-MAP
class EMAIL
set dscp af13
bandwidth 512 (give at least 512 and more if its available)
random-detect dscp-based
random-detect ecn

class BITTORRENT
police 128000

service-policy output QOS-MAP

Lots of good info from Kevin Wallace on youtube


Voice and QOS
Often we find voice and data traffic are competing on the same vlan

voice traffic is competing with web browsing traffic for example
Its best practice to create a voice vlan / subnet to separate them.
Even with vlans voice and data will share the same uplinks/trunks
We need QoS here

There are two main types, ToS and DiffServ (DSCP),
You only use one or the other

ToS
IP header has ToS field 0-7
0 = default (data)
5 = voice (usually)
7 = highest

ToS value is set via the phone system. Phone's download their config from the TFTP server (phone system). Now they are tagging traffic with ToS value of 5. We then need to configure our network gear to use this value.

DiffServ
More recesh nt / improved version of ToS. More values can be set.
DSCP
priority 0 - 63
voice is usually set to 46 (set on the phone system) same as above.

VLANs can also be given priority, this is why the voice vlan is best practice
CoS
0 - 7
Set to 5

Often physical ports on routers etc can be given priority also.

We can control QoS on our LAN but once we go outside we have no control. Some ISP's will provide MPLS connection which will read your QoS values. Usually at a higher cost than a regular MPLS link

ALG, can give high priority to voice protocols SIP RTP RTSP SKINNY etc.

Latency and jitter
Latency is the route trip time 
Jitter is the change in interval so if we have 10ms and 12ms then jitter is 2
Even 200ms phones will work if jitter is low/steady.
Industry wants below 150ms
If we are below 100ms then voice must work.


Thursday 10 September 2020

cisco asdm not working

Most issues with ASDM are java related. Its best to run ASDM on windows with java updated.

Check for and kill any java/asdm processes that are running

Update the JRE to the latest and try again

If its still not working there are some things you can check:

  • Add the IP of the ASA to the java security exclusions list
  • Check if ASDM is running on a different port (sh run | i http server)
  • Is the ASDM image configured (sh run | i asdm)
  • Is the image configured on disk (sh disk | i asdm)
  • Do we have "http server enable" 
  • Do we have something similar to "http 192.168.1.0 255.255.255.0 INSIDE"
  • 192.168.1.0/24 is the network (or host) where we are launching the ASDM from
  • Do we have "aaa authentication http console LOCAL"




Tuesday 8 September 2020

login access text

 UNAUTHORISED ACCESS TO THIS DEVICE IS PROHIBITED

You must have explicit, authorised permission to access, read information from or configure

this device. Unauthorised attempts and actions to access or use this

system may result in civil and/or criminal penalties. All activities

performed on this device are logged and monitored.


Wednesday 19 August 2020

cisco firepower flex config gothcha

 I was trying to apply some flex config but it wasn't appearing in the CLI.

After opening a case with TAC he showed that we need to edit the objects in

Device -> Flexconfig

Now we can deploy the policy to make the changes.


He also mentioned we should use AD authentication method


Also we found from the debug the mapping of our group should be as follows

CN=AD_GROUP_NAME,OU=VPN,OU=Groups,DC=CUSTOMER,DC=COM



cisco anyconnect debug commands

Depending on which auth method you are using


Set putty to log

Get public IP from user

debug ldap 255

debug radius all

debug webvpn 255


watch the log and connect with your anyconnect user

Monday 10 August 2020

source NAT on palo alto firewall

For the source translation use dynamic-ip-and-port even if you are NAT'ing to a static IP. In the palo world static is only used for 1 to 1 translation.

Switched it to dynamic and issue resolved


src zone: inside

dst zone: MYMAP-30

src: N-10.40.0.0-16

dst: H-10.90.32.44-32

Src translation:

dynamic-ip-and-port

H-172.20.200.1-32


Friday 7 August 2020

troubleshoot S2S VPN on palo alto firewall

Do the usual checking settings match on both end.

Make sure you have an ACL to allow the traffic

Is there any NAT that needs to happen ?


Palo VPN commands

Check P1

show vpn ike-sa
show vpn ike-sa gateway EXIGENT-210

Check P2

show vpn ipsec-sa 
show vpn ipsec-sa tunnel EXIGENT:ProxyID1


Check encaps/decaps
show vpn flow name EXIGENT:ProxyID1


If you need to take it further you can run debugs

https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000ClivCAC

Wednesday 8 July 2020

copy (tftp) files to each switch in a cisco switch stack

copy tftp: flash1:
copy tftp: flash2:
copy tftp: flash3:

etc

On the master set the boot var for all switches
boot system switch all flash:image.bin


https://community.cisco.com/t5/switching/boot-system-command-for-quot-switch-2-quot-of-stack/td-p/1119357

Thursday 11 June 2020

reset cisco 2960

https://www.cisco.com/c/en/us/support/docs/switches/catalyst-2950-series-switches/12040-pswdrec-2900xl.html#topic1

Wednesday 10 June 2020

download packet capture (pcap) file from FMC / FTD / firepower



connect to the sensor of the FTD

use "system support diagnostic-cli" to go into ASA CLI

setup your capture as normal and capture your traffic.

Once complete "copy /pcap capture: disk0:"

now type exit twice to get out of ASA CLI

type "expert"

cd to "/mnt/disk0"

cp MYCAP.pcap /ngfw/var/common

On the FMC web interface

Devices -> hammer + wrech icon -> advanced 

Go into advanced troubleshooting -> File download

Enter MYCAP.pcap and click download.

Saturday 6 June 2020

Deploying a Defensive Raspberry Pi



Raspberry pi

BroIDS (6:18)
Dependence

Doing the make on Bro takes a long time like 45 mins
Then make install

GW
Span / mirror port

Critical stack plugs into bro

Logstash (ELK stack)
inputs
filters
outputs

elastic search (database)

Kibana
Visualization engine (pie charts)

https://github.com/travisfsmith/sweetsecurity


Updated 


Watching to make sure we are receiving packets
watch ifconfig eth0


We can use BPF to whitelist certain traffic like netflix traffic for example.

Mikrotik routers can capture packets on it.

We need a 64bit OS to install RITA

Looks like we can get a vdsl SFP for mikrotik

Tuesday 19 May 2020

can't RDP to server authentication error due to CredSSP encryption oracle remediation

The server is using this update but the client is not

Update both hosts to latest

On client gpedit.msc -> computer conf -> admin templates -> system -> credential delegation

Set Encryption oracle remediation
to enabled
drop down to vulnerable

https://weblogs.asp.net/dixin/remote-desktop-connection-authentication-error-due-to-credssp-encryption-oracle-remediation

Tuesday 12 May 2020

cisco umbrella firewall rules

object-group network UmbrellaVAs
network-object host 10.53.0.71
network-object host 10.53.0.72


object-group network UmbrellaVA_Destination
network-object host 208.67.220.220
network-object host 208.67.222.222
network-object host 208.67.222.220
network-object host 208.67.220.222
network-object host 67.215.71.201
network-object host 146.112.255.155
network-object host 91.189.94.4
network-object host 91.189.89.199
network-object host 91.189.91.157
network-object host 91.189.89.198
network-object 67.215.92.0 255.255.255.0
network-object object ocsp.digicert.com
network-object object crl4.digicert.com
network-object object disthost.opendns.com
network-object object disthost.umbrella.com
network-object object s.tunnels.ironport.com

object-group service Umbrella_Ports tcp-udp
port-object eq domain
port-object eq 443
port-object eq www
port-object eq 123
port-object eq 22
port-object eq 25
port-object eq 5353
how is this even working?

Tuesday 10 March 2020

Cisco anyconnect - MTU-D packet 1200 bytes greater than effective mtu 986

MTU issues with anyconnect – traffic coming back in from outside as being dropped as it was too big

An error message like this was appearing in ASDM logs
MTU-D packet 1200 bytes greater than effective mtu 986


- conf t
- group-policy SSL--CLIENTS attributes
- webvpn
- anyconnect ssl df-bit-ignore enable

wr
disconnect/reconnect anyconnect and retest

This will ignore the defragmentation of the bits and it will allow the packets to pass through no matter of the MTU size.

Wednesday 22 January 2020

CCNP TSHOOT

Network maintenance prevents issues and less troubleshooting

Change control
Schedule maintenance windows
Documentation
Communication
Consistency
Cycling equipment (upgrade network stuff every 5 years)
Monitoring, graphing and alerting


Troubleshooting laptop
Thin, light and long battery life.
USB to serial
USB to ethernet
SecureCRT, mRemoteNG, RoyalTS
TFTPd32
Filezilla
IP scanner (angry 2.x, or nmap)
wireshark
Noepad++ sublime text
Iperf
Syslog (kiwi version one is 8.3.52)
HFS (http file server)
TCPView
NMap
MTURoute
Pathping
Netflow Analyzer (PRTG)
Portable apps

Getting started IOS TS tools
Show the networks inside 10.52.0.0/16
show ip route 10.52.0.0 255.255.0.0 longer-prefixes

Show information on the CPU
show process cpu | i CPU

See what's using CPU right now (exclude stuff not using CPU)
show process cpu | e 0.00%

Keeping mind its case sensitive
show process cpu | i IP Input

You can make an alias for the commands you like
alias exec get-processes show process cpu | e 0.00%

Show interfaces that are up
Show interfaces | i is up

Show interfaces that have an IP assigned
Show ip int br | e unass

You can use brackets so it doesn't pick up REGISTERED/UNREGISTERED.
sh ephone | i ( REGISTERED )

ping can be used to test MTU
ping 10.50.1.1 size 1470 df-bit

Using extended commands to find MTU
ping (press enter)
target IP : 10.50.1.1
repeat count: 1
Extended commands: Y
Set DF bit: Y
Sweep min size:1450
Sweep max size 1500

You will see where the pings start to fail and can help figure out MTU faster.


SPAN and RSPAN

find out how many sessions are supported
monitor session ?

monitor session 1 source interface fa0/20
monitor session 1 destination interface fa0/10

Anything sent/received on fa0/20 will get sent out fa0/10. We can plug in a laptop with wireshark runing there.

RSPAN

You need to setup an RSPAN VLAN in your network and add it onto trunks etc.
You may also need a free port (or one you can shutdown). The port gives up its resources for RSPAN.

conf t
vlan 999
remote-span
exit

monitor session 1 source interface fa0/20
monitor session 1 destination remote vlan 999 reflector port fa0/30

recieving

monitor session 2 source remote vlan 999
monitor session 2 destination interface fa0/5

Your laptop is plugged into fa0/5

Switch performance troubleshooting 

Cisco switches CPU usage should be low around 5% - 10%

Components of a catalyst switch
Ports
Forwarding logic (ASICS)
Backplane (fabric that connects everything)
Control plane

With switches we get intelligence with almost wirespeed.
It's rare to overload the backplane
Most of the time it will be in the ASICS
Usually this is because a lower grade switch is being used as a 1000 user core switch.
Modern switches can do wirespeed routing
Control plane is where all the intelligence is. If we need to do a job that we don't have an ASIC chip to do the specific job for us. It needs to get done here.

How to diagnose "slow" issues
show interfaces counters
show interface counters errors

Find if there are half duplex ports
sh interfaces | i Half

Find all ports with Full/auto/half
sh interfaces | i line protocol|duplex

Auto MDIX
Remove the need for cross over cable.
Needs to be set as auto on both ends.

TCAM can max out.

Make sure the right SDM template.
Show sdm prefer

See what a template prefers
show sdm prefer access

Changing the SDM template requires a switch reboot.

See whats in use and max
Show platform tcam utilization

CPU utilization on the switch matters,
Cisco 5% - 10% tends to be normal.

What could cause high CPU on a router ?
TCAM overload (STP loop)
debug command left running (u all)
Fequent routing or FHRP updates (hello timer too low)
Fequent SNMP scans (solarwinds scans too low)

Router CPU will go up as the amount of normal traffic increases

See whats using the CPU
show process cpu | i ex 0.00%

Top sources of high CPU:
ARP input
A flurry of arp packets, can be cause by a default route pointed it an ethernet interface

Net background
When an interface queue is full, net backgroud pulls from a global buffer (causes a CPU interrupt)

IP Background
Handles interfaces up/down states

TCP timer process
Manages developing and current TCP connections to the router (Telnet, SSH, SYN, etc)

Looking for these issues (^ means line starts with)

sh process cpu | i ^CPU|^PID| ARP in

sh process cpu | i ^CPU|^PID| Net Back


sh process cpu | i ^CPU|^PID| IP Back


sh process cpu | i ^CPU|^PID| TCP Tim

Show the CPU usage over time
show process cpu history

High mem usage
1 - Check your memory is supported on the new versions you are upgrading to
2 - Memory leak, you need monitoring to spot.
MALLOC_FAIL - the router can't allocate memory to something probably ran out of memory
3 - Buffer leak (IOS Bug)
4 - BGP massive routing table









Troubleshooting trunks and VTP
A trunk = a tagged port
Puts VLAN info into each frame
Layer 2 feature

Show all the trunk interfaces
show interfaces trunk

Encapsulation mismatch
Check if the only allowed vlan is the native vlan 1. This means the other vlans are not making it across. Check the trunk ports and ensure you have
switchport trunk encapsulation dot1q
on both sides

DTP mismatch

show interface fa0/10 switchport
look for
Administrative mode: dynamic auto
Operational mode: static access

dynamic auto -> dynamic auto won't make a trunk
dynamic auto -> dynamic desirable will make a trunk

Change the mode:
edit the interfaces and select one of the following modes:
switchport mode dynamic auto
switchport mode dynamic desirable
switchport mode trunk
switchport mode access

Native VLAN mismatch
Default is vlan 1

switchport trunk native vlan 20
vlan 20 will be untagged

Allowed vlan misconfig 
show interface trunk, check the allowed vlans

Side A
switchport trunk allowed vlan 1,5,80
Side B
switchport trunk allowed vlan 1,5,80,200

Check the config on each trunk interface

Show interfaces trunk
Check Vlans allowed on trunk

VTP
show vtp status
vtp domain name is blank by default
You can config it to make it a bit safer to use
vtp domain name JACKSVTP
vtp password CoolPassword


Troubleshooting VLANs
1 vlan = 1 broadcast domain = 1 subnet
What can go wrong with vlans:
IP's are not in the subnet.
Inactive vlan (VTP) vlan database gets deleted
Port assigned to the wrong vlan
PC plugged into wrong port / vlan (find mac address)

Spanning tree

Step 1 - STP elects the root bridge
Root bridge is the switch with the lowest bridge ID
Bridge ID  is combination of priority (set in config) and the mac address (unique to each switch)
The default bridge ID = 32768. We can force a switch to be root by changing this value.
By default the oldest switch will be come the root bridge

Step 2 - Other switches find the best path to the root bridge
Lowest cost (bandwidth)
Lowest bridge ID

Costs
10gig 2
1gig 4
100mbps 19
10mbps 100

We select the port with the lowest cost. The other ports are blocked. This is the root port

Designated port is fowarding
Blocked port is not forwarding
Blocking is done

Step 3 - Block what is left over
Only one side blocks the link in STP
The highest mac blocks it
Last tie breaker is the port number

How to identify a loop
The switch should show lots of mac address flapping and broadcast storm
All ports will be blinking in unison or on solid.

We can have temp loops with port fast

Don't have port fast on uplinks between switches.

Common causes uses plugging back into switches etc.

SVIs and routed ports

Making an SVI
interface vlan 10
ip address 192.168.0.254 255.255.255.0

vlan 10 must exist
we also need some ports assigned to vlan 10 with something plugged in (or a trunk with vlan 10)

Making a routed port
interface gig1/0/50
no switchport
ip address 192.168.0.100 255.255.255.0

Things that can go wrong
VLAN / trunk misconfig
IP addresses need to match
vlan not created / SVI shut down
Routed port missing the "no switchport" command

L2 and L3 etherchannel

We normally connect switches with 2 trunk cables. 1 cable will be used, 1 will be blocked but there for redundancy. If we need more bandwidth we can use an etherchannel.

channel-group 1
auto - pagp
desirable -pagp
active - lacp
passive - lacp

Both sides passive = no etherchannel will be formed

If we are using L3 we can do the same thing and add more cables.

interface gig1/0/1 - 4
switchport trunk encapsulation dot1q
switchport mode trunk
switchport nonegotiate
switchport trunk allowed vlan add 1,100,200

channel-group 1 mode active

w - waiting to be aggregated

Need to do the same config on the other side.

show etherchannel summary

Flags
D - down
P - bundled in port channel (we want to see P)
I - stand-alone
s - suspended (config doesn't match other ports)
H - Hot-standby (LACP only)
R - Layer 3
S - Layer 2
U - in use
f - failed to allocate aggregator
M - not in use, min links not met
u - unsuitable
w - waiting
d - defualt port


We want to see this meanin they are up:
Po1(SP) - L2
Po2(RP) - L3

If we see SD/RD we have a problem.

LACP has 8 ports max. If you bundle 10 cables 2 will be in hotstandby mode

Config on switch ports must match each other
Config on switch ports must match config on channel-group
Changing the config later can cause an issue

Always config the channel-group last

show etherchannel summary
show etherchannel load-balance
sh run int gig1/0/1


FHRP - HSRP, VRRP, GLBP

These are not stateful. When a failover happens connections will need to reconnect.

HSRP - Cisco only
Hello/dead timers 3/10
Need 3 IP addresses RTR1, RTR2, VIP

VRRP - Open standard
Hello/dead timers 1/3
Can use the VIP on RTR1 so only 2 IP's needed

VRRP times are faster out of the box but hsrp can be tuned to be the same.

GLBP - Cisco only
Active active


We should use a routing protocol to avoid asymmetric routing.
If we can't we should use tracking and preemption

int fa0/1
standby preempt

Port security

Limit mac addresses

Modes
shutdown - shut the port down
protect - extra mac addresses traffic will be dropped
restrict - extra mac addresses traffic will be dropped and logged

sticky option - takes the mac that it see currently on the interface

int fa1/0/1
switchport mode access
switchport port-security (turn on, default locks to 1 mac)
switchport port-security mac-address sticky (now we can config commands)

show port-security int fa1/0/1

Common gotcha is that port-security config is in there but it hasn't be switched on.

If you use sticky you need to save the running to startup-

Spoofing features
Maybe they forgot to globally turn it on
ip dhcp snnoping (command to turn on)

What about turning it on under the interface
int fa0/1
ip dhcp snooping trust

show run int fa0/1
show ip dhcp snooping binding
sh ip verify source

Private VLANs
VLAN with vlans inside. We don't have to waste IP addresses
isolated
community
promiscuous

Private vlans light (protected ports)
switchport protected

IPv4 addressing and DHCP
192.168.1.127
255.255.255.224

IP might be a broadcast address

IP: 172.16.68.65
MASK: 255.255.255.240
GW: 172.16.68.62

The GW is in another network

Make sure helper address is correct and set on correct SVI
show ip dhcp conflict
show ip dhcp bindings
show ip dhcp server packet

NAT
We use NAT to ping LAN IP's behind the internet IP.

Inside IP: 192.168.1.50:6711
Outside IP: 100.1.1.1:6711

This is called PAT or NAT overload

Check our NAT ACL is correct and applied
Check the nat inside/outside are applied to correct interfaces
NAT can be setup with a pool as well.

Show commands:
sh ip nat translations
sh run | i ip nat
clear ip nat translations *
show ip nat statistics
debug ip nat

IPv6 addressing
Provides more addresses than we should ever need
IPv4 has run out and we have to use NAT alot
[ global prefix] [ subnet ID ] [ interface ID]

Neighbour discovery (arp replacment)
Neighbor solicitation

Joins a multicast group

Must have unicast enabled
ipv6 unicast-routing

Must have interface IP assigned and /64 subnet mask used for auto config
int gig1/1
ipv6 address 2001:1:1:1::/64

Router advertisements are suppressed
ipv6 nd suppress-ra


Show commands
sh run int gig1/1
show run | i ipv6
sh ipv6 interface
show run | s dhcp
show ipv6 dhcp binding

IPv6 access-list
Mostly the same as IPv4 ACL

There is an implicit permit above the implicit deny for neighbour discovery.
implicit permit icmp neighbour discovery
implicit deny

Only extended named ACLs are supported


ipv6 unicast-routing

int gig1/1
ipv6 address 2001:1:1:1::1/64

sh ipv6 int gig1/1

ipv6 access-list ACL1
the /128 is like /32 in ipv4
deny ipv6 host 2001:1:1::50 2001:2:2::50/128
int gig1/1
ipv6 traffic-filter ACL1

sh run | s access-list
sh ipv6 access-list ACL_NAME
show run | s interface gig1/1
sh ipv6 interface ACL_NAME

Prefix lists
Used for filtering routes in redistribution and working with BGP
Improved CPU utilization
better subnet maskj matching abilities
Similar to ACLs
Two stage matching system network and mask

This is filtering routes not for blocking a PC from a server

ip prefix-list PFL1 permit 172.30.0.0/16 le 20

Subnet mask has to be less than or equal to 20 bits
172.30.10.0/24 would not be matched
172.30.32.0/19 would be matched

ip prefix-list PFL2 permit 172.30.0.0/16 ge 20
Subnet mask has to be greater than or equal to 20 bits

172.30.1.0/24 would be matched
172.30.0.0/16 would not be matched (/16 not /20)
172.30.32.0/19 not matched
172.30.10./24 matched

Remember its a two stage check system.
Is it part of this network ? Is its subnet mask like this?

We can also make the second check more specific.
ip prefix-list PFL3 permit 172.30.0.0/16 ge 20 le 24

show commands
show ip prefix-list
show run | i ip prefix
show route-map

Static routes
By default routers only know about directly connected networks
We can config static routes to tell the router how to get to other places.
Our destination should have a route back.

Static route
ip route  10.3.3.3 255.255.255.255 10.1.1.100

Default route
ip route 0.0.0.0 0.0.0.0 10.1.1.100

Static routes are quick and dirty but do the job. We should use a routing protocol instead.

GRE tunnels
Just tunnels traffic
GRE is its own protocol 47. Its not TCP or UDP. ACLs might block.

RTR1 (51.10.1.1)
interface tunnel 1
ip address 192.168.1.1 255.255.255.0
tunnel source 51.10.1.1
tunnel destination 51.10.1.2

RTR2 (51.10.1.2)
interface tunnel 1
ip address 192.168.1.2 255.255.255.0
tunnel source 51.10.1.2
tunnel destination 51.10.1.1

RIP v2

router rip
version 2
no auto
network 192.168.1.0
network 192.168.2.0
default-information originate

passive-interface (turn off an interface)


Interface shutdown
Wrong rip version
Max hop count 15 in rip
auto summary on by default

RIP ng
This is RIP for IPv6

Make sure its turn on
ipv6 unicast-routing

ipv6 router rip MYRIP

int gig1/1
ipv6 rip MYRIP enable

Give out the default route
Setup the static route on the edge router
::/0 is 0.0.0.0 in ipv6, 2001:db8:6783:122::4 is our default GW.
ipv6 route ::/0 2001:db8:6783:122::4

Go under the interface we want to side it out, inside.
int gig1/2 (
ipv6 rip MYRIP default-information originate

ACL may block. RIPng is running on UDP 521
old rip uses UDP 520

Show commands
show ipv6 rip database
show ipv6 route rip
show ipv6 rip MYRIP
debug ipv6 rip

EIGRP
router eigrp 10
network 192.168.1.0 0.0.255.255
no auto

By default EIGRP does auto summary

Summary router - config under interface
int gig1/1
ip summary-address eigrp 10 200.1.1.0 255.255.255.0

Turn off all interfaces by default
Then enable on the interfaces we want to run EIGRP on
This is to stop making neighbors with unwanted routers
router eigrp 10
passive-interface default
no passive-interface int gig1/1

We should also use as specific network commands as we can

Authentication
key chain KC-MYKEY
key 1 (must match other side)
key-string password1 (must match other side)

int gig1/1
ip authentication mode eigrp 10 KC-MYKEY

Default route in eigrp
Easy method

setup static route
ip route 0.0.0.0 0.0.0.0 200.1.1.1

redistribute static route into EIGRP
router eigrp 10
redistribute static metric 1 1 1 1 1

Other method
ip default-network 200.1.1.1

Other method but will advertise every network
router eigrp 10
network 0.0.0.0

interfaces down
wrong AS number (debug ip eigrp packet)
Wrong network statements
passive interfaces or wrong subnet
Authentication, wrong key, password wrong
ACL EIGRP protcol 88  is not TCP/UDP
Mismatched timers flapping neighbors

show commands
show run | s eigrp
show ip eigrp nei
show ip route eigrp
show ip protocols
show ip eigrp interface
debug ip eigrp packet


EIGRPv6 (IPv6)
router ID is only needed if we have no ipv4 interfaces setup. we also have to do a no shut.
ipv6 router rigrp 10
router-id 1.1.1.1
no shut
exit

Enable under interfaces
int gig1/1
ipv6 eigrp 10

Show commands
sh run | s ipv6 router
sh run interface
sh ipv6 brief
show ipv6 protocols
show ipv6 interfaces detail
debug ipv6 eigrp

OSPF

router ospf 1
router-id 1.1.1.1
network 192.168.1.1 0.0.0.0 area 0
network 192.168.2.0 0.0.0.255 area 1

show ip ospf

Things that can go wrong
summary routes
hello timers mismatch


OSPFv3 (IPv6)

R1
ipv6 router ospf 1
router-id 1.1.1.1  (ospf uses ipv4 address as its router ID)
exit
int gig1/1
ipv6 ospf 1 area 0

gig1/1 connects to area 0

R2
ipv6 router ospf 1
router-id 2.2.2.2
exit
int gig1/1
ipv6 ospf 1 area 0

show ipv6 ospf neighbor

State should be FULL BDR

sh ipv6 route

What can go wrong
interface is down
ACL is blocking
mismatched area number / area type / timers
Duplicate router-ids
Passive interface or wrong subnet
authentication mismatch
wrong DR elected (In hub and spoke enviornment)

Show commands
show run | s ospf
show ipv6 ospf neighbors
show ipv6 route ospf
show ipv6 ospf
show ipv6 protocols
show ipv6 ospf interface
debug ipv6 ospf hello
debug ipv6 ospf adj


PBR and route-map fly by
Route maps are used in BGP alot.

Steps
Create ACL to match traffic (try to use permit)
Create route map tie the ACL to match and set commands together
Apply the router map to an interface
Check its working

Create the ACL
We need an ACL to match the traffic
ip access-list standard MY_USERS
permit host 192.168.1.50

Create the router map
route-map RM-NAME 10
Match
match ip address MY_USERS
Set
set ip next-hop 200.1.1.2

Apply to interface
int gig1/1
ip policy route-map RM-NAME

Check
show route-map

If matched the set part is performed. It needs to be applied to an interface. If policy is not matched it is dropped back into normal routing and hit specific or default route. We can deny items from matching in the route map but you should try to stick to permits.

What can go wrong
Use PBR as a crutch, try to setup routing properly first, only use when there is no way out.
Top down processing, rules are setup wrong
immediate execution on match
implicit deny all at the end
policy applied incorrectly or on wrong interface or not applied to an interface
Wrong set command sending it out the wrong IP

Show commands
show run | s router-map
show router-map
show ip policy
debug ip policy


ROUTE REDISTRIBUTION

Send metric / default metric
Route tagging / filtering
flagging internal /external

You have to make up metrics so you lose information on how far routes are really

show ip protocol (see whats running)
show ip route (see the routes)


Send RIP routes into EIGRP
router eigrp 10
redistribute rip metric 1 1 1 1 1500

Send OSPF routes into RIP
router RIP
redistribute ospf 1 metric 1

Now if we redistribute ospf into eigrp you can create a routing loop. This is where the route map comes in.

What can go wrong
Not knowing your network, you need a network diagram.
Failing to filter rotue properly
Lack of seed metric (no routes appearing) / metric is set too high
misconf on route map or ACL
Missing route map applied to redistribution (no routes)
Some routing protocol issue
When a route map in redistribution a deny really is a deny
routing protocol issue. The redistribution is working but the underlying routing protocols might have an issue.

BGP ROUTES

show ip bgp summary
show ip bgp (topology table)

router bgp 100
network 200.1.1.0 mask 255.255.255.0

Network command identifies routes that exist in the routing table. It has to match what is in the routing table. So we want them to be specific.

show ip bgp neighbor 150.1.1.5 advertised-routes

Distribution list
access-list 1 permit 200.1.1.0 0.0.0.255
neighbor 150.1.1.1 distribute-list 1 out

clear ip bgp *
show ip bgp

route map
neighbor 150.1.1.1 route-map RM-NAME out

What can go wrong
Network command, must match what is in the routing table
Next-hop device unreachable
router filter
bgp split horizon (router via iBGP)
Better path chosen via best path decision making process

Show commands
show run | s bgp
show ip bgp
show bgp ipv4 unicast
show ip router bgp

Syslog / snmp / ntp:

NTP
ping pool.ntp.org or look up on their site

router ntp server paste IP you saw above

SNMP
snmp-server v2c community passwd ro

SYSLOG
logging buffered - log to local device but gone after reboot
logging on
logging 100.1.1.1


What can go wrong
ntp: udp 123
snmp: udp 161-162
syslog: udp 514

service timestamps datetime
snmp-server ifindex persist
community string

IP SLA
sends probes to test validate / measure connections

ip sla monitor 1
type echo protocol icmpecho 150.1.1.1
timeout 100
frequency 1

ip sla schedule 1 lifetime forever start-time now

show ip sla monitor statistics

track 10 rtr 1 reachabilityu
exit

ip route 0.0.0.0 0.0.0.0 150.1.1.1 track 10
If track 10 goes down this route gets removed from the table

SPAN and RSPAN
SPAN port copy all traffic from one port to another plug in your laptop with wireshark to troubleshoot
RSPAN you can carry the RSPAN through the network back to your desk.


SPAN and RSPAN

Sometimes we need to watch the traffic with wireshark. Its only good when we can see the traffic. Switchport anayser

monitor session 1 source int fa0/12 both
monitor session 1 destination int fa0/1

*** Note status of interface / source port in an active SPAN will be up (connected)

Anything send/recieved on port 12 will be sent to out port 1. We can have the wireshark here watching the traffic.

SPAN is great when we are sitting beside the switch. What about a remote switch ? Make a RSPAN VLAN and trunk it to your workstation

On remote switch
vlan 999 (will have to be added into trunks)
remote-span
exit
minitor session 1 source int fa0/10 both
monitor session 1 destination remote vlan 999 reflector-port fa0/11
Reflector port gives up its asic resources. Make sure its not in use

On the local switch
vlan 999
remote-span
exit
monitor session 2 source remote vlan 999
monitor session 2 destination interface fa0/1

RSPAN recap 
1 - Setup RPSPAN vlan on all switches
2 - Setup monitor session 1 source interface (what we want to monitor)
3 - Setup monitor session 1 destination RSPAN VLAN
4 - Setup monitor session 2 source RSPAN VLAN
5 - Setup monitor session 2 destination interface (where we have wireshark)



Telnet and SSH

Telnet is dead and should not be used but some old routers only have it

Password required none set
Base config
line vty 0 4
login

Logins are required but no password set

conf t
line vty 0 4
no login

You can login without a password. No negates the requirement for a login.

conf t
line vty 0 4
login
password PW

SSH
ip domain-name domain.com
crypto key generate RSA module 2048
line vty 0 4
transport input ssh
transport output ssh
login local
exit
username ssh-user privilege 15 password cisco

ssh from a router 
ssh -l ssh-user@150.1.1.1
Or use putty or some other client etc

What can go wrong
IP of device not reachable
Incorrect transport protocols
forgotten or misconfig login or password commands under vty
ACL blocking TCP 22 (ssh) TCP 23 (Telnet) or maxed out vty lines

Correct ssh version an key size used

show commands
show run | s vty 
show run | s aaa
show run | s username
sh user
show ssh

Troubleshooting AAA
We can't config usernames and passwords on all devices constantly
We can config AAA

aaa new-model
the default for all
aaa authentication login default radius local

This one has a custom name
aaa authentication login MY-CUSTOM group radius local

radius-server host 10.10.10.5

line vty 0 4
login authentication MY-CUSTOM

You want to be able to log into the console
aaa authentication CONSOLE-LOGIN local
line con 0
authentication CONSOLE-LOGIN

You don't want radius on the console during an outage as it can take time to timeout before logging in.


LABS


Friday 17 January 2020

python pip install on windows

If you get an error like

import webexteamssdk
ModuleNotFoundError: No module named 'webexteamssdk'

We need in install that module. You'll often see the advice :

pip install webexteamssdk

This didn't work for me. I had to use:
python -m pip install webexteamssdk

Tuesday 14 January 2020

uploading firepower TS files to cisco faster with Customer eXperience Drive (CXD)

One of the big pains dealing with firepower is TAC will ask for TS files a lot. They take a long time to generate then you have to return to the FMC to download them, sometimes they can be 1gig or so and finally you need to upload them to the case. Cisco have made it a bit faster with cxd.

When you open you case with cisco, make note of the case number. Click the button to generate the token.

Log into the CLI of your FMC via ssh
expert
sudo su
curl -k https://cxd.cisco.com/public/ctfr/firepower.py | python - -c [CASE#] -t [TOKEN] --auto-upload &

Do the same on the active FTD as well.

You can move on with your day and the TS files with automatically generate and upload to the case.

You need to have DNS resolution working.


On sensor CLI 

Make sure the gateway and DNS servers are setup and working in the FTD CLI.
show networking

Configure the IP and GW
configure network ipv4 manual 192.168.100.50 255.255.255.0 192.168.100.254

nslookup cxd.cisco.com 192.168.100.53

Configure working DNS servers
configure network dns servers 192.168.100.53,192.168.100.53

The "ASA" parts DNS is handled from the GUI Devices -> platform settings -> DNS
Also look under system -> config -> Management interfaces

Enable DNS
Add a group 
Assign to interfaces (inside,outside)