I'm trying to reconfigure some network kernel settings at /proc/sys/net/core in my container. But it seems some options are missing in docker ubuntu:14.04 so that i can't configure them. example:

$ sysctl -w net.core.rmem_max=262144
sysctl: cannot stat /proc/sys/net/core/rmem_max: No such file or directory

There're just a few options in my docker:

In my Host's Ubuntu:

$ ls /proc/sys/net/core/
bpf_jit_enable         message_burst           rmem_default           xfrm_acq_expires
busy_poll              message_cost            rmem_max               xfrm_aevent_etime
busy_read              netdev_budget           rps_sock_flow_entries  xfrm_aevent_rseqth
default_qdisc          netdev_max_backlog      somaxconn              xfrm_larval_drop
dev_weight             netdev_rss_key          warnings
flow_limit_cpu_bitmap  netdev_tstamp_prequeue  wmem_default
flow_limit_table_len   optmem_max              wmem_max

In my docker's Ubuntu:

$ ls /proc/sys/net/core/
somaxconn  xfrm_acq_expires  xfrm_aevent_etime  xfrm_aevent_rseqth  xfrm_larval_drop

I attempted to run docker with --net=none/default (I don't wanna use host) or --v /proc/sys/net:/proc/sys/net but nothing changes.

I read this from kernel.org: "/proc/sys/net ... You may see only some of them, depending on your kernel's configuration."

So is there any way to get fully options?



Those files represent configuration of your host network stack, without --net=host you create a new network stack inside a container and files are 'overwritten' by container ones.

If you need access to host stack you might consider mounting it somewhere else, lets say /net using -v /proc/sys/net/:/net and then simply use echo value > /net/my/file instead of using sysctl.

  • I mounted as you suggested but the files in /net/core are still the same with /proc/sys/net/core in the container other than the host. Furthermore, I want to change setting of NIC of container but not host's NIC. because I am trying to install a package that requires to change those files on container.
    – asker
    Sep 12 '15 at 17:51
  • Remeber that you have only a virtual link inside a container, not a physical one. Most probably by modifying host NIC you will have expected behaviour inside container ( I am not sure about it though ).
    – Łukasz
    Sep 12 '15 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.