greenpau / cni-plugins

CNI Plugins compatible with nftables
Apache License 2.0
48 stars 13 forks source link

Сannot find module #16

Closed AlekseyMelikov closed 2 years ago

AlekseyMelikov commented 3 years ago

Hi. I am trying to install, but I get an

# go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap
go: downloading github.com/greenpau/cni-plugins v1.0.10
go: downloading github.com/containernetworking/cni v0.8.1
go: downloading github.com/greenpau/versioned v1.0.24
go: downloading github.com/google/nftables v0.0.0-20201230142148-715e31cb3c31
go: downloading github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae
go: downloading golang.org/x/sys v0.0.0-20210616094352-59db8d763f22
go: downloading github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f
go: downloading github.com/containernetworking/cni v1.0.0
go: downloading github.com/greenpau/versioned v1.0.26
go: downloading github.com/google/nftables v0.0.0-20210818072602-d553cd2d411d
go: downloading github.com/mdlayher/netlink v1.4.0
go: downloading golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf
go: downloading github.com/mdlayher/netlink v1.4.1
go: downloading github.com/josharian/native v0.0.0-20200817173448-b6b71def0850
go: downloading github.com/google/go-cmp v0.5.4
go: downloading golang.org/x/net v0.0.0-20210614182718-04defd469f4e
go: downloading github.com/google/go-cmp v0.5.6
go: downloading github.com/koneu/natend v0.0.0-20150829182554-ec0926ea948d
go: downloading golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d
go: downloading github.com/mdlayher/socket v0.0.0-20210307095302-262dc9984e00
go: downloading github.com/mdlayher/socket v0.0.0-20210624160740-9dbe287ded84
github.com/greenpau/cni-plugins/cmd/cni-nftables-portmap imports
    github.com/greenpau/cni-plugins/pkg/portmap imports
    github.com/containernetworking/cni/pkg/types/current: cannot find module providing package github.com/containernetworking/cni/pkg/types/current

# go get -u github.com/greenpau/cni-plugins/cmd/cni-nftables-firewall
github.com/greenpau/cni-plugins/cmd/cni-nftables-firewall imports
    github.com/greenpau/cni-plugins/pkg/firewall imports
    github.com/containernetworking/cni/pkg/types/current: cannot find module providing package github.com/containernetworking/cni/pkg/types/current

go version

go1.17 linux/amd64
AlekseyMelikov commented 3 years ago

Ok. I have successfully installed plugins via

# git clone https://github.com/greenpau/cni-plugins.git
# cd cni-plugins && make
# mv $(pwd)/bin/cni-nftables-{portmap,firewall} /usr/local/lib/cni/

And one more question, if possible.

I am also using Docker on the same host which adds rules to Nftables. Docker rules are named in uppercase. CNI plugins rules are named in lower case. Because of this, chains such as input, prerouting, output and etc. duplicated.

Is it possible to configure CNI plugins so that they also add uppercase rules?

greenpau commented 3 years ago

Is it possible to configure CNI plugins so that they also add uppercase rules?

@AlekseyMelikov , not at the moment.

thefiredragon commented 3 years ago

After build and copy and replace I run into this issues:

podman start ID

root@docker:~# iptables -L -n -v
free(): double free detected in tcache 2
Aborted
root@docker:~#

root@docker:~# podman network ls
NAME    VERSION  PLUGINS
podman  0.4.0    bridge,cni-nftables-portmap,cni-nftables-firewall

Build and running latest version of debian-bullseye

any suggestions?

AlekseyMelikov commented 3 years ago

After build and copy and replace I run into this issues:

podman start ID

root@docker:~# iptables -L -n -v
free(): double free detected in tcache 2
Aborted
root@docker:~#

root@docker:~# podman network ls
NAME    VERSION  PLUGINS
podman  0.4.0    bridge,cni-nftables-portmap,cni-nftables-firewall

Build and running latest version of debian-bullseye

any suggestions?

What shows nft list ruleset ?

greenpau commented 2 years ago

It is now resolved.