Docker Community Forums

Share and learn in the Docker community.

How to set gateway for container


(Ipeacocks) #1

Is it possible to set gateway for container?

In container I am trying to set it but w/o success:

root@727346abe539:/# route del default gw 192.168.1.2
SIOCDELRT: Operation not permitted

root@727346abe539:/# route add default 192.168.1.1
SIOCADDRT: Operation not permitted

Thanks.


(Andy Rothfusz) #2

Iā€™m not sure how to do this on a container-by-container basis, but you can set some related parameters on the daemon using --bip (see ā€œCustomizing docker0ā€)