Using CheatSheets To Apply Best Practices

Cheatsheet: Linux Networking

Cheatsheet: Linux Networking

1.1 Top 10 Networking Questions

Num Name Summary
1 Difference between switch and router? L2, L3
2 What is a DNS amplification attack?  
3 Difference between L2 and L3 switch?  
4 What is TCP SYN scan? How it’s conducted?  
5 Which port ICMP is using? Neither TCP or UDP. Link
6 Proxy server vs Loadbalancer. Proxy server vs Reverse proxy server  
7 Brief introduction about 802.1x  
8 List all methods which can stop one ip ssh to the server  
9 Explain how iptable routing rules works  

1.2 Linux Networking

Name Comment
Examine network nic traffic ethtool -S eth0
Check system configuration sysctl -a
Change linux machine hostname /etc/sysconfig/network, /etc/hostname
Ports for well-known services cat /etc/services
Reference SSH CheatSheet, Tcpdump CheatSheet, CheatSheet: Curl & Wget
Reference CheatSheet: Linux File, CheatSheet: Linux Process, CheatSheet: Linux Networking

1.3 HTTP

Name Command
How HTTPS works  
Explain X509 certificates  
See HTTP request statistics httpstat (brew install httpstat)
Monitor HTTP URLs SaaS:
Examine web page performance SaaS:
Test webpage from different browsers SaaS:
Export local http service to Internet SaaS:
Reference CheatSheet: Curl & Wget, GitHub: free-for-dev

1.4 TCP

Name Comment
List all listening tcp ports netstat -tunlp
Port scan for a given host sudo nmap -O, SaaS:
Add 97ms latency to eth0 Link: tc, tc qdisc add dev eth0 root netem delay 97ms
Check tc status tc -s qdisc
Remove tc rule tc qdisc del dev eth0 root netem
Check network speed SaaS:
Tcp manual man 7 tcp
Disable ipv6 Change systcl, by adding net.ipv6.conf.*.disableipv6
Check for IPv6 support in the current kernel /proc/net/if_inet6
Reference Tcpdump CheatSheet

1.5 Route

Name Comment
List route rules route -n, netstat -nr
Add default rule route add default gw netmask dev eth0
Add route rule route add -net gw netmask dev eth0
Del route rule route del -net netmask dev eth1

1.6 DNS

Name Comment
Check dns naming sudo nslookup
Print routing table netstat -rn
List all the router hops traceroute
DNS lookup utility host
DNS pin test SaaS:
Websites To Register DNS Link: Google Domain DNS, Link: GoDaddy, Link: Amazon Route 53

1.7 CDN

Name Command
CDN services cloudflare, jsDelivr

1.8 TCP sockets workflow

Name Comment
create a new anonymous socket s = socket(<parameters>)
Bind tcp port to a socket bind(s, <local IP:port>)
Create a socket to remote endpoint connect(s, <remote IP:port>)
Create local socket and make it eligible to take requests listen(s, ...)
Accept client requests s2 = accept(s)
Read n bytes from a socket n = read(s, buffer, n)
Write n bytes to a socket n = write(s, buffer, n)
Close a socket close(s)
Shutdown stdin and stdout/stderr for a socket shutdown(s, <side>)
Read socket options getsockopt(s, ..)
Change socket options setsockopt(s, ..)

1.9 More Resources

Leave a Reply

Your email address will not be published. Required fields are marked *