Tuesday, 5 January 2021

linux tools

Shells to consider

Bash (on basically everything)

zsh (auto complete etc)

fish (friendly interactive shell)




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 recent / 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.
70ms or below is good.