Skip to content

Problems with --state #11

Closed
Closed

Description

@leleobhz

I need a rule for statefull firewall but i cant create it:

In [42]: mstate = iptc.Match(r,'state')

In [43]: mstate.state = "RELATED"
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/leonardo/python-iptables/<ipython-input-43-6efafb390601> in <module>()
----> 1 mstate.state = "RELATED"

/usr/lib/pymodules/python2.7/iptc/__init__.pyc in __setattr__(self, name, value)
    358     def __setattr__(self, name, value):
    359         if not name.startswith('_') and name not in dir(self):
--> 360             self.parse(name.replace("_", "-"), value)
    361         else:
    362             object.__setattr__(self, name, value)

/usr/lib/pymodules/python2.7/iptc/__init__.pyc in parse(self, parameter, value)
    303         if not self._module.extra_opts:
    304             raise AttributeError("%s: invalid parameter %s" %
--> 305                     (self._module.name, parameter))
    306 
    307         _optarg.value = value

AttributeError: state: invalid parameter state

Activity

  1. leleobhz commented on Jul 23, 2012

    @leleobhz
    Author

    And i think the same problem is concerning this issue:

    root@genesis:~# /home/leonardo/bin/fw.py
    Traceback (most recent call last):
      File "/home/leonardo/bin/fw.py", line 103, in <module>
        a = scw_fw()
      File "/home/leonardo/bin/fw.py", line 97, in __init__
        self.m.dport = '33434-33534'
      File "/usr/lib/pymodules/python2.7/iptc/__init__.py", line 360, in __setattr__
        self.parse(name.replace("_", "-"), value)
      File "/usr/lib/pymodules/python2.7/iptc/__init__.py", line 305, in parse
        (self._module.name, parameter))
    AttributeError: udp: invalid parameter dport
    root@genesis:~# /home/leonardo/bin/fw.py
    Traceback (most recent call last):
      File "/home/leonardo/bin/fw.py", line 103, in <module>
        a = scw_fw()
      File "/home/leonardo/bin/fw.py", line 97, in __init__
        self.m.dport = '33434-33534'
      File "/usr/lib/pymodules/python2.7/iptc/__init__.py", line 360, in __setattr__
        self.parse(name.replace("_", "-"), value)
      File "/usr/lib/pymodules/python2.7/iptc/__init__.py", line 305, in parse
        (self._module.name, parameter))
    AttributeError: multiport: invalid parameter dport
    
  2. ldx commented on Aug 16, 2012

    @ldx
    Owner

    If you flush all the rules in iptables with iptables -F and iptables -t nat -F and then run the tests, is there any that fails?

  3. leleobhz commented on Aug 23, 2012

    @leleobhz
    Author

    I cant remember preciselly now, but i guess yes, because between one test and other i needed to clean all tables.

  4. leleobhz commented on Aug 23, 2012

    @leleobhz
    Author

    And i thing this is a libxtables call issue, not a problem of iptables itself. I dont know libxtables enough to know if it expose all iptables available modules automatically or if it need to be explicitally setted in py-iptables. If its a py-iptables dependent support, have a way to create a basic documentation explaining how to support new modules on py-iptables?

  5. tzewangdorje commented on Sep 8, 2012

    @tzewangdorje

    Hi, I'm considering using this project and will need state matching. Is it still alive or has it died? Will be willing to contribute some time. I have python skills, although not C unfortunately.

  6. ldx commented on Jan 3, 2013

    @ldx
    Owner

    Hi there, not much progress since this issue - we're still not compatible with iptables 1.4. If you'd like to contribute, please see the other tickets, it's explained there what is needed to make python-iptables work with iptables 1.4.

  7. ldx commented on Jan 25, 2013

    @ldx
    Owner

    Please give HEAD a shot - it should now work with the new iptables 1.4 x6_* API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions