https://github.com/juli3nk/go-netfilter
Go implentation for Iptables
https://github.com/juli3nk/go-netfilter
go golang iptables netfilter
Last synced: 5 months ago
JSON representation
Go implentation for Iptables
- Host: GitHub
- URL: https://github.com/juli3nk/go-netfilter
- Owner: juli3nk
- Created: 2016-04-28T03:37:47.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T14:29:22.000Z (about 6 years ago)
- Last Synced: 2024-06-20T16:41:07.720Z (about 2 years ago)
- Topics: go, golang, iptables, netfilter
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 17
- Watchers: 1
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Netfilter
## Example
```go
package main
import (
"fmt"
"os"
"github.com/juli3nk/go-netfilter/iptables"
)
func main() {
ipt, err := iptables.New(4, false)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
opts := iptables.ListOptions {
Chain: "OUTPUT",
Verbose: true,
Numeric: true,
LineNumbers: true,
}
rules, err := ipt.List("filter", &opts)
if err != nil {
fmt.Println(err)
os.Exit(1)
}
fmt.Println(rules)
}
```