SpaceCore WIKI
English
English
  • Personal Account and Registration
    • Account registration
    • «Customer» section
    • «Finance» section
    • Account Verification (KYC)
  • Customer service
    • How do I place an order?
    • How to contact support?
    • The Game Hosting panel
    • Setting Up BILLmanager 6 for Reselling
  • Communications
    • Notifications in Telegram
    • Web Hosting Notifications
    • Using a ping bot in Telegram
  • Information board
    • Blocked ports (VPS/VDS)
    • What is IOPS?
    • VAT for the EU and UK
  • VPS and Dedicated Servers
    • How to use VPS/VDS?
    • Changing the Password for VDS
  • OS and software configuration
    • Java [Linux]
    • Screen
    • Linux Password Recovery
    • Connecting via SSH keys
    • Disabling access to Linux using a password
    • Deploying MikroTik RouterOS on VDS
  • AI
    • Deploying DeepSeek on your server in just a few clicks
  • Windows
    • RDP connection
    • Configuring the RDP connection
    • Changing the password
    • Installation via QEMU
    • How to add an IPv4
    • Download files
    • Bruteforce Windows
  • Network Setup and Security
    • No interaction with private networks
    • Working with TCPDump
    • Change MTU Value
    • Configure IPTables
    • [DNS] Temporary failure resolving...
    • Network Speed Measurement [SpeedTest]
    • How do I buy a domain name?
    • How do I direct my domain to an IP address?
    • How to Protect Your Server? Basics of Cybersecurity
  • VPN and Privacy
    • WireGuard VPN [Easy]
    • OpenVPN [Easy]
    • Outline VPN Installation
    • Installing TorrServer
    • Installing 3X UI
    • Installing Marzban
    • Proxy for Specific Websites (V2RayN)
    • Use Nekoray
  • System monitoring
    • Traffic monitoring via VnStat
    • How to use the MTR tool
    • Getting Serial Numbers of Drives
  • Administration and Backups
    • Working with FTP Repository
    • Auto-shipment of backups
    • Installing an FTP Server
    • Mounting Linux Drives
  • Web development
    • Installing Apache2
    • Installing Nginx
    • Installing PHP
    • Installing MySQL
    • Installing PhpMyAdmin
    • Let's Encrypt SSL Generation
  • Minecraft
    • Installing Minecraft Java Server
    • Installing the Minecraft Bedrock/PE server
    • Installing the BungeeCord server
    • Installing Sponge Forge 1.12.2 Kernel
    • Configuring server.properties
    • Installing the icon on the server
    • Launch Options
    • Installing a resource pack on the server
  • Hetzner Servers
    • Control Panel
    • Password change via Rescue
    • Installing the operating system
  • 🇩🇪Contabo
    • The Control Panel
    • Disk space expansion
Powered by GitBook
On this page
  • Ufw installation
  • Private network lock
  • Unlock networks (if necessary)
PreviousBruteforce WindowsNextWorking with TCPDump

Last updated 1 year ago

There may be problems when suddenly there are complaints from the data center about scanning private networks, although you did not do it on purpose. We can block all private networks to solve this problem.

Ufw installation

First, you should check for ufw on your server.

sudo apt install ufw

Next, before enabling it, we should specify important settings to avoid losing access to services. Allow SSH, HTTP, HTTPS service ports.

sudo ufw allow 22
sudo ufw allow 80
sudo ufw allow 443

That’s it. Let’s turn on our firewall.

sudo ufw enable

Next we can check the status of the firewall team

sudo ufw status

Private network lock

Everything is fine! Now let’s move to blocking private networks.

These include:

  • 10.0.0.0/8

  • 172.16.0.0/12

  • 192.168.0.0/16

  • 100.64.0.0/10

Block them quite simply, we use the commands:

sudo ufw deny out from any to 10.0.0.0/8
sudo ufw deny out from any to 172.16.0.0/12
sudo ufw deny out from any to 192.168.0.0/16
sudo ufw deny out from any to 100.64.0.0/10
sudo ufw deny out from any to 198.18.0.0/15
sudo ufw deny out from any to 169.254.0.0/16

After addition, we can check the status of the rules again:

sudo ufw status

# Либо при помощи iptables:
iptables-save

Now, if we try to access the private network address, we get an error. For example, through the command ping:

ping 198.18.22.62

You're done!

Unlock networks (if necessary)

Check the list of current ufw rules together with their numbering:

sudo ufw status numbered

And now we can delete the necessary rule by command

sudo ufw delete <номер правила>

For example, delete rule 7:

sudo ufw delete 7

Now we have no restrictions when trying to re-address 198.18.22.62:

Thank you for familiarization! Now you know how to close (and open) access to your server to private networks using ufw.