Categories
Linux

Trace Route for an IP

Traceroute command

traceroute 8.8.8.8

IP Route command

ip route get 8.8.8.8

Other commands

ip route list
Categories
Networking

List TCP Connections on my computer

List Interfaces

sudo tcpdump -D

Filter Parameters

  • host
  • dst
  • src
  • port

Interfaces

sudo tcpdump -i any
sudo tcpdump -i any -c 10
sudo tcpdump -i any -c5 -nn
ValueFlag TypeDescription
SSYNConnection Start
FFINConnection Finish
PPUSHData push
RRSTConnection reset
.ACKAcknowledgement

Capture ICMP protocol

sudo tcpdump -i any -c5 icmp

Limit using host filter

sudo tcpdump -i any -c5 -nn host x.x.x.x

Limit using the port filter

sudo tcpdump -i any -c5 -nn port 80

Limit using the src filter

sudo tcpdump -i any -c5 -nn src x.x.x.x

Limit using the dest filter

sudo tcpdump -i any -c5 -nn dst x.x.x.x

Limit using multiple filters

sudo tcpdump -i any -c5 -nn src x.x.x.x and port 80
Categories
Command Line

Log terminal commands and output

Script Method

Start

script screen.log

End

exit

Alternate method

[COMMAND] > output.txt

Appending to previous data

[COMMAND] >> output.txt
Categories
Command Line

Diff terminal command basic

Usage

diff file1.doc file2.doc

List of lines added

diff --changed-group-format='%>' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\+"

List of lines removed

diff --changed-group-format='%<' --unchanged-group-format='' file1.doc file2.doc
diff -u file1.rsc file2.rsc | grep -E "^\-"
Categories
Networking

MikroTik basic terminal commands

Show walled-garden IP

ip hotspot walled-garden ip print