Questions tagged [network-namespaces]

The tag has no usage guidance.

53 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
150 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 (...
4
votes
0answers
876 views

How can I constrain a user application to always run in a particular network namespace?

I need to be able to constrain a user application to always run in a particular network namespace. Assume I have previously set up my network configuration as such: ip tuntap add name tap0 mode tap ...
4
votes
1answer
855 views

Dnsmasq problem with Linux network namespace

I have tried to use dnsmasq as the name server for virtual machines. On all the vm-s, /etc/resolv.conf indicates the vm need to access 192.168.15.3 to resolve the domain names. However, the interface ...
4
votes
0answers
492 views

Is there a thing like “veth”, but without link-level headers?

When I use separate network namespace, I often set up networking there using veth: ip link add type veth ip link set veth0 netns 1 ifconfig veth1 192.168.60.2 ip route add default via 192.168.60.1 ...
3
votes
0answers
60 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-...
3
votes
0answers
510 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 ...
3
votes
0answers
2k 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 ...
3
votes
0answers
1k views

Netlink access inside a network namespace

I'm trying set up an IPsec gateway (strongSwan) on a Raspberry Pi 2. The Pi was already providing a number of services on the LAN using a private IP address. My initial attempt to turn it into an ...
3
votes
1answer
3k views

running a process in another namespace

I would like to run a new process (for example an xterm) in another network namespace. This could be done like this: sudo ip netns exec otherns sudo -u $USER xterm This command looks a bit ...
2
votes
0answers
39 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:...
2
votes
0answers
312 views

stp is not working in network namespaces?

Why does the Linux bridge inside of netns sees bpdus but doesn't update topology? I've created a pair of netnses: NS300, NS301, a bridge in each one: br300, br301, a first veth link between the ...
2
votes
1answer
1k views

How to avoid duplicate connection names? (32) Connection 'Auto Ethernet' is already active on enpXXX

Is there any way that I can make networkmanager to assign some unique names or device derrived name instead of Auto Ethernet so that we can avoid the names conflict? After I've upgraded to Ubuntu ...
1
vote
0answers
11 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....
1
vote
0answers
9 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 ...
1
vote
0answers
41 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:...
1
vote
0answers
65 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
76 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, ...
1
vote
0answers
59 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 ...
1
vote
0answers
130 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 ...
1
vote
0answers
536 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 ...
1
vote
0answers
355 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: ________ +-------...
1
vote
0answers
265 views

How do you use cgroups from within a network namespace

I just discovered that mount | grep cgroup returns nothing when you are not in the default network namespace. I can't really find any documentation on this except for that "network namespaces isolate ...
1
vote
1answer
263 views

dnsmasq running in namespace can't take queries from within namespace

I've set up a default dnsmasq.conf with essentially no modifications except: listen-address=192.168.42.2 interface=veth1 # Also tried without server=8.8.8.8 And my /etc/hosts looks like this: 127.0....
1
vote
0answers
585 views

How to run ip netns exec without password?

I'm on arch and am using a network namespace wiredlan for ethernet, using it for LAN based applications and big downloads. I run commands/apps on the netns as: alias runonlan='sudo ip netns exec ...
1
vote
0answers
452 views

iptables-save behaviour in network namespace in linux

My setup: Linux 4.16.13-2-ARCH iproute2 4.16.0-1 iptables 1.6.2-2 Issue: Output of iptables-save is empty inside network namespace. If iptables -L called before, iptables-save provides correct ...
1
vote
1answer
149 views

network namespace broken after exiting openvpn

I did these: ip netns add vpn ip netns exec vpn ip addr add 127.0.0.1/8 dev lo ip netns exec vpn ip link set lo up ip link add vpn0 type veth peer name vpn1 ip link set vpn0 up ip link set vpn1 ...
1
vote
0answers
116 views

Limit network interface to specific commands vice versa

I'm using this tutorial: Bind unix program to specific network interface Assume that $NS and $IN is set properly My problem I have two network interfaces and one of them has data limits and I don't ...
1
vote
0answers
514 views

dnsmasq not available from network namespace at first

ubuntu 16.04, dnsmasq 2.75 NOTE: I have dnsmasq running with --hostsdir option so dnsmasq should pick up host entries written to that directory. Steps to reproduce: ... fresh machine boot ... $> ...
1
vote
1answer
78 views

Networking issue communicating to Virtual Network on ubuntu 16.04

Using ubuntu 16.04. My goal is to run a small service inside of a network namespace(my-network) and communicate with that service from the host. I have created a linux bridge, a new network ...
1
vote
1answer
734 views

Why remount of /proc/sys is not global or does not persist in network namespace inside LXC

I have host running RHEL-7.2. Inside that running LXC. Inside LXC creating network namespaces. Inside the namespace changing sysctl variables was failing (as root): $ ip netns add testns $ ip netns ...
1
vote
0answers
347 views

rsyslog and netsnmp support for Linux namespaces

I have configured different net namespaces (netns) on my linux machine (Ubuntu) with different routes in each. Now, if I want rsyslog and SNMP traps (netsnmp) to use one of the route from these ...
1
vote
0answers
653 views

Running HTTP process as a sole child in PID/NET namespace

First time posting here so I appreciate your help and patience. After reading about namespaces, looking on various forums including this thread and trial and error I'm still looking for answers for a ...
0
votes
0answers
43 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 ...
0
votes
0answers
14 views

Configuring network namespace for dedicated IP address

I have a Debian 10 system that is connected to a VPN with Wireguard. I want one application – Tor – running as a service to connect directly to the internet and to have its own IP address in my ...
0
votes
0answers
59 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 ...
0
votes
0answers
12 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
42 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
36 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
44 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<<"==============...
0
votes
0answers
31 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
39 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
0answers
39 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
15 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 ...
0
votes
0answers
56 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 ...
0
votes
0answers
50 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
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
139 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
92 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 ...
0
votes
1answer
888 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# ...
0
votes
1answer
972 views

Route from netns through a veth link

I have created a network namespace (with ip netns add) and a pair of veth links, virt-a and virt-b. The physical link in the root namespace is named eth0. virt-a is in the root namespace and virt-b is ...