Results 1 to 6 of 6

Thread: understanding iptables

  1. #1
    Join Date
    Apr 2010
    Location
    sudan
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    understanding iptables

    hello every one here,
    I dont know if this is the right place

    I have an issue with iptables... i am trying to understand how iptables works I was downloaded the iptables tutorial 1.2.2 and read it but still have some problemes understanding the whole rule set (code)...
    I used fwbuilder to generate the code for me for study issue but as i said i have problem to figureout the nine rule set
    in fwbuilder i select: new firewall>> iptable firewall software & linux 2.4/2.6 OS >> and i use preconfigure templets firewall object (/usr/share/fwbuilder-3.0.7/templates.xml )>> templet 2>>
    and i just want to understand the fires rule set with breif explanation
    and this is the code generated by the firewall builder :
    # Rule 0 (eth0)
    #
    echo "Rule 0 (eth0)"
    #
    # anti spoofing rule
    #
    $IPTABLES -N In_RULE_0
    test -n "$i_eth0" && $IPTABLES -A INPUT -i eth0 -s $i_eth0 -m state --state NEW -j In_RULE_0
    $IPTABLES -A INPUT -i eth0 -s 192.168.1.1 -m state --state NEW -j In_RULE_0
    $IPTABLES -A INPUT -i eth0 -s 192.168.1.0/24 -m state --state NEW -j In_RULE_0
    test -n "$i_eth0" && $IPTABLES -A FORWARD -i eth0 -s $i_eth0 -m state --state NEW -j In_RULE_0
    $IPTABLES -A FORWARD -i eth0 -s 192.168.1.1 -m state --state NEW -j In_RULE_0
    $IPTABLES -A FORWARD -i eth0 -s 192.168.1.0/24 -m state --state NEW -j In_RULE_0
    $IPTABLES -A In_RULE_0 -j LOG --log-level info --log-prefix "RULE 0 -- DENY "
    $IPTABLES -A In_RULE_0 -j DROP

    help me understanding this or give me liks to follow.... thanx

  2. #2
    Join Date
    Apr 2009
    Location
    Rawalpindi, Pakistan
    Beans
    5,666
    Distro
    Ubuntu Gnome Development Release

  3. #3
    Join Date
    Apr 2010
    Location
    sudan
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: understanding iptables

    thanx mr. sikander3786 this is realy more illustrated than the tutorial book .... i will read throgh it slowly and if any troubes appear to me i will be back here in a moment...

    thanx
    Last edited by toloykhan; October 7th, 2010 at 11:57 AM.

  4. #4
    Join Date
    Apr 2008
    Location
    Far, far away
    Beans
    2,148
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: understanding iptables

    These rules above just filter out any packets that come from outside your LAN but claim to be sourced from inside, assuming 192.168.1.0/24 is your LAN.

    First they create a new table, then they add a few rules to detect packets coming in eth0 with LAN sourced addresses and send them to that table. In that table the packets are logged and dropped.

    I have no idea why they add two of each rule since the second of each set covers the source address of the first. It's probably just a result of code redundancy that generates both when one will work.

    Kind of lame names too. They could name the table SPOOF instead of In_RULE_0 and put more descriptive text in the LOG entries. Probably because they don't expect anyone to read the rules.

  5. #5
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: understanding iptables

    Also check here.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

  6. #6
    Join Date
    Apr 2010
    Location
    sudan
    Beans
    25
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: understanding iptables

    Quote Originally Posted by BkkBonanza View Post
    Kind of lame names too. They could name the table SPOOF instead of In_RULE_0 and put more descriptive text in the LOG entries. Probably because they don't expect anyone to read the rules.

    sorry for being late but I was too busy last days...
    thanx master... the naming is just in the generated code but in the fwbuilder interface the the naming and the label is done right .... and for the first matter you show i am try to figure out why is that

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •