Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAT iptables and AlmaLinux 9 #735

Open
Poueck opened this issue Jan 30, 2023 · 8 comments
Open

NAT iptables and AlmaLinux 9 #735

Poueck opened this issue Jan 30, 2023 · 8 comments

Comments

@Poueck
Copy link

Poueck commented Jan 30, 2023

NAT functionnality doesn't work on AlmaLinux 9 (kernel 5.14.0-162.12.1.el9_1.x86_64):

openvpn      | iptables v1.8.4 (legacy): can't initialize iptables table 'nat': Table does not exist (do you need to insmod?)
openvpn      | Perhaps iptables or your kernel needs to be upgraded.

On the host, iptables v1.8.8

# iptables -V
iptables v1.8.8 (nf_tables)
# rpm -qa iptables*
iptables-libs-1.8.8-4.el9.x86_64
iptables-nft-1.8.8-4.el9.x86_64
@Poueck
Copy link
Author

Poueck commented Jan 30, 2023

It appears that iptables links are set to legacy instead of nft.

I updated the ovpn_run script with "iptables-nft" instead of "iptables" and it is working.

@Traxof63
Copy link

Hello, I've the same issue, but when I set "iptables-nft" instead of "iptables"
This error occurs :
iptables: Failed to initialize nft: Protocol not supported

@Poueck
Copy link
Author

Poueck commented Jan 30, 2023

Hello, I've the same issue, but when I set "iptables-nft" instead of "iptables" This error occurs : iptables: Failed to initialize nft: Protocol not supported

Does iptables installed on the host ?

@Traxof63
Copy link

yes

@Poueck
Copy link
Author

Poueck commented Jan 30, 2023

yes

And the container have the --cap-add=NET_ADMIN ?

@Traxof63
Copy link

Yes, I use the recommended docker-compose file, and on the host, iptables is in nft mode....

@GunoH
Copy link

GunoH commented Jun 27, 2024

Had the same issue, when using the public kylemanna/openvpn image in my compose file (as instructed in docs/docker-compose.md).

However, when building the image myself from the master branch (1228577), the issue is gone. Maybe some fixes did not go into the public image yet.

@igor-iiplabs
Copy link

Same issue as well, and also resolved by rebuilding the image from Dockerfile

services:
openvpn:
build:
context: ./
dockerfile: Dockerfile
image: local/openvpn

Then just run "docker compose build openvpn"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants