Comments (8)
Can you tell me the version/git hash you use?
from python-iptables.
Hi there, thanks for the quick response! I'm on the latest (b88763c). Also, I'm using Debian 7.0.0 - 3.2.0-3-amd64 with iptables: v1.4.14
It seems that the handle might be going stale or something, as when I repeatedly refresh (call on the chain) it eventually stops updating and then throws the error.
The functions are here: https://github.com/jawr/kontrolvm-node/blob/master/tasks/iptables.py#L28
from python-iptables.
Can you isolate the code that triggers this problem? I tried this simplistic script:
#!/usr/bin/python
import iptc
while True:
chain_name = 'FORWARD'
chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), chain_name)
print chain.name
but here it works without issues.
from python-iptables.
I think the problem found in the kernel's modules not enabled, as described in this link:
http://thelinuxtricks.blogspot.de/2013/05/python-iptables-libiptc-version-error.html
The modules are:
- ip_conntrack
- ipt_state
unfortunately in the new kernel the "ip_conntrack" is deprecated and "sudo modprobe ip_conntrack" don't work.
What do you think?
from python-iptables.
Hi @vinc3nt - the lack/depreciation of a kernel module should not cause any problems as long as the userspace and kernel parts of iptables are in sync. Let me know if you see a specific problem.
from python-iptables.
Hi @ldx, here is what happens if I try to launch your script:
-> % python2.7
Python 2.7.4 (default, Apr 19 2013, 18:28:01)
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import iptc
>>> while True:
... chain_name = 'FORWARD'
... chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), chain_name)
... print chain.name
...
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/usr/local/lib/python2.7/dist-packages/iptc/ip4tc.py", line 1306, in __init__
self.refresh()
File "/usr/local/lib/python2.7/dist-packages/iptc/ip4tc.py", line 1342, in refresh
self.strerror()))
iptc.ip4tc.IPTCError: can't initialize filter: libiptc version error
>>>
I have installed with pip the last version of python-iptables
from python-iptables.
The error message suggests that you use an old version - can you remove your current install, clone from github, and use the current git HEAD? For me it's been stable for quite some time both on Ubuntu & Debian, and the test script works as expected as well.
from python-iptables.
No response for months - closing this ticket, feel free to reopen it if the problem still exists.
from python-iptables.
Related Issues (20)
- Does not support custom target HOT 1
- Target already registered when applying rule for both IPv4 and IPv6 for TPROXY HOT 3
- Double free on _Buffer destruction HOT 4
- Segmentation fault when create hashlimit match HOT 3
- iptables and iptables-legacy with Docker containers HOT 2
- Rules added via iptc - not found in iptables o/p HOT 5
- iptc has problem when working with syslog module.
- iptc.errors.XTablesError: can't find target response on iptc.easy.dump_table('filter', ipv6=False) and others
- Can't find target JOOL_SIIT when iptables for both ipv4 and ipv6 are used HOT 1
- A question please, not an issue
- cannot use protocol "all"
- Empty rule list returned on Rocky8 HOT 3
- ldconfig packaged in glibc-2.28 has a different out out than ldconfig in glibc-2.17
- Can I use python-iptables on Python 3.6? HOT 1
- Match_set invalid value b'ipset_name' HOT 8
- How to set match LOCAL HOT 4
- --random parameter not working with SNAT HOT 5
- is nftable not supported?
- can't dump rules
- Is it possible to create '! --dports' rule?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-iptables.