Questions tagged [network-namespaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
12 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
0answers
11 views

Nameserver used in network namespace

I've created a virtual interface under a namespace so that my default connection uses a VPN and the namespace uses the raw network: ip netns add tor ip link add type veth ip link set veth1 netns tor ...
-1
votes
0answers
10 views

how to pass a pre-existing custom linux network namespace to kubernetes POD

how to pass a pre-existing custom linux network namespace while creating a kubernetes POD. we are using docker for containers.
0
votes
1answer
40 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
66 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
62 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
82 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
22 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 ...
1
vote
0answers
334 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
53 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 ...
0
votes
0answers
48 views

Setting up connectivity from physical interface to ovs-bridge inside a namespace

I am absolute newbie for the virtualization stuff. Im trying to set up a bridge inside a namespace which should be able to connect to a physical interface. conside I have a ovs bridge name br0 which ...
1
vote
1answer
180 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
251 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
257 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
34 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
75 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....
4
votes
0answers
342 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
37 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
397 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
215 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: ________ +-------...
3
votes
1answer
485 views

Ping not working in a new C container

I've been working on writing my own Linux container from scratch in C. I've borrowed code from several places and put up a basic version with namespaces & cgroups. Basically, I clone a new ...
4
votes
1answer
123 views

Is there a file that associates a thread to its network namespace?

/proc/[pid]/ns/net contains a link to the inode representing the network namespace of the process with PID [pid]. Is there something similar for threads? My use case is a multi-threaded application, ...
1
vote
0answers
143 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 ...
0
votes
1answer
441 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 ...
1
vote
0answers
701 views

How to delete network namespace, no pids option available for ip netns [duplicate]

How to clean up network namespace, CentOS 6.5 does not have ip netns pids option, so can't use ip netns pids ns-2001 | xargs kill ip netns list | grep ns-2001 ns-2001 ip netns pids ns-2001 | xargs ...
1
vote
1answer
121 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
1answer
472 views

Is it possible to send packets between network namespaces using only TUN/TAP interfaces?

I am trying to understand the difference between different types of (virtual) interfaces (e.g. TUN/TAP, veth etc.) and was studying some of these types within the context of containers. Is it ...
0
votes
1answer
441 views

Can I lock down access to a TCP port in Linux

I'm trying to secure a single-node Elasticsearch machine. Basically, I want to put Elasticsearch behind a reverse proxy (nginx) and make sure that the only way any user or process can communicate with ...
3
votes
1answer
480 views

firejail : only let a program access localhost

I have this local network service and this client program needing to access it. I am running them both as an unprivileged user. I am looking for a way to sandbox the client using firejail, in a way ...
0
votes
1answer
210 views

Can I assign a virtual interface of wireless to a network namespace?

I am trying to make a VPN router while keeping the host itself accessing Internet without VPN. The host has only one NIC which is wireless. So I have added two virtual interfaces via iw phy phy0 ...
0
votes
1answer
383 views

How to Keep Network Namespace after reboot

I have created a network namespace, but after I have reboot, it've been removed. I don't found an answer at this problem on the internet, so this is why I'm asking you : Is there a way to keep a ...
1
vote
0answers
401 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 ...
3
votes
1answer
1k views

Switching into a network namespace does not change /sys/class/net?

The Linux man page for network namespaces(7) says: Network namespaces provide isolation of the system resources associated with networking: [...], the /sys/class/net directory, [...]. However, ...
0
votes
0answers
34 views

Linux processes without certain namespaces?

When chromium is running I see processes in /proc/[PID]/ where some of the namespace links inside /proc/[PID]/ns/do link to nothing, that is, they cannot be readlinked and return errors instead. Also ...
1
vote
1answer
1k views

Move network device between Linux network namespaces

In Linux, set up 2 network namespaces, ns1 and ns2. ip netns list can view the 2 network namespaces. If I move one network device from Linux root namespace to ns1 then from ns1 to ns2, then delete ...
1
vote
0answers
275 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 ...
5
votes
2answers
2k views

Separate DNS configuration in each network namespace

I've set up several network namespaces on my Linux system (kernel version 3.10), and now I want to configure each network namespace to have its own DNS settings. I created resolv.conf files in each /...
2
votes
1answer
243 views

Access /proc/pid/ns/net without running query process as root?

In a program I'm enumerating network namespaces by scanning /proc/pid/ for ns/net (sym) links. This program runs inside the "root" namespaces (original init) of the host itself. Normally, I need to ...
5
votes
3answers
7k views

How to find the network namespace of a veth peer ifindex?

Task I need to unambiguously and without "holistic" guessing find the peer network interface of a veth end in another network namespace. Theory ./. Reality Albeit a lot of documentation and also ...
0
votes
0answers
273 views

Creating an exact copy of a whole process?

fork() forks a process, but it will not copy all of its threads; nor will it create a clone of all its fds: the fds are shared between parent and child. I want a way of do a complete fork. So after I ...
1
vote
1answer
101 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 ...
5
votes
1answer
5k views

Connecting two network namespaces via a veth interface pair where each endpoint has the same name

Is there a single (simple) command that will create a veth interface pair and assign each interface to a different network namespace? For example, suppose that I have two namespaces: mynamespace-1 ...
1
vote
2answers
2k views

Internet connectivity using linux network namespace

I experimenting with Linux namespaces on Ubuntu 17.1 distro. Ultimate goal is to force an application to use a particular network interface via a 3G modem not the intranet wired connection. My PC has ...
1
vote
0answers
92 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 ...
2
votes
0answers
271 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 ...
3
votes
2answers
4k views

How to make reachable macvlan aliases in a different namespaces?

I have an interface, name eth0, in my main network namespace another interface, name jail0, in an alternate network namespace (name name0). This namespace is used by a jailed environment. jail0 is a ...
0
votes
1answer
402 views

NFS mount over network namespaces

Is it possible to use NFS over Linux network namespaces? Does it even make sense? The only related thing in kernel source I found is is commit 7e3fcf61abde nfs: don't share mounts between network ...
4
votes
2answers
3k views

How do I connect a veth device inside an 'anonymous' network namespace to one outside?

I have a process that has called unshare to create a new network namespace with just itself inside. When it calls execve to launch bash, the ip command shows that I have just an lo device. If I also ...
3
votes
1answer
5k views

How to forward traffic between Linux network namespaces?

I was able to set up a network namespace and start a server that listens on 127.0.0.1 inside the namespace: # ip netns add vpn # ip netns exec vpn ip link set dev lo up # ip netns exec vpn nc -l -s ...
1
vote
1answer
834 views

SNAT to unroutable interface

I set up a virtual ethernet (veth) pair between default namespace and another namespace named RoutableNS as follow: -------------- -------------- - veth0 - -------------- veth1 ...