Skip to main content
Support
0
Contact us
Nederlands
Deutsch
Español
Dedicated serversFlexible VPSCloud TechnologyColocationChallenges in ITSectorsCareers
Cloud Compute

With Cloud Compute, you have access anytime and anywhere to a portal through which you can configure your entire IT environment from wherever you are in the world.

Cloud Storage

Reliable access to your files, infrastructure, and applications at all times – with no interruptions or delays. At Worldstream, we offer a variety of storage solutions.

Flexible cloud icon
Flexible cloud
Private cloud icon
Private cloud
Bare metal icon
Bare Metal Compute
Hollow cube icon
Object storage
Hollow cube icon
File storage
Block storage icon
Block storage
Backup storage icon
Backup storage
Need support?

With experienced engineers and an average response time track record on 7 minutes, you can expect a solid technical support solution in next to no time.

All Servers

Choose your Dedicated Server now. Custom or Instant Delivery. Powerhouse servers built for your use case.

Use Cases

Whatever your use case, we’re here to help you find the ideal solution.

Deal servers icon
Deals
AMD servers icon
AMD Processors
AI servers icon
Intel Processors
Hollow cube icon
Virtualisation, Containerisation and Orchestration
Hollow cube icon
Websites and Applications
Hollow cube icon
Gaming and Streaming Infrastructure

24/7/365 support with an average response time of just 7 minutes. Thanks to our own data centers, our engineers can go directly to your server for fast, hands-on assistance. Email or call us anytime.

Smart outsourcing

Some IT creates added value, while other types are supportive. Use that as a starting point for outsourcing.

Cost Efficiency

Complete IT packages may seem like the safe option, but when you consider the costs, other choices often make more sense.

IT flexibility & control

Outsourcing doesn’t mean losing control; it actually provides more flexibility and control.

Cloud repatriation

The cloud is not a final destination: You should continuously evaluate and adjust your cloud environment as needs evolve.

Financial services
Logistics & Transportation
Retail & E-commerce
Media & Entertainment
Tech & Software Development
Security
Managed Service Providers
Need support?

With experienced engineers and an average response time track record on 7 minutes, you can expect a solid technical support solution in next to no time.

Chat with usContact us
About WorldstreamAbout the technologyCasesKnowledge base
About usMeet the teamJobsBecome a resellerCertificationsOur data centersOur networkDDoS ProtectionAMD EPYC serversTechnology PartnersOperating SystemsAll casesEasyTerraDutch Drone CompanyPerfGridArticlesFAQNews and BlogsProducts and Services
Contact us

Call +31 (0) 174 – 712 117

Industriestraat 53, Naaldwijk

Nederlands
Deutsch
Español
0
Dedicated serversFlexible VPSCloud TechnologyColocationChallenges in ITSectorsCareersAbout WorldstreamAbout the technologyCasesKnowledge baseMy Worldstream
Contact
Support
NederlandsDeutschEspañol
  1. HomeHome
  2. Knowledge Base
  3. Security
  4. Iptables basics

Iptables basics

Applies to Dedicated servers, Flexible VPS (Linux)Audience Server administratorsLast reviewed September 2026

Quick answer

Iptables is the classic rule-based Linux firewall. It ships on most distributions but starts with no rules, meaning all traffic is allowed until you add some. Use sudo iptables -L to see current rules and -I INPUT to add one at the top of the chain.

On this page
  • How iptables works
  • Basic commands
  • Securing your connection
  • Opening specific ports
  • Save and restore rules

Many current distributions use nftables or a front end like UFW or firewalld by default, but the underlying iptables commands below still work on systems where iptables itself is in use. Check which firewall tool is active on your server before assuming iptables is it.

How iptables works

Iptables organises rules into chains:

  • INPUT: packets destined for the host itself
  • OUTPUT: packets originating from the host
  • FORWARD: packets passing through the host

Two options add rules: -A (append, adds to the bottom of the chain) and -I (insert, adds at position one by default).

Basic commands

1

List current rules

sudo iptables -L
sudo iptables -L --line-numbers
2

Delete a rule by line number

sudo iptables -D INPUT 2
3

Set a chain's default policy

sudo iptables -P FORWARD DROP
4

Flush all rules

This clears every rule in every chain. Use with care, and only once you know how you'll restore access afterwards.

sudo iptables -F

Securing your connection

Before you tighten anything, allow your own IP address on the port you connect through so you don't lock yourself out.

sudo iptables -I INPUT -p tcp -s [your public IP address] --dport 22 -j ACCEPT

Opening specific ports

sudo iptables -I INPUT -p tcp --dport 22 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT
sudo iptables -I INPUT -p tcp --dport 443 -j ACCEPT

Save and restore rules

Iptables rules don't persist across reboots on their own. How you save them depends on your distribution.

1

Debian and Ubuntu

sudo apt-get install iptables-persistent
sudo iptables-save > /etc/iptables/rules.v4
sudo iptables-restore < /etc/iptables/rules.v4
2

RHEL, CentOS Stream, Rocky Linux, AlmaLinux

On current RHEL-family releases, iptables rules are typically saved through the iptables-services package rather than a plain service iptables save call. Many of these systems use firewalld by default instead, so check which is active first.

sudo iptables-save > /etc/sysconfig/iptables
sudo iptables-restore < /etc/sysconfig/iptables

Related articles

  • UFW firewall basics
  • Firewalld basics
  • How to improve your SSH security
  • How to change the SSH port
Was this article helpful?

Solid IT. No Surprises

Sparring partner for IT maturity
Eliminating barriers so you can run
Predictable and transparant costs

Contact

  • Industriestraat 53, Naaldwijk
  • Payment Methods
  • Abuse
  • Developers Resources
  • Network Operations Center
  • About us
  • Meet the team
  • Jobs
  • Become a reseller
  • Certifications
  • Our data centers
  • Our network
  • DDoS Protection
  • AMD EPYC servers
  • Technology Partners
  • Operating Systems
  • Overview
  • FAQ
  • Cases
  • News & Blogs
  • Use Cases
Nederlands
Deutsch
Español
Nederlands
Deutsch
Español
  • Legal
  • Disclosure