Go Back   HostGator Peer Support Forums > Public Forums > Pre-Sales Questions

Notices

Reply
 
Thread Tools
  #1  
Old 02-07-2011, 04:18 AM
StackyFof StackyFof is offline
Hatchling Croc
 
Join Date: Feb 2011
Posts: 2
Default iptables generation problem

Hi everyone,

I don't know if I am in the good section and could you please move my topic in the good one.

I am working on a HG dedicated server with centos. I had to remove a iptables rule in order to let my zabbix agent works but at every reboot, all of my basic iptables rules are regenerate again and I loose my custom iptables rules.

In fact, I have modified /etc/sysconfig/iptables in order to have my custom iptables rules on every reboot. It works fine when I restart iptables : /etc/init.d/iptables restart. It loads my custom rules properly (/etc/sysconfig/iptables) but it does not work when I reboot. I think /etc/sysconfig/iptables is regenerate cause by some other services ?

Actually, let see my /etc/sysconfig/iptables header before reboot :
Quote:
# Generated by iptables-save v1.3.5 on Mon Feb 7 03:59:15 2011
After reboot :
Quote:
# Generated by iptables-save v1.3.5 on Mon Feb 7 04:04:05 2011
I am anticipating some question, enclose my /etc/iptables-config :
Quote:
# Load additional iptables modules (nat helpers)
# Default: -none-
# Space separated list of nat helpers (e.g. 'ip_nat_ftp ip_nat_irc'), which
# are loaded after the firewall rules are applied. Options for the helpers are
# stored in /etc/modprobe.conf.
IPTABLES_MODULES=""

# Unload modules on restart and stop
# Value: yes|no, default: yes
# This option has to be 'yes' to get to a sane state for a firewall
# restart or stop. Only set to 'no' if there are problems unloading netfilter
# modules.
IPTABLES_MODULES_UNLOAD="yes"

# Save current firewall rules on stop.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets stopped
# (e.g. on system shutdown).
IPTABLES_SAVE_ON_STOP="no"

# Save current firewall rules on restart.
# Value: yes|no, default: no
# Saves all firewall rules to /etc/sysconfig/iptables if firewall gets
# restarted.
IPTABLES_SAVE_ON_RESTART="no"

# Save (and restore) rule and chain counter.
# Value: yes|no, default: no
# Save counters for rules and chains to /etc/sysconfig/iptables if
# 'service iptables save' is called or on stop or restart if SAVE_ON_STOP or
# SAVE_ON_RESTART is enabled.
IPTABLES_SAVE_COUNTER="no"

# Numeric status output
# Value: yes|no, default: yes
# Print IP addresses and port numbers in numeric format in the status output.
IPTABLES_STATUS_NUMERIC="yes"

# Verbose status output
# Value: yes|no, default: yes
# Print info about the number of packets and bytes plus the "input-" and
# "outputdevice" in the status output.
IPTABLES_STATUS_VERBOSE="no"

# Status output with numbered lines
# Value: yes|no, default: yes
# Print a counter/number for every rule in the status output.
IPTABLES_STATUS_LINENUMBERS="yes"
I think there are some other programs which regenerate my /etc/sysconfig/iptables with the command iptables-save. We know that iptables-save saves all of the currents iptables rules but where does it come from ?

What do you think about ?

Best regards.
Reply With Quote
  #2  
Old 02-07-2011, 04:23 AM
GatorDavid's Avatar
GatorDavid GatorDavid is offline
HostGator Staff
 
Join Date: May 2007
Posts: 1,826
Default Re: iptables generation problem

Is it the default HG dedicated server setup? We have a script that is installed (/usr/sbin/firewall) that makes some iptables administration easier. If you add your rule to /etc/firewall/INCLUDE, it should work on reboot.
__________________
David I.
Level III Linux Systems Administrator
Hostgator.com LLC
Reply With Quote
  #3  
Old 02-07-2011, 04:35 AM
StackyFof StackyFof is offline
Hatchling Croc
 
Join Date: Feb 2011
Posts: 2
Default Re: iptables generation problem

Quote:
Originally Posted by GatorDavid View Post
Is it the default HG dedicated server setup? We have a script that is installed (/usr/sbin/firewall) that makes some iptables administration easier. If you add your rule to /etc/firewall/INCLUDE, it should work on reboot.
Thank you for the quick answer.

But I would like to remove three rules and not add one. The problem is /etc/firewall contains only some iptables rules but not all of them.

In /etc/firewall/INCLUDE :
Quote:
IPTABLES=/sbin/iptables
$IPTABLES -I INPUT -m string --algo bm --string "gifimg.php" -p tcp --dport 21 -j LOG --log-level notice -m limit --limit 1/minute --log-prefix "gifimg.php attempt : "
$IPTABLES -A INPUT -m string --algo bm --string "gifimg.php" -p tcp --dport 21 -j REJECT
$IPTABLES -A OUTPUT -m string --algo kmp --string "gifimg.php" -p tcp --dport 21 -j LOG --log-level notice --log-tcp-options --log-ip-options --log-uid --log-prefix "OUTBOUND-GIFIMG : "
$IPTABLES -A OUTPUT -m string --algo kmp --string "gifimg.php" -p tcp --dport 21 -j DROP
I think there is an extreme solution which is to modify /etc/init.d/firewall in order to start iptables like I want to. Do you have any better solution ?

BR.
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lead Generation Sytem (for Network Marketers) curtvise Site Promotion 0 11-25-2009 10:19 PM
problem with iptables quietFinn Linux VPS Support 43 09-23-2009 04:14 PM
VBCnetwork.com (The next generation in VTV) aaronblrt1 Site Promotion 1 07-12-2007 08:47 PM

All times are GMT -5. The time now is 09:20 AM.