Share & learn

Through Innovative Digital Library

How to add New network in running docker container.

We have upcoming network requirement to add series IP address. Could you please suggest how to add them into running container.


Posted by Alex on February 3rd 2018 23:31 PM

Writing below steps for your considerations. Step 1: We presumed container is running with bridge IP so need to extract IP informtaion. Step 2: You can use network connect command with ip address and bridge name to add new IP to container Step 3: Afterwards please run docker inspect command to check if new IP address has been added with new bridge as expected. Step 4: Now you can disconnect the existing bridge but please carefull it might have adverse impact on running container.

# docker container inspect --format="{{.NetworkSettings.Networks.bridge.IPAddress}}" newname

# docker network connect --ip= newbridge newname

# docker container inspect --format="{{.NetworkSettings.Networks.newbridge.IPAddress}}" newname

# docker network disconnect bridge newname
Answer Question

Your email address will not be published. Required fields are marked *

  • Minimum 20 character

related questions

Most liked questions

Most answered questions

1UG5 Refresh
1UG5 Refresh
Forgot password
Ask a Question
Minimum 20 character
Minimum 20 character
Minimum 20 character
1UG5 Refresh