Questions tagged [network-namespaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
28 views

How do I start a Docker container in custom network namespace?

How do I make docker run to setns to the network namespace of my choice when starting a container? I want something like --net host mode, but aiming to the namespace of Docker server itself. Or should ...
user avatar
  • 5,126
2 votes
0 answers
28 views

Docker overlay network connection between containers lags simetimesin multiples of 1s

Two containers talking to each other on overlay network with high traffic (connection frequency) occasionally got connection lag almost exact multiple of 1s. It doesn't matter whether it is same host ...
user avatar
  • 1,583
0 votes
1 answer
52 views

How can I copy $BASHPID in bash script?

I have a network namespace and I want to run command with this netns bash pid, how can I do it in bash script? Code example: sudo ip netns add ns1 #this is my network namespace #In separate shell I ...
user avatar
  • 3
0 votes
1 answer
96 views

How to connect Linux network namespace with other VM using internal network?

I have two Virtual Machnes (VM) in Virtualbox connected with internal network. On the first one I have network namespace named n0. I want to connect this namespace to network interface and finally ...
user avatar
  • 3
2 votes
1 answer
62 views

Capture DNS traffic to and from a network namespace using tshark

How can I capture traffic specifically from a network interface inside a network namespace using tshark? In my case, the network interface tun0 is moved into the network namespace called vpn. Normally ...
user avatar
0 votes
0 answers
23 views

Runing libreoffice from network namespace session?

I am using Ubuntu Mate: $ echo $DESKTOP_SESSION; cat /etc/issue; uname -a; mate Ubuntu 20.04.4 LTS \n \l Linux mypc 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:41 UTC 2022 x86_64 x86_64 x86_64 ...
user avatar
  • 6,156
2 votes
1 answer
85 views

IPv6 forwarding doesn't work in a network namespace

I have 3 Linux VMs connected like this: / server1 \ | ens19 2001:1::2 | \ / | / \ | ens19 2001:1::1 | | ...
user avatar
  • 23
0 votes
1 answer
47 views

Can't access directory from netns

I created a simple test netns : sudo ip netns add test Then I brought up the lo interface. I'm currently in the home directory of user1, and by executing sudo ip netns exec test ls -la I see all the ...
user avatar
  • 1
2 votes
2 answers
45 views

Is cgroup a type of namespace?

Is cgroup a type of namespace? I am asking this because I have seen blogs talking as if cgroup and namespaces are different. However, in different linux commands , cgroup is considered as a type of ...
user avatar
  • 1,201
1 vote
1 answer
79 views

How can I use a bind mount in a network namespace?

I have an app I run in a network namespace. This works well. I want to run the app multiple times, in different namespaces. For convenience, I want to bind mount the app's working directory to ...
user avatar
  • 165
0 votes
0 answers
109 views

Bridging between network namespaces using tun or tap devices

I am trying to create two tap interfaces which are connected via a userspace program which should be able to see (and later modify) all packets going over the "wire". While this works when I ...
user avatar
-1 votes
1 answer
154 views

To persist a namespace, create a bind mount point on which /proc/PID?

From https://man7.org/linux/man-pages/man1/n.1.html : By default, a new namespace remains in existence only as long as it has at least one member process. A namespace can be made persistent— that ...
user avatar
1 vote
1 answer
281 views

Can't establish communication between two network namespaces using bridge network

I'm following this video about network namespaces in Linux, and trying to practice it myself, but for some reason it doesn't work. What I've done is: After creating 2 network namespaces named "...
user avatar
  • 264
0 votes
0 answers
111 views

How to inspect linux network namespaces by nsid

I have some amount of phantom netns which are remained in the system after removing docker containers: # ip netns list-id nsid 0 nsid 1 nsid 2 nsid 3 nsid 4 nsid 5 nsid 6 nsid 7 nsid 8 nsid 9 ...
user avatar
  • 286
0 votes
1 answer
45 views

How to use VXLAN to connect netns under multiple subnets like K8S's Flannel?

I have used $ ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ group 239.1.1.1 \ dev enp0s8 and $ ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ ...
user avatar
  • 1
1 vote
1 answer
229 views

How to move interface into nonstandard network namespace as unprivileged user

I have a Linux network namespace bind mounted at ~/mynamespace as follows: unshare -mrn; touch ~/mynamespace; # executed in the console opened by the first command unshare --net=~/mynamespace true; # ...
user avatar
0 votes
1 answer
308 views

IP forwarding in linux namespaces

I am currently trying to simulate a network using network namespaces under Linux. I have already set up the nodes and connected them, and they can ping each other, one hop at a time. But I am really ...
user avatar
1 vote
1 answer
169 views

How to setup veth with 9000 MTU to simulate sending and receiving large UDP multicast packets on the same host?

The sender needs to transmit large data packets to the receiver (which is on the same host with 1500 MTU) and I think this can be simulated using veth with 9000 MTU, from my reading on it. But I'm not ...
user avatar
  • 13
0 votes
1 answer
157 views

ip netns exec cannot start ONLY mate-terminal and gnome-terminal?

I am using the newns script from here: https://superuser.com/questions/983727/route-only-specific-traffic-through-vpn ... except on this system: $ mate-about -v MATE Desktop Environment 1.24.0 $ cat /...
user avatar
  • 6,156
0 votes
0 answers
82 views

Connect namespace to internet using Second public ip address

I have an Ubuntu18 server with Two public addresses How can i create a namespace and connect to the internet through the second public ip? (need to launch a program and force it to use the second ip ...
user avatar
1 vote
1 answer
197 views

How to set up stateless NAT for two UDP connections from a global network to special network namespace?

There is the requirement to set up a stateless NAT for two UDP connections from a physical network adapter in global network namespace via a linked pair of virtual network adapters to a service ...
user avatar
  • 111
2 votes
1 answer
167 views

Network namespace & slirp4netns - access namespaced network from host

I create a network namespace using unshare --map-root-user --net --mount --keep-caps "do_stuff". I connect the namespace to the internet using slirp4netns --configure --mtu=65520 $ns-id tap0....
user avatar
  • 277
2 votes
1 answer
174 views

Network namespace doesn't work with vpn

I have created a network namespace (named ppn) to run certain application in it. This works perfectly but when my commercial VPN (based on OpenVPN) is also enabled it seems that the traffic is only ...
user avatar
2 votes
0 answers
818 views

Can systemd-networkd handle interfaces in network namespace?

I'm trying to configure systemd-networkd on an embedded system where wlan0 is in a separate network namespace. I'd like for systemd to configure and monitor the interaface so that related services ...
user avatar
3 votes
2 answers
608 views

How to share wireguard with namespace?

I have a wireguard connection (interface name wg0) to a trusted machine inside an admin network at $DAYJOB. Usually, I don't want to use wg0 for all my traffic, only for IP addresses in the 172.16.0.0/...
user avatar
  • 1,171
2 votes
1 answer
327 views

How to assign a name to the existing anonymous network namespace

I have a Linux process that creates a network namespace without registering it in /run/netns. The process has also own PID namespace. The network namespace does not have a name and I can see only id ...
user avatar
0 votes
1 answer
215 views

How can I access a local network namespace from an external node?

I am trying to set up a runc container running mongoDB Enterprise Edition v4.4 on an EC2 Ubuntu x86 20.04 node, kernel v5.10. I am using the following to set up a network namespace for the container: ...
user avatar
1 vote
2 answers
1k views

Pipe multiple commands to socat reverse shell (network-namespaced)

I have a bash script that: does some thing connects/opens a reverse shell. does another thing my-script contents: #!/usr/bin/env bash # does 'some thing' sudo /usr/bin/nsenter --setuid 1000 --...
user avatar
  • 121
0 votes
1 answer
209 views

Injected TCP/UDP packets ignored by the linux kernel on virtual eth

I try to create a local testing setup for a DPDK forwarding app, using network namespaces. The setup I created looks like this: veth0(10.0.0.1, namespace vnet0) <> veth1(no ip, host) <-DPDK ...
user avatar
  • 101
3 votes
1 answer
245 views

Create additional IP address in a separate network namespace

I'm running Ubuntu 18.04, Linux kernel 5.4.0. My laptop has local IP address 192.168.0.130: $ sudo ip addr show dev wlp2s0 3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue ...
user avatar
  • 941
1 vote
1 answer
702 views

Access localhost from network namespace

I've followed this guide to setup a network namespace (to run VPN in). Here's my setup script: ip netns add myns ip link add type veth ip link set veth1 netns myns ip addr add 10.255.255.1/24 dev ...
user avatar
  • 277
1 vote
0 answers
110 views

Error: Connection activation failed: Failed to find a compatible device for this connection

Hi linux newbie here pardon any mistakes. I have configured a network namespace local-routeTable and have brought up interface eth3 inside the namespace: # ip netns exec local-routeTable ifconfig eth3:...
user avatar
  • 11
4 votes
1 answer
300 views

ping inside netns requires sudo (Fedora)

Using fedora 32, I launched a shell inside a network namespace using sudo ip netns add net0 sudo ip netns exec net0 sudo -u fred /usr/bin/bash I configured the network links and firewall to enable ...
user avatar
1 vote
0 answers
146 views

how to create FTP server in namespace

Lets say i created two namespace in Ubuntu. ip netns add A ip netns add B now create Macvlan corresponding to each namespaces ip link add macvlanA link wlo1 type macvlan mode bridge ip link set ...
user avatar
  • 11
1 vote
1 answer
397 views

How to make a namespace visible inside a chrooted/NEWPID process

I create a new process using CLONE_NEWPID and chroot to /mnt/ Outside of that, I create a new netns using the ip netns command. e.g. ip netns add test1 Any idea how can I make the chrooted process, ...
user avatar
  • 11
5 votes
0 answers
288 views

Why does a network interface lose its IP address when moved to a different network namespace?

Suppose I use ip-link(8) to create an interface, test-macvlan, and assign it the address 10.11.12.13: # ip link add link eno1 name test-macvlan type macvlan # ip address add 10.11.12.13 dev test-...
user avatar
  • 736
2 votes
1 answer
261 views

access /proc/net/stats of other namespace

Is there a way that an application can access the /proc/net/stat from another namespace? The obvious thing to do would be to put the application, i.e, process in that netns, however, this application ...
user avatar
  • 679
1 vote
1 answer
895 views

Network namespace as a regular user

In linux you can create network namespaces, using the ip command. But you need to be root to run that command. However you can still create network namespaces as a regular user using unshare -rUn. ...
user avatar
0 votes
1 answer
453 views

Linux networking: Split eth0 (w/multiple ipv4) giving each ipv4 its own virtualdevice and namespace

I am trying to build a little project using Linux network namespaces, but am a bit overwhelmed by all the linux networking features and containerization-tech available, and thus unsure if i'm ...
user avatar
  • 103
0 votes
1 answer
1k views

ifup, ifdown get interface state wrong when using network namespaces, in Ubuntu and Raspbian

I create several network namespaces with ip netns add ns1, ip netns add ns1. When I try to start/stop network interfaces inside network namespaces with ifup and ifdown the interface state is wrong: $...
user avatar
  • 587
1 vote
1 answer
2k views

tcpdump traffic in network namespaces in `net=host` dockercontainer

I am trying to capture a tcpdump of a set of processes running in the mininet network emulation framework. Mininet works by putting each process/set of processes into its own network namespace and ...
user avatar
  • 177
0 votes
1 answer
766 views

Unable to ping external network from namespace, probably postrouting not working

I'm trying to ping an external ip (in this case google) from inside a network namespace. ip netns add ns1 # Create v-eth1 and v-peer1: v-eth1 is in the host space whereas peer-1 is supposed to be ...
user avatar
4 votes
0 answers
194 views

When does Linux "garbage-collect" namespaces?

My current understanding of Linux (kernel) namespaces is that their lifetime after creation is as long as at least one of the following conditions holds true: at least one process/thread is joined (...
user avatar
  • 1,019
2 votes
1 answer
1k views

Directly connecting two namespaces using veth devices, what network prefix should I use?

I just started studying network namespaces and I'm looking at a very common example. This is just connecting two namespaces thanks to two veth (no bridge involved). ip netns add net1 ip netns add ...
user avatar
4 votes
0 answers
1k views

I can ping across namespaces, but not connect with TCP

I'm trying to set up two network namespaces to communicate with eachother. I've set up two namespaces, ns0 and ns1 that each have a veth pair, where the non-namespaced side of the veth is linked to a ...
user avatar
0 votes
1 answer
141 views

How to send ethernet frames from one veth to another?

I have two veth pairs (veth1, veth1_0) and (veth2, veth2_0). veth1_0 and veth2_0 are in the default namespace ns0, veth1 is in namespace ns1 and veth2 in namespace ns2. I want to communicate between ...
user avatar
  • 1
5 votes
0 answers
3k views

Docker mapped port doesn't show up on "netstat", "ss" and "lsof"

I've a question about docker containers and sockets. Today i've discovered that, docker containers with mapped port -p 80:80 (or etc ports) on the host system, doesn't show up when i use netstat, ss ...
user avatar
1 vote
0 answers
173 views

ovs-vsctl: Error detected while setting up 'eoip_if'. See ovs-vswitchd log for details

I have a namespace ns1, inside this i run a eoip script which create a interface eoip_if. I also have a ovs-bridge br0 which is in default namespace. When i try adding the 'eoip_if' interface as a ...
user avatar
3 votes
1 answer
921 views

Run ssh daemon in different namespace to connected clients

If sshd is running in the (non-init) namespace of the appropriate physical device: ip netns exec physical sshd is it possible to have clients that connect on that interface get a shell with the ...
user avatar
  • 1,588
0 votes
1 answer
1k views

Error while creating network name space : mount --bind /var/run/netns /var/run/netns failed: Invalid argument

I am facing this issue while creating network namespace with following command in kernel 3.10. bash# ip netns add ns1 mount --bind /var/run/netns /var/run/netns failed: Invalid argument debugshell# ...
user avatar