IP tables basics

Allow incoming connections from IP 123.0.113.51

iptables -A INPUT -s 123.0.113.51 -j ACCEPT

Allow outgoing connections to IP 123.0.113.51

iptables -A OUTPUT -d 123.0.113.51 -j ACCEPT

Block all connections from IP 123.0.113.51

iptables -A INPUT -s 123.0.113.51 -j DROP

Accept all traffic first to avoid ssh lockdown via iptables
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

Flush all blocks:

iptables -F

  • iptables, commands, firewall, flush, allow
  • 234 Users Found This Useful
Was this answer helpful?

Related Articles

How to flush your DNS cache

Your home computer creates a cache for all DNS settings. It does this to save time each time you...

What is the root login for my new VPS server?

The root login is the same password our system sent you in your welcome email. You just change...

What is the path to PERL?

The path to PERL in PERL script is:#!/usr/local/bin/perl

Do you troubleshoot scripts and apps?

Hello,Sorry, but troubleshooting sripts and apps needs to be done by the scipt maker or a...

How to use PHP-CLI

You would call '/usr/local/bin/php' if you need the php-cli binary, and '/usr/bin/php' if you...