Bridge network missing Gateway – Docker Issue
Here is a little something for you. I’m working on building a demo of Oracle GoldenGate Microservices between three (3) containers. In order to do this, I wanted to setup a dedicated network between the containers.
In order to setup a dedicated network, I needed to configure a network for the containers to use. Docker makes this quite easy with he usage of docker network create (here).
Before creating my network, by using docker network ls I can quickly see what networks have been defined on my local machine:
bocurtis-Mac:GG19c bocurtis$ docker network ls
NETWORK ID NAME DRIVER SCOPE
c9af13c37029 bridge bridge local
0a9b2554201f host host local
6686aa820e6d none null local
Although the bridge network is there, this network only allows you to reference containers by their IP address. Not a fun thing to remember. By creating my own bridge network, I can then specify that containers by name. Which will make my life a lot easier.
To create my network, I ran the following command:
bocurtis$ docker network create --driver=bridge --subnet=192.168.0.0/16 GoldenGateNet
After creating the network, make sure the network is now in the list of avaliable networks:
bocurtis-Mac:GG19c bocurtis$ docker network ls
NETWORK ID NAME DRIVER SCOPE
5a6a703615ee GoldenGateNet bridge local
c9af13c37029 bridge bridge local
0a9b2554201f host host local
6686aa820e6d none null local
Afterwards, I did an docker inspect on the network to make sure everything was configured as I expected:
bocurtis-Mac:GG19c bocurtis$ docker inspect network GoldenGateNet
[
{
"Name": "GoldenGateNet",
"Id": "49a28b4c03552237363cf1ddd8e2e0eecab66e898785f36b8c21270487899052",
"Created": "2019-11-03T17:33:29.398023638Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "192.168.0.0/16"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {},
"Labels": {}
}
]
Something to notice here, besides the text formatting fo the JSON. That is the Config only has a subnet listed and there is no gateway. This is a big problem because you can route between boxes, but not to the internet. So do we fix this?
You can always drop the network and recreate the network and provide the —gateway option; however, before doing that, simply restart the docker daemon. When you go to restart the daemon, on Mac anyways, you will be prompted. Say OK to have the daemon restart.
One the docker daemon is restarted, then you can do a docker inspect network again. This time the configuration should be correct and have a gateway for the network.
bocurtis-Mac:GG19c bocurtis$ docker inspect network GoldenGateNet
[
{
"Name": "GoldenGateNet",
"Id": "49a28b4c03552237363cf1ddd8e2e0eecab66e898785f36b8c21270487899052",
"Created": "2019-11-03T17:33:29.398023638Z",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": {},
"Config": [
{
"Subnet": "192.168.0.0/16",
"Gateway": "192.168.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {},
"Options": {},
"Labels": {}
}
]
Now, just attach your container to the network and ensure that you have access to the internet and between containers.
Enjoy and God bless!!!
Bobby Curtis
I’m Bobby Curtis and I’m just your normal average guy who has been working in the technology field for awhile (started when I was 18 with the US Army). The goal of this blog has changed a bit over the years. Initially, it was a general blog where I wrote thoughts down. Then it changed to focus on the Oracle Database, Oracle Enterprise Manager, and eventually Oracle GoldenGate.
If you want to follow me on a more timely manner, I can be followed on twitter at @dbasolved or on LinkedIn under “Bobby Curtis MBA”.
Thanks for sharing such a fastidious idea,
paragraph is good, thats why i have read it fully
My web site: eharmony special coupon code 2025
I am curious to find out what blog system you happen to be using?
I’m experiencing some minor security issues with my
latest blog and I would like to find something more
risk-free. Do you have any recommendations?
My webpage; vpn
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.
Spot on with this write-up, I absolutely believe that this amazing
site needs a great deal more attention. I’ll probably be
back again to read more, thanks for the advice! https://tinyurl.com/28555853 gamefly 3 month free trial
When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is
added I get three emails with the same comment. Is there any way you can remove
people from that service? Thanks! https://tinyurl.com/2bm4xgrn what is a vpn meaning
My relatives all the time say that I am wasting my
time here at web, but I know I am getting know-how everyday by reading such pleasant articles or reviews.
Hey I know this is off topic but I was wondering if you knew of any widgets I could add to my blog that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time and was hoping maybe you
would have some experience with something like this.
Please let me know if you run into anything. I
truly enjoy reading your blog and I look forward to your new updates.
Good day! This post couldn’t be written any better!
Reading through this post reminds me of my previous rookm
mate! He always kept talkinng aabout this. I will forward this
write-up to him. Pretty sure he will have a good read. Many thanks
for sharing! https://Fortune-Glassi.Mystrikingly.com/
Way cool! Some extremely valid points! I appreciate you writing this article and the rest oof the site is extremely good. https://lr-mediconsult.de/Unternehmen/tonebet-casino/
Your point of view caught my eye and was very interesting. Thanks. I have a question for you.