Show Your IP Address

# Show all interfaces (modern)
ip addr show

# Show a specific interface
ip addr show eth0

# Legacy (may require net-tools)
ifconfig
ifconfig eth0

Show Routing Table

ip route show
# or
route -n

DNS Lookup

# Simple lookup
nslookup example.com

# Detailed lookup with dig
dig example.com
dig example.com MX
dig example.com TXT
dig +short example.com
dig @8.8.8.8 example.com   # Query specific DNS server

# Reverse lookup
dig -x 8.8.8.8

Ping

ping example.com
ping -c 4 example.com      # Send 4 packets
ping -i 0.5 example.com    # 0.5s interval
ping6 2001:4860:4860::8888 # IPv6 ping

Traceroute

traceroute example.com
traceroute -n example.com  # Don't resolve hostnames
traceroute6 example.com    # IPv6

Open Connections & Ports

# Show listening ports
ss -tlnp
netstat -tlnp

# Show all connections
ss -anp
netstat -anp

# Check if a port is open
nc -zv example.com 80
nc -zv example.com 443

SSH

# Basic connection
ssh user@hostname

# Specify port
ssh -p 2222 user@hostname

# Key-based authentication
ssh -i ~/.ssh/id_rsa user@hostname

# Copy files
scp file.txt user@hostname:/remote/path
scp -r folder/ user@hostname:/remote/path

# Generate SSH key pair
ssh-keygen -t ed25519 -C "[email protected]"
ssh-copy-id user@hostname

Firewall (iptables / ufw)

# UFW (Ubuntu/Debian)
ufw status
ufw allow 80/tcp
ufw allow 443/tcp
ufw deny 22/tcp
ufw enable

# iptables
iptables -L -v -n
iptables -A INPUT -p tcp --dport 80 -j ACCEPT

curl & wget

# Get your public IP
curl ifconfig.me
curl https://ipmonkey.co.uk/api/ip

# Download a file
wget https://example.com/file.zip
curl -O https://example.com/file.zip

# Follow redirects, show headers
curl -Li https://example.com

# POST request
curl -X POST -d 'key=value' https://api.example.com/endpoint