-
Notifications
You must be signed in to change notification settings - Fork 83
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
Filtering Connections with iptables requires root? #265
Comments
modprobe iptable_filter (requires real root) |
I am trying to understand the filtering connections section. My goal from a container perspective is to enable host loopback so my container can communicate to the host. So for that I need iptable rules, and I am trying to understand a few things: Do I need root => seems yes. Trying to understand where the iptables rules can be executed. I have tried this:
If there is a way to do this, which I am hoping there is. Also thanks for the help so far @AkihiroSuda! |
You don't need root after modprobbing |
I see, I misunderstood you were telling me to unload the iptable_filter module. I tried doing this, and seems I am still seeing an issue. I can't modprobe iptable_filter due to:
So I tried a few methods, but this one worked:
On next startup:
Another verification:
Now the test:
Seems I am still seeing a permission denied error. Let me know what else I can try. Is it possible to create the iptable rule for my user network namespace with root? |
Just as a comparison, I can get that example to work on kernel 5.4.0 with iptables 1.8.4 with one modification; running |
Well I tried upgrading to 1.8.4 iptables on Ubuntu 18.04, 4.9.140 and still see an issue:
Even though on the host I don't even have
|
If you can't even run sudo iptables on the host, your issue is not relevant to this repo. |
@AkihiroSuda I can run iptables on the host with sudo. Right now the only way I can run iptables is on the host with sudo. By updating my iptables to 1.8.4 I also see the I attempted multiple versions of iptables just as a sanity check. 1.6.2/1.8.2/1.8.4 |
Hello. I came here looking for a solution to filter outgoing connections from within a rootless podman container. @AkihiroSuda You say that:
I can't follow. The modules are loaded on the host. But I need root even on the host for simple iptables commands:
Naturally the same commands fails from within the container as well. What am I missing on my system? |
You need this, with |
I have followed the example:
https://github.com/rootless-containers/slirp4netns/blob/master/slirp4netns.1.md#example
Terminal 1:
Terminal 2:
Terminal 1:
But then when I add a new step, I get a permission denied error when attempting to setup Filtering connections with iptables.
Terminal 3:
So here is my error in the namespace:
Is this a kernel issue? Or is something else wrong?
The text was updated successfully, but these errors were encountered: