Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

This is a follow-up question after I fixed my initial problems: I have a CENTOS Linux VPS. I have the following in my IPTABLES script to run when my VPN restarts, but I get errors when I do a service firewall restart

I've ran each of the commands below manually and they work. According to Host Gator in order for the IPTABLES rules to persist I need to place them in the

/etc/firewall/INCLUDE

Here is my INCLUDE file:

  1 iptables -A INPUT -p tcp -m tcp --dport 3000 --tcp-flags FIN,SYN,RST,ACK SYN -j ACCEPT
  2 iptables -A INPUT -i lo -j ACCEPT
  3 iptables -A OUTPUT -o lo -j ACCEPT
  4 iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
  5 iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  6 iptables -A INPUT -p tcp --dport 5622  -m state --state NEW -j ACCEPT
  7 iptables -A INPUT -p tcp --dport 80  -m state --state NEW -j ACCEPT
  8 iptables -A INPUT -p tcp --dport 4643  -m state --state NEW -j ACCEPT
  9 iptables -A INPUT -p tcp --dport 22  -m state --state NEW -j ACCEPT
 10 iptables -A INPUT -p ICMP --icmp-type 8 -j ACCEPT
 11 iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 25 -j ACCEPT
 12 iptables -I INPUT -p tcp --dport 3000 --syn -j ACCEPT
 13 iptables -t nat -I PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 3000
 14 iptables -t nat -I PREROUTING -p tcp --dport 80 -j REDIRECT --to-ports 3000
 15 iptables -A INPUT -p tcp --tcp-flags ALL NONE -j DROP
 16 iptables -A INPUT -p tcp ! --syn -m state --state NEW -j DROP
 17 iptables -A INPUT -p tcp --tcp-flags ALL ALL -j DROP
 18 iptables -A INPUT -j DROP -p ALL

Errors:

DETECTED CONTROL PANEL: cpanel
Reading file /etc/firewall/GLOBAL_DROP
Running file /etc/firewall/INCLUDE
REG INCOMING SERVICES
Reading file /etc/firewall/INPUT
OUTGOING SERVICES
Reading file /etc/firewall/OUTPUT
: command not foundbles-config: line 7:
: command not foundbles-config: line 14:
: command not foundbles-config: line 20:
: command not foundbles-config: line 26:
: command not foundbles-config: line 33:
: command not foundbles-config: line 38:
: command not foundbles-config: line 44:
: command not foundbles-config: line 49:

Is this some sort of spacing issue or whitespaces? Any ideas?

share|improve this question
    
the IPTABLE rules seem to be functioning as far as I can tell, but I can only tell by the port forwarding. I've contacted Host Gator and hopefully they will be able to help. I like to think that I pay their bloated VPS prices for the support they give me. –  ConfusedDeer Aug 12 at 4:03
1  
The error message doesn't refer to /etc/firewall/INCLUDE, it refers to /etc/firewall/OUTPUT. Could you add the contents of that file into your question? –  MadHatter Aug 12 at 4:40
    
The OUTPUT file is completely blank (I viewed it using VIM). –  ConfusedDeer Aug 12 at 10:45

1 Answer 1

A HostGator Linux Admin fixed the problem: According to HostGator:

The error message was corrected by moving a file that has incorrect configuration options and then restarting the firewall:

root@mic [~]# mv -v /etc/sysconfig/iptables-config /root
`/etc/sysconfig/iptables-config' -> `/root/iptables-config'
root@mic [~]# service firewall restart
DETECTED CONTROL PANEL: cpanel
Reading file /etc/firewall/GLOBAL_DROP
Running file /etc/firewall/INCLUDE
REG INCOMING SERVICES
Reading file /etc/firewall/INPUT
OUTGOING SERVICES
Reading file /etc/firewall/OUTPUT 
iptables: Saving firewall rules to /etc/sysconfig/iptables:[ OK ]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.