Docker Community Forums

Share and learn in the Docker community.

How do I change default networking options in Linux?

dockerhub

(Oldmansong) #1

I have a docker container on top of a vmware host.

It has that default subnet of 172.x.x.x

ip addr show docker0

3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue

state DOWN link/ether 02:42:22:ab:5a:e3 brd ff:ff:ff:ff:ff:ff inet 172.17.0.1/16 brd 172.17.255.255

scope global docker0 valid_lft forever preferred_lft forever

I need to change that to the subnet that matches my company. so I could test communication with my other company machines.

docker --version Docker version 17.12.0-ce, build c97c6d6

Is this file /etc/sysconfig/docker-network still valid ? or is it outdated

I follow an old youtube procedure:

I did the following:

systemctl stop docker.service

ip link set dev docker0 down

sysctl net.ipv4.conf.all.forwarding

vi /etc/sysconfig/docker-network

( to include the following)

DOCKER_NETWORK_OPTIONS=”–bip=128.222.110.244/24 --default-gateway=128.222.110.1 --dns=10.253.140.73”

iptables –t nat –F POSTROUTING

iptables –F DOCKER

systemctl start docker.service

somehow it seems like NOT Reading the DOCKER_NETWORK_OPTIONS

please help