File tree Expand file tree Collapse file tree
docs/reference/commandline Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,26 @@ being connected to.
6565$ docker network connect --alias db --alias mysql multi-host-network container2
6666```
6767
68+ ### <a name =" sysctl " ></a > Set sysctls for a container's interface (--driver-opt)
69+
70+ ` sysctl ` settings that start with ` net.ipv4. ` and ` net.ipv6. ` can be set per-interface
71+ using ` --driver-opt ` label ` com.docker.network.endpoint.sysctls ` . The name of the
72+ interface must be replaced by ` IFNAME ` .
73+
74+ To set more than one ` sysctl ` for an interface, quote the whole value of the
75+ ` driver-opt ` field, remembering to escape the quotes for the shell if necessary.
76+ For example, if the interface to ` my-net ` is given name ` eth3 ` , the following example
77+ sets ` net.ipv4.conf.eth3.log_martians=1 ` and ` net.ipv4.conf.eth3.forwarding=0 ` .
78+
79+ ``` console
80+ $ docker network connect --driver-opt=\" com.docker.network.endpoint.sysctls=net.ipv4.conf.IFNAME.log_martians=1,net.ipv4.conf.IFNAME.forwarding=0\" multi-host-network container2
81+ ```
82+
83+ > ** Note**
84+ >
85+ > Network drivers may restrict the sysctl settings that can be modified and, to protect
86+ > the operation of the network, new restrictions may be added in the future.
87+
6888### Network implications of stopping, pausing, or restarting containers
6989
7090You can pause, restart, and stop containers that are connected to a network.
You can’t perform that action at this time.
0 commit comments