Comments (5)
Taking a look at this.
from go-iptables.
Ideally we switch List
to use the output of iptables-save
, which has a more stable output. Let's see if that breaks anything.
from go-iptables.
Really, we should move the whole library over to using iptables-save
...
from go-iptables.
More immediately, when using iptables
in standard (legacy) mode, iptables -S
returns the exact output that would result in a chain, e.g.
$ iptables -t filter -S foo1
-N foo1
-A foo1 -p tcp -m tcp --dport 1337 -j ACCEPT
However, when it is in nftables mode, the output includes the counters in iptables-save
format:
$ iptables -t filter -S foo1
-N foo1
[0:0] -A foo1 -p tcp -m tcp --dport 1337 -j ACCEPT
So we just have to detect that and work around.
from go-iptables.
FWIW, I just posted a fix for the counters upstream.
edit: Applied upstream, ed30b9311d2b ("nft: don't print rule counters unless verbose")
from go-iptables.
Related Issues (20)
- iptables 1.8.4 (nf_tables) - Test Failures
- [BUG] Prepending iptables path to list of args in `runWithOutput` makes some methods fail unexpectedly HOT 2
- StructuredStats fails to parse negated source/dest CIDRs HOT 1
- When used as a module, does it still require iptables in PATH? HOT 3
- iptablesHasCheckCommand wrong version check when iptables version is v1.4.21 HOT 2
- tryLock() should return an error if it fails to acquire a lock
- hostnames not supported? HOT 1
- can you check this pull request for enabling the use of environment variables
- Cannot parse negated CIDR ex: "!192.168.122.0/24" HOT 1
- nftables support HOT 1
- How get --line-numbers ?
- Exists() method returns false for existing rule. HOT 1
- CAP_NET_ADMIN capability ? HOT 1
- --wait can not set timeout on 1.4.21 HOT 2
- I should how to insert rules with go-iptables HOT 1
- Panic: when target is empty
- Redirection for already established TCP connection
- BUILD file not found in directory 'iptables' of external repository HOT 1
- Add `GetRuleById()` function HOT 1
- Add `DeleteById()` function HOT 1
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 go-iptables.