Show Menu

Linux Network Commands Cheat Sheet by

Linux Network Commands

watch ss -tp
Network Connec­tions
netstat -ant
TCP connec­tions
netstat -anu
UDP Connec­tions
netstat -tulpn
Connec­tions with PIDs
lsof -i
Establ­ished Connec­tions
Access Windows SMB Share
share <US­ERN­AME> <IP> c$
Mount Windows Share
ifconfig <IN­TER­FAC­E> <IP­/CI­DR>
Set IP and netmask
ifconfig eth0:1 <IP­/CI­DR>
Set virtual interface
route add default gw <IP­>
Set Default Gateway
ifconfig <IN­TER­FAC­E> mtu <SI­ZE>
Change MTU size
export MAC=<M­ACA­DDR­ESS­>
Change MAC Address
ifconfig int hw ether <MA­CAD­DRE­SS>
Change MAC Address
dig -x <IP­>
Domain Lookup IP
host <IP­>
Domain Lookup IP
dig@<­IP> <DO­MAI­N> -t AXFR
DNS Zone Transfer
host -l <DO­MAI­N> <NA­MES­ERV­ER>
DNS Zone Transfer
echo "­1" > /proc/­sys­/ne­t/i­pv4/ip forward
Enable IP Forwarding
echo <"NA­MES­ERV­ER"> > /etc/r­eso­lv.c­onf
Add DNS Server
User inputted data is to go between the brackets < >. When you enter the command and supply the input, remove the brackets for the command to run succes­sfully.

Help Us Go Positive!

We offset our carbon usage with Ecologi. Click the link below to help us!

We offset our carbon footprint via Ecologi


Thank you! :)

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          More Cheat Sheets by itnetsec