首页 > 其他分享 >mptcp inside lxc container can't access /proc/sys/net/mptcp_enabled

mptcp inside lxc container can't access /proc/sys/net/mptcp_enabled

时间:2024-06-12 23:22:03浏览次数:14  
标签:container mptcp image sys volatile net docker

https://github.com/multipath-tcp/mptcp/issues/470

 

VenkateswaranJ commented on Mar 20, 2022 •  edited 

Hi,

I have created an lxc container (ubuntu 20.04) with privileged mode and my host machine has mptcp kernel installed ubuntu 20.04. For some reason, I don't see the file /proc/sys/net/mptcp_enabled inside the container. I can access the file on my host machine without issue.

Please take a look at my container config

probe2@probe2:~/Documents$ lxc config show panel1
architecture: x86_64
config:
  image.architecture: amd64
  image.description: ubuntu 20.04 LTS amd64 (release) (20220308)
  image.label: release
  image.os: ubuntu
  image.release: focal
  image.serial: "20220308"
  image.type: squashfs
  image.version: "20.04"
  raw.lxc: lxc.mount.auto=proc:rw sys:rw
  security.privileged: "true"
  volatile.base_image: 06460ff79260729ba686608f11eb3d6eff26a72449dfd71e9d22a42f0038b897
  volatile.eth0.host_name: vethf910dc17
  volatile.eth0.hwaddr: 00:16:3e:a4:f0:d1
  volatile.eth1.host_name: veth9bdc9b62
  volatile.eth1.hwaddr: 00:16:3e:0c:23:43
  volatile.idmap.base: "0"
  volatile.idmap.current: '[]'
  volatile.idmap.next: '[]'
  volatile.last_state.idmap: '[]'
  volatile.last_state.power: RUNNING
  volatile.uuid: ce94e0de-fd47-4187-9527-48d700ef3b07
devices: {}
ephemeral: false
profiles:
- panel-1
stateful: false
description: ""
 

You can see that I even mapped the sys and proc files in the config

raw.lxc: lxc.mount.auto=proc:rw sys:rw
security.privileged: "true"
 

I even tried with Docker but experienced the same problem.

docker run -d --sysctl net.mptcp.mptcp_enabled=1 --name=loki -p 3100:3100 grafana/loki

75dcbdc65a1539ce734a413cb6e23bf216aea76f6533c52280d3e866270424b9
docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: write sysctl key net.mptcp.mptcp_enabled: open /proc/sys/net/mptcp/mptcp_enabled: no such file or directory: unknown.

 
 
  @matttbe   Member matttbe commented on Mar 21, 2022

Hi,

mptcp_enabled (and most/all MPTCP sysctl) are global for all net namespaces. It means that you can only read and write values from the "main" net namespace and this will affect all netns.

I guess you can still mount /proc/sys/net/mptcp in a different directory in your container to be able to read/change values. (not sure it is recommended but well :) )

 
@vandit86     vandit86 commented on Mar 22, 2022

mptcp_net-next (mptcpv1) allows per namespace configuration..

 
  @VenkateswaranJ VenkateswaranJ closed this as completed on Mar 26, 2022   @VenkateswaranJ   Author VenkateswaranJ commented on Mar 27, 2022

This might not be related to mptcp but I'm asking it here as you guys have expertise in the Linux net.

mptcp

As you can see in the above image I have a Debian based docker container that is connected to two networks. So there are two bridges configured in my host and they get connected to the docker network namespace via veth links. I'm running a small program inside a docker container that detect IP change via rtnetlink.

So now my task is to consider the bridge like a virtual switch and if I bring down the bridge interface in my host machine I expect the veth link between my host and docker to go down and the program (rtnetlink) inside my docker container detects this link down event. But unfortunately, nothing happens, even the IP address of both bridge and docker interface not removed.

Maybe my understanding of veth links are wrong (I thought it react similarly to pulling out lan cable from the physical switch

标签:container,mptcp,image,sys,volatile,net,docker
From: https://www.cnblogs.com/ztguang/p/18244934

相关文章

  • D-Bus——system bus调用机制
            在D-Bus中,系统总线(systembus)和会话总线(sessionbus)的工作方式有所不同。会话总线主要依赖环境变量来找到总线地址,而系统总线则依赖于标准的系统路径和配置。系统总线的服务查找机制系统总线的启动:        系统总线守护进程(dbus-daemon--syste......
  • MPTCP is missing from system parameters inside Mininet hosts
    https://github.com/mininet/mininet/issues/1161 Hello,Iamhavingproblemswithcertainsystemparametersnotbeingaccessiblefrom within a Mininet hosteventhoughtheyareaccessiblefromthehostsystem.Afteracleaninstallwiththefollowing:U......
  • 栈溢出漏洞利用二,ret2syscall,构造rop链条实现攻击(pwn入门)
    原理原理就直接参考别的大佬写的文章讲下了 参考文章:https://blog.csdn.net/qq_33948522/article/details/93880812ret2syscall,即控制程序执行系统调用,获取shellret2syscall通常采用execve(重点函数,32位调用号为0x0b,64位调用号为0x3b)ROPReturnOrientedProgramming,其......
  • [转]Systemd 入门教程:命令篇
    原文地址:Systemd入门教程:命令篇-阮一峰的网络日志Systemd是Linux系统工具,用来启动守护进程,已成为大多数发行版的标准配置。本文介绍它的基本用法,分为上下两篇。今天介绍它的主要命令,下一篇介绍如何用于实战。一、由来历史上,Linux的启动一直采用init进程。下面的命令......
  • 【Python】一文向您详细介绍 sys.argv
    【Python】一文向您详细介绍sys.argv 下滑即可查看博客内容......
  • FlinkSQL 运行官网的 filesystem SQL 连接器例子出错:Cannot discover a connector usi
    我的例子程序是仿照官网例子写的:我的程序:packagecom.xxx.demo;importorg.apache.flink.streaming.api.datastream.DataStream;importorg.apache.flink.streaming.api.environment.StreamExecutionEnvironment;importorg.apache.flink.table.api.bridge.java.StreamTabl......
  • 《Optimizing the LINPACK Algorithm for Large-Scale PCIe-Based CPU-GPU Heterogene
    论文标题《OptimizingtheLINPACKAlgorithmforLarge-ScalePCIe-BasedCPU-GPUHeterogeneousSystems》为基于PCIe的大规模CPU-GPU异构系统优化LINPACK算法作者GuangmingTan、ChaoyangShui、YinshanWang、XianzhiYu和YujinYan来自中科院计算所初读摘要......
  • 聊聊如何利用Testcontainers进行集成测试
    前言1、何为Testcontainers?Testcontainers是一个库,它为引导本地开发和测试依赖关系提供了简单而轻量级的API,并将真实的服务封装在Docker容器中。使用Testcontainers,您可以编写依赖于您在生产中使用的相同服务的测试,而不需要mock或内存服务。用比较直白的话就是testcontainers......
  • INFINI Labs 产品更新 | Easysearch 1.8.2 发布优化 CCR 性能
    INFINILabs产品又更新啦~,包括Easysearchv1.8.0、Gateway、Console、Agent、Loadgenv1.25.0。本次各产品更新了很多亮点功能,如Easysearch新增数据写入限流功能,可实现节点、分片级限流;Gateway修复数据迁移过程中因消费不及时解压缩导致部分数据记录损坏而丢失记录问题,进一......
  • 搭建verilog/systemverilog学习环境
    目录仿真软件选择使用iverilog的基本步骤仿真软件选择学习verilog或者systemverilog过程中,使用那种仿真软件?当然最好是使用synopsys的vcs+verdi的组合,功能强大,而且大部分公司也使用synopsys的eda软件,如果熟练掌握vcs+verdi对以后工作中使用它们也是有很大帮助。但是这两个软件......