Basically, at work I have a dhcp address assigned as:
eth0 Link encap:Ethernet HWaddr 5c:26:0a:5a:b8:48
inet addr:10.10.10.193 Bcast:10.10.10.255 Mask:255.255.255.0
inet6 addr: <addr here>/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3591236 errors:0 dropped:0 overruns:0 frame:0
TX packets:2057576 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3449424352 (3.4 GB) TX bytes:384131635 (384.1 MB)
Interrupt:20 Memory:e2e00000-e2e20000
and with this, my host, can connect to the internet just fine. But none of my docker machines can connect to the internet at work. Their configuration looks like this:
docker0 Link encap:Ethernet HWaddr 56:84:7a:fe:97:99
inet addr:172.17.42.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet6 addr: fe80::5484:7aff:fefe:9799/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:117799 errors:0 dropped:0 overruns:0 frame:0
TX packets:170586 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4858816 (4.8 MB) TX bytes:122237788 (122.2 MB)
Everything works when I'm at home sitting beneath a traditional 192.168 router switch.
So, I'm thinking, if I somehow get docker0 interface to sit natted behind eth0, then everything would work, both at home and at work. But I'm not familiar with configuring linux interfaces. I found an article that talked about almost the exact same problem, but changing following those commands to add interface br0 to 10.10.10.200/24 made the following symptoms arise:
- My host no longer can resolve a domain name. Removing the interface br0 made this immediately work again
- The dockerized apps can now ping 4.2.2.1, but not 8.8.8.8 or 8.8.4.4 or resolve a domain name. Adding --dns 4.2.2.1 tp DOCKER_OPTS in /etc/default/docker.io does not solve the problem.
- The dockerized apps no longer can ping 4.2.2.1 or 8.8.8.8 or 8.8.4.4 after the br0 interface is removed
I haven't changed iptables; it's using the default docker configuration changes for a basic ubuntu 14.04 host.
How do I best configure the interfaces in order that docker allow the dockerized applications to connect to the internet both at home and work?