NICMx / Jool

SIIT and NAT64 for Linux
GNU General Public License v2.0
320 stars 66 forks source link

running jool in container get Couldn't load target 'JOOL' #308

Closed GeorgeGuo2018 closed 4 years ago

GeorgeGuo2018 commented 4 years ago

Hi, there. i compiled jool on a host with centos7.6.1810, kernel version:3.1.0-957,and get relevant ko files: jool.ko jool_common.ko jool_siit.ko , besides those ko files,i also get those files for which i think should belong to the client of jool: three binary files which are jool, joold and jool_siit in /usr/locl/bin and the library files in /usr/local/lib/jool

Next i want to insmod jool to a host with kernel 3.1.0-957, but all those operation is done in a container running on this host. The following is how i did.

I copied the jool-client files(the binary and the library files) into the container and also installed libnl3 in the container, then the jool commands work well now.

after that, i copied the three ko files into the container,and placed them in the filepath:/lib/modules/3.10.0-957.1.3.el7.x86_64(i mounted /lib/modules director of the host to the container), and then exec: modprobe jool, after that it seems that jool already insmod into kernel of the host, and i exec: jool instance display, the output seems ok.

but when i exec ip6tables -t mangle -A PREROUTING --destination 2001:db8:: -j JOOL, i get the feedback:ip6tables v1.4.21: Couldn't load target `JOOL':No such file or directory

I checked the chain of mangle table on both the host and the container, did not find a chain named JOOL in the mangle table.

I guess maybe i missed somethins while modprobe jool into the kernel of host. but i tried install iptables-devel ,then rmmod jool and modprobe jool again, all does not work .

Can somebody offer me some suggestion? Thanks a lot

GeorgeGuo2018 commented 4 years ago

I figured the problem. Just need to find libxt_JOOL.so and libxt_JOOLSIIT.so in /usr/lib64/xtables on the host, and copy them into to the container, place in the same path.

But i was wandering, is there any other .so files should I also copy into the container, as there exit a lot of other userspace Tools besides iptables according to the describetion of /usr/README.md

ydahhrk commented 4 years ago

That's all the userspace binaries, as of now.

But why are you copying everything manually? If you already compiled on the host (configure && make), you should be able to install in the container normally (make install), and it should do the right thing without any tinkering as far as I know. (Assuming the architecture is the same and stuff.)

(BTW: The documentation currently states that it's only two kernel modules, which is wrong. Will fix shortly; thanks for the heads up.)

ydahhrk commented 4 years ago

New binary list:

https://nicmx.github.io/Jool/en/install.html#introduction (Might need F5)

GeorgeGuo2018 commented 4 years ago

New binary list:

https://nicmx.github.io/Jool/en/install.html#introduction (Might need F5)

Thanks for your reply. The reason why I copied those .ko files and .so files into containers manually is because I want to minimize the size of images built from the dockerfile. All the steps including the copy operations are defined in my dockerfile.

Did you mean that after compiled the source codes of Jool on the host (configure && make), I can copy the whole source files into the container, and run the last step in the container(make install)?

Will try, thanks a lot.

ydahhrk commented 4 years ago

If you're that concerned about size, then I suppose copying is fair.

The make install target adds some symlinks, the manpages and the bash autocompletion scripts.