2017-02-24 17:04:52 0 Comments Linux Boy.Lee

Centos check and control iptables' status

{ 1. check iptables current run status }

service iptables status

//stop
iptables: Firewall is not running. 

//start
Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
...

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
...

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
...

 

{ 2. Control iptables }

//start
service iptables start

//stop
service iptables stop

//restart
service iptables restart

 

{ 3. Check iptable config info }

iptables -L -n

Table: filter
Chain INPUT (policy ACCEPT)
num  target     prot opt source               destination
...

Chain FORWARD (policy ACCEPT)
num  target     prot opt source               destination
...

Chain OUTPUT (policy ACCEPT)
num  target     prot opt source               destination
...