How to start / stop iptables?

BillEssley

Well-known member
Registered
Joined
Feb 19, 2013
Messages
358
Points
28
How can I start and stop iptables on Linux server? Also I want to auto start it on every reboot as well. Can any one guide me?
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
How this is done is slightly different across Linux distributions.
What distribution are you using ?
 

stackstar

Member
Registered
Joined
Nov 22, 2016
Messages
30
Points
0
You can also clear all the iptables rules with iptables -F and iptables -X , but make sure you script that as you can lock yourself out if you dont allow the SSH port your are actually connected on
 

mondoserv

New member
Registered
Joined
Nov 24, 2016
Messages
10
Points
0
In order to make sure you don't get locked outside, verify that the iptables policy on these chains is set to ACCEPT. If not, set it:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
 

mondoserv

New member
Registered
Joined
Nov 24, 2016
Messages
10
Points
0
to check if an IP address is listed or not, use 'iptables -L -n -v |grep IP'
 

BillEssley

Well-known member
Registered
Joined
Feb 19, 2013
Messages
358
Points
28
to check if an IP address is listed or not, use 'iptables -L -n -v |grep IP'
I don't understand this. I think it needs to check with tools out there, not on my VPS.

In order to make sure you don't get locked outside, verify that the iptables policy on these chains is set to ACCEPT. If not, set it:
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
Can you elaborate in details?
 

mondoserv

New member
Registered
Joined
Nov 24, 2016
Messages
10
Points
0
The policy is a default rule for each chain. If it is set to DROP, you need to create a specific rule to ACCEPT traffic from a certain IP address or to a certain port. If it is set to ACCEPT, it will accept all traffic, unless there is a rule to DROP traffic from a certain IP address or to a certain port.
The iptables rules present on your server cannot be checked from outside the server.
 

jwn

Active member
Hosting Provider
Registered
Joined
Dec 11, 2016
Messages
65
Points
8
Find status of firewall

Login as root user either by opening the Terminal or login over the ssh based session. Type the following command:
sudo ufw status
Sample outputs:

Status: inactive

Ubuntu stop iptables service command

Type the following command to unloads firewall and disables firewall on boot:
sudo ufw disable
Ubuntu start iptables service command

Type the following command to reloads firewall and enables firewall on boot:
sudo ufw enable
Ubuntu reload / restart iptables service command

Type the following command to reloads firewall:
sudo ufw reload
 

StartVM

Well-known member
Registered
Joined
Aug 5, 2016
Messages
241
Points
18
How can I start and stop iptables on Linux server? Also I want to auto start it on every reboot as well. Can any one guide me?
For autostart, I think most linux distros do this automatically for iptables but in CentOS 7 I know its sudo systemctl enable iptables
 
Newer Threads
Replies
2
Views
6,047
Replies
12
Views
4,852
Replies
2
Views
7,493
Latest Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top