AGAmirali Gholian

Amirali Gholian

💻 Python | 🐧 Linux | 🚀 AI
← Back to Home

🛡️ Network Security

Networking fundamentals and security practices

1. Network Commands

What is it? Network commands help you check connections, find IP addresses, and troubleshoot network issues.
network_commands.sh
# ifconfig - show network interfaces ifconfig # ip - show IP addresses ip addr show # ping - test connection ping -c 4 google.com # nslookup - find IP of website nslookup google.com # netstat - show open ports netstat -tlnp # wget - download file wget https://example.com/file.zip # curl - send web request curl https://example.com

2. Firewall - Protect Your Computer

What is it? A firewall is like a security guard for your computer. It decides which data can come in and go out.
firewall_config.sh
# UFW - simple firewall sudo ufw enable # Turn on firewall sudo ufw disable # Turn off firewall sudo ufw status # Check status # Allow and deny ports sudo ufw allow 22 # Allow SSH sudo ufw deny 80 # Block HTTP sudo ufw allow 443 # Allow HTTPS # Delete a rule sudo ufw delete allow 80