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

Access own host #101

Open
romikforest opened this issue May 7, 2023 · 7 comments
Open

Access own host #101

romikforest opened this issue May 7, 2023 · 7 comments

Comments

@romikforest
Copy link

romikforest commented May 7, 2023

Hi. It works almost like I want and as you said. I have only two issues. May be something else has changed in iptables.

I can't access the host itself from the docker container. E.g. I can access it from other computer port 80 and 443. Also docker containers can access any address on the internet. But it's not possible to access the host from the docker containers by its ip or domain name (while ping works).

Also I can't access ipv6 network (from the host shell itself) while bought ipv6 support from my provider and seems like the host has ipv6 address and it isn't blocked anywhere. (May be some issue with iptables or provider's problem not related to ufw-docker. It would be nice to confirm if it's ok for others).

@JonathanMbt
Copy link

Hello, I actually encountered the same problem, ufw block every outgoing connection coming from a docker container and going to the same host. Is there a quick solution to this problem ?

@romikforest
Copy link
Author

You can add your host e.g. before COMMIT # BEGIN UFW AND DOCKER or somewhere or all the local network if you wish (less secure) like:

-A ufw-after-input --src 10.0.0.0/8 -j ACCEPT
-A ufw-after-input --src 172.16.0.0/12 -j ACCEPT
-A ufw-after-input --src 192.168.0.0/16 -j ACCEPT

I did this way.

@JonathanMbt
Copy link

Thank you ;)

@syamsarosa
Copy link

@romikforest it works. thanks.

@BlueTree242
Copy link

You can add your host e.g. before COMMIT # BEGIN UFW AND DOCKER or somewhere or all the local network if you wish (less secure) like:

-A ufw-after-input --src 10.0.0.0/8 -j ACCEPT
-A ufw-after-input --src 172.16.0.0/12 -j ACCEPT
-A ufw-after-input --src 192.168.0.0/16 -j ACCEPT

I did this way.

question, what makes this less secure?

@romikforest
Copy link
Author

question, what makes this less secure?

You have to trust your local network, it will have full access. So it's better to add a specific range of IP addresses that is used in your docker, for example, not all the local network.

@BlueTree242
Copy link

Oh, got it.

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