top of page

Linux Networking Commands

Updated: Feb 14

Find out your Public IP

dig +short myip.opendns.com @resolver1.opendns.com

List the processes listening on which port

netstat -plunt                             -

 

List routing table in Linux

ip route

Add and Remove Route

sudo ip route add 10.0.2.0/24 via 192.168.2.1 dev wlp3s0
sudo ip route del 10.0.2.0/24 via 192.168.2.1 dev wlp3s0

Flush/Clear all Iptable rules

iptables -F

Packet Capturing using tcpdump


List of interface could be found by using the following command:

tcpdump -i eth0 net 192.168.1.0/24
tcpdump -i eth0 src net 192.168.1.0/24
tcpdump -i eth0 port 53

13 views0 comments
bottom of page