Questions tagged [network-namespaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
4 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....
2
votes
1answer
27 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 ...
0
votes
0answers
33 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 ...
2
votes
2answers
87 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/...
1
vote
0answers
8 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 ...
0
votes
0answers
10 views

systemd isolate service that binds to loopback address

I run a number of services that I run on my own server that I put behind a reverse proxy for authentication. However a number of the services only support listening to localhost for a non-public ...
0
votes
0answers
39 views

How can I use containerd to grant access to Internet, but nothing else on the local network?

I'm trying to figure out how to use the containerd golang APIs to grant a container access to the Internet, e.g. so a container can curl google.com. But the problem is that I don't want containers to ...
0
votes
1answer
30 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: ...
0
votes
0answers
37 views

Connection reset by peer errror when delaying network response packets

Client's side code written in redis-plus-plus int main(){ auto redis = Redis("tcp://192.168.122.50:6379); sleep(5); int ep = 100; while(true){ cout<<"==============...
1
vote
0answers
18 views

Learning about cgroups and namespace [closed]

Does anyone know of a good way of learn about cgroups and namespaces. Most Linux books do not seem to cover this topic for some reason or the other. In particular I want to be able to control ...
1
vote
2answers
146 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 --...
0
votes
1answer
35 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 ...
1
vote
1answer
55 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 ...
0
votes
0answers
23 views

Using network namespaces in production?

I have been looking at two pages https://gist.github.com/dpino/6743226422594b6c02c7150b6e5e7df7 (no nat) and https://gist.github.com/dpino/76b0bf7f522bd0d2e442eca06ae9db76 (nat but I don't know what ...
0
votes
0answers
31 views

systemd service private network with veth

I'd like to run a systemd service with PrivateNetwork=true but I'd like to get a veth with the host like I get when running nspawn with -n, --network-veth. Is there a way I can achieve that behavior?
0
votes
1answer
94 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 ...
0
votes
0answers
38 views

How do I start a Docker container in other _host_ network namespace?

docker run --network=host starts a container in the same network namespace as containerd. How do I instead start a container in, for example, /proc/5633/ns/net or other specific network namespace? man ...
0
votes
0answers
13 views

Testing setup for ICMP Redirect Messages (Linux distribution using network namespaces)

I'd like to create setup for testing ping from iputils (for Linux) behavior with ICMP Redirect Messages. How to do that, preferably virtualized (with Linux network namespaces or other Linux virt ...
1
vote
0answers
35 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:...
2
votes
1answer
88 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 ...
1
vote
0answers
59 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 ...
1
vote
1answer
47 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, ...
0
votes
0answers
46 views

Firejail/Network namespaces without sudo

I think this is kind of a basic question: Related questions: What script could allow regular users to use network namespaces? Block network access of a process? I want to start a process, which will ...
3
votes
0answers
54 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-...
2
votes
1answer
94 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 ...
0
votes
0answers
41 views

How can I find the disappeared vEth link?

I installed Docker on CentOS, and find that two network links are added automatically. But I found that I've missed one vEth. The links are: root@cent7-1908:/root> ip link 1: lo: <LOOPBACK,UP,...
0
votes
1answer
164 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. ...
0
votes
1answer
93 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 ...
0
votes
0answers
17 views

Use cgroups in any network namespace

Basically, I have this exact question but it's been more than one year and it has not been answered. So in case anyone that didn't see the original and can/wants to answer it. Like I said, I have the ...
0
votes
0answers
117 views

How to configure tun device to receive IP/TCP traffic

For learning purposes I would like to read/write raw IP/TCP packets with a custom server. My understanding is that I should be able to do this by attaching the server to a tun device. I would like ...
0
votes
1answer
214 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: $...
1
vote
0answers
54 views

Create new network name space

I would like Firefox (own instance) to use a virtual network card so that I can use Wireshark on that and not get all other traffic on my local machine. I followed this guide. To start off my ...
0
votes
0answers
224 views

Use Network Namespace for SSH Tunnel

I have an Ubuntu 18.04 server in which I've created two virtual interface pairs (veth0a & veth0b) and assigned the end of one interface (veth0b) to a new network namespace (netns0): ip netns add ...
1
vote
1answer
762 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 ...
0
votes
1answer
336 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 ...
4
votes
0answers
138 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 (...
2
votes
1answer
561 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 ...
3
votes
0answers
449 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 ...
0
votes
1answer
90 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 ...
3
votes
0answers
1k 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 ...
1
vote
0answers
124 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 ...
3
votes
1answer
522 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 ...
0
votes
1answer
845 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# ...
1
vote
0answers
520 views

Using socat to access deluge daemon in a different namespace

I'm using namespaced-openvpn to ensure that my torrent traffic in deluge is always behind a VPN. A modified script from this blog post helped to connect the VPN namespace to the real network: ip ...
2
votes
0answers
38 views

Create a route to an existing namespace

I have a namespace with an existing interface in it: 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:...
-1
votes
1answer
159 views

reusing same port in a tcp application under different namespaces on linux VM

i have a linux VM with 2 interfaces, eth0 has mgmt IP and eth1 has configuration as below ip netns exec eng51 ifconfig eth1.51 Link encap:Ethernet HWaddr 52:54:00:bd:68:c3 inet addr:51.51....
6
votes
1answer
860 views

Why does `systemd-nspawn -n` network namespace not show in `ip netns list`?

tl;dr Linux has namespaces, in particular, network namespaces. It seems the namespace supposedly created via the -n flag when running systemd-nspwawn does not show up when employing ip netns list (...
0
votes
1answer
68 views

How to lock some resource in a shared network namespace

I would like to implement the functionality similar to pid file but for network namespace. In common file namespace the process can lock pid file and ensure that no other process is running in the ...
3
votes
1answer
728 views

How to get the Linux network namespace for a tap/tun device referenced in /proc/[PID]/fdinfo/[FD]?

I want to correctly match TAP/TUN devices with the processes they are using, and I want to do this from outside of these processes using TAP/TUN devices (that is, I cannot issue any ioctl()s because I ...
1
vote
0answers
349 views

NAT box with two external interfaces and two network namespaces

I have an ARM embedded system with kernel 4.9.62 that has two physical interfaces as shown below: ________ +-------...