πtcpdump
πCheck for packets flowing out from an interface for a specific CIDR
sudo tcpdump -v -i wlo1 dst net 192.168.0.0/16
Explanation:
-i
is forinterface
.wlo1
is the interface name.dst
specifiesdestination IP
net
specifies itβs a CIDR range.
πip
πList routing table
ip route
πFind which interface and route a particular IP is taking
ip route get 192.168.1.1
πifconfig
πFind the primary IP of local machine
πGet the IP of all interfaces:
ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'
πGet the IP of a specific interface:
For eg (wlo1
):
ifconfig wlo1 | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0.1'