How to iptables part II

From: Nahual Guerrero (panakeia@terra.es)
Date: 11/12/01


From: Nahual Guerrero <panakeia@terra.es>
To: security-basics@securityfocus.com
Subject: How to iptables part II
Date: Mon, 12 Nov 2001 01:58:59 +0100
Message-Id: <01111201585900.01956@localhost.localdomain>

Well Nahual strikes back.... :(

I've been reading all the valious documents I found , and i found a new (i
guess) way to make my rules load at start up... But ( there is always a
disgusting but) as my skills are poor , i found myself in trouble when i
tried to make work a script. I'll paste you what I found:
-------------------------------------------------------
root@localhost init.d]# ./iptables start
 Flushing all current rules and user defined chains:[ OK ]
 Clearing all current rules and user defined chains:[ OK ]
Applying iptables firewall rules:
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxxx
iptables -A INPUT -j REJECT -p tcp -s ! 127.0.0.0/255.255.255.0
--destination-port xxxxxxx
                                                           [ OK ]
--------------------------------------------------------
As my paranoia were growing i decided to look if what the script is supposed
to do was done (note that the script is made by Joshua Jensen
<joshua@redhat.com> )and I discoverred this....
--------------------------------------------------------
[root@localhost init.d]# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
 
Chain FORWARD (policy ACCEPT)
target prot opt source destination
 
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
--------------------------------------------------------
Dammit! I 've experienced trouble when trying to make the script execute the
rules instead of simply listing em.... heres the portion of the script that
migth be wrong:
--------------------------------------------------------
echo $"Applying iptables firewall rules: "
                grep -v "^[[:space:]]*#" $IPTABLES_CONFIG | grep -v
'^[[:space:]]*$'iptables-restore -v $IPTABLES_CONFIG && \
                    success "Applying iptables firewall rules" || \
                    failure "Applying iptables firewall rules"
--------------------------------------------------------
Well i think i found a way to make it work... but , as I said i'm working
hard in order to manage independently with this little trouble , but as i
guess i still not have the necessary knowledge , i ask to you again to help
me or give me another clue in order to solve the problem.
Thanks in advance... and do not blame me for my... poor knowledge



Relevant Pages

  • Re: Help with Iptables on with RH linux
    ... iptables -P OUTPUT DROP ... INPUT only when packets have a destination IP of your firewall. ... the FORWARD chain contains rules that affect packets passing through ... Yes I flushed the rules before calling the script... ...
    (RedHat)
  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: some reality about iptables, please
    ... > That's the 'plumbing' level access to iptables which works for all Linux kernels supporting iptables, ... Chain POSTROUTING (policy DROP) ... DROPl all --!192.168.174.0/24 anywhere ...
    (Debian-User)
  • Re: IP Masquerading
    ... here's the first third of the iptables listing (I'll send more if ... Chain FORWARD (policy DROP) ... The windows boxes seem to be getting their ...
    (alt.os.linux.suse)