p8952 / bocker

Docker implemented in around 100 lines of bash
https://www.p8952.info/
GNU General Public License v3.0
11.29k stars 718 forks source link

Setup bridge0 and iptables automatically #24

Open wking opened 9 years ago

wking commented 9 years ago

If bridge0 doesn't exist, automatically create it, enable IPv4 forwarding, and setup a minimal MASQUERADE rule so the containers can access the external network. Details in the individual commit messages.

This grows the script by 7 lines (to 124 lines), but allowing most users to not bother using brctl and iptables is probably worth it ;).

Fusion commented 9 years ago

wking, do you think this should be merged with 'bocker route' in https://github.com/p8952/bocker/pull/23? The idea would be to allow the user to leave existing network configuration undisturbed if necessary.

wking commented 9 years ago

On Thu, Aug 20, 2015 at 05:48:04PM -0700, Chris F Ravenscroft wrote:

wking, do you think this should be merged with 'bocker route' in https://github.com/p8952/bocker/pull/23? The idea would be to allow the user to leave existing network configuration undisturbed if necessary.

This PR shouldn't be doing anything different if bridge0 already exists 1. So I think it does leave any existing network configuration undisturbed. Well, it will enable IPv4 forwarding, but that was a README requirement anyway ;).

For rebasing onto #23, I'm happy to do that if #23 lands first, but the changes in my PR are small enough that it shouldn't be too hard to rebase #23 if this lands first. If you see some other gain to integrating the branches ahead of time, let me know. But keeping them small and orthogonal will probably make reviewing easier for @p8952 ;).