Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [network-namespace]

A network namespace is an isolated software implementation of a network stack with its own devices, routes and firewall rules within a Linux operating system.

0
votes
1answer
56 views

How to run a command in another process's network namespace?

There is a process running in its own network namespace. I would like to telnet to the machine and run a command in this process network namespace, something like that (17543 is the pid of the process ...
0
votes
1answer
221 views

How to run a program in the context of a VRF in Linux

I have created a VRF and I have added interfaces and routes to my VRF. My VRF is as shown below. My VRF is names wan1: [root@host ~]# ip route list vrf wan1 default via 12.12.12.12 dev enp1s0.4025 ...
0
votes
0answers
36 views

Two physically different devices on different interfaces with the same IP

I have two GoPro cameras that I am trying to connect to simultaneously. They each act as routers, which my two wireless cards connect to. The problem is, they both have IP 10.5.5.9, and I want to be ...
0
votes
0answers
83 views

How to count the packets inside Linux network namespace using NETFILTER framework?

I am newbie to Netfilter. Trying to implement netfilter framework (INPUT-HOOK, OUTPUT-HOOK, FORWARD-HOOK) in Linux to count the number of packets went inside the network namespace. But not able to ...
0
votes
0answers
206 views

Forward Traffic between Namespaces

I have 3 interfaces: eth0 eth1 eth2: eth0 is directly connected to the Internet. eth1 and eth2 are connected to an external switch with no Internet connectivity. My goal was to connect eth1 and eth2 ...
0
votes
0answers
62 views

Restore namespace for adapters lost to LXC

First, is there any method to list all adapters on a host even when held in another namespace, and second, how can I restore them if they don't automatically come back when a container is destroyed? ...
-1
votes
1answer
118 views

Linux netns: run different commands with different IP's on one physical interface [closed]

I have a Debian Stretch VPS with 4 IPv4 addresses. I want to run several programs, binding them to specific IP addresses (To make outgoing HTTP requests from different IP's). So for example command ~$...
2
votes
2answers
230 views

Secondary IP in its own netns namespace

Is there a way I can move a secondary IP into its own namespace while keeping the primary IP on the original device? If I have 10.0.0.1 and 10.0.0.2 on device eth0, but I want 10.0.0.2 to be in its ...
0
votes
2answers
201 views

Adding vrf interface to a network namespace

I am trying to add a VRF interface to a network namespace in Linux. I am getting RTNETLINK answers: invalid argument. Kernel version I am using is 4.15.0 from kernel.org Below is the exact list of ...
0
votes
1answer
201 views

ifconfig up does not execute from cron

I'm attempting to combine Scott Lowe's guide to creating a namespace with this answer on forwarding traffic between two interfaces. I have this script that runs on each reboot using the cron @reboot ...
0
votes
0answers
331 views

Inter namespace communication over linux bridge

So I have the following scenario: I have a server with 1 physical network interface. On this server I want to create 2 networking namespaces (NS_NASty and NS_MongoDB). Both namespaces should be able ...
1
vote
0answers
175 views

How does non-namespace specific sysctl variables work in the context of network namespaces?

Let's assume the systctl variables net.ipv4.tcp_wmem and net.ipv4.tcp_rmem. To my understanding, these variables can not be set per-namespace (but very soon apparently). My understanding is that ...
0
votes
0answers
77 views

Run nscd in multiple network namespaces

How to run an instance of nscd daemon per network namespace? I did the following: ip netns exec <network_namespace> /usr/sbin/nscd However, it threw output /usr/sbin/nscd: already running ...
1
vote
0answers
374 views

Unable to add interface to network namespace on boot

I have problem with adding a phyisical ethernet interface to a predefined namespace , adding that to interfaces file in pre-up/post-up event do not work. It adds eth to namespace, but ip address and ...
0
votes
1answer
173 views

Linux transparent bridge: dhclient kills all traffic

I'm encountering a very odd situation with Hypriot OS. Network configuration: +--------+ +------+-----+------+ +---------------------+ +-------+ + laptop +--+ eth0 + br0 + eth1 +--+ router @ 10....
1
vote
0answers
210 views

Linux namespace networking

I am trying to allow internet connectivity from a network namespace. I tried doing this with the docker0 bridge running in the global namespace based on this talk. If I try to ping within the new ...
3
votes
1answer
676 views

openvpn post-up script fails with “Operation not permitted” if and only if openvpn is run by systemd

I have this post-up script that is run by openvpn: #!/bin/bash echo "I am: `whoami`" echo "Moving interface into the netns" ip link set dev "$1" up netns hydrogenvpn mtu "$2" echo "Listing" ip netns ...
1
vote
2answers
73 views

using ethernet ipv4 as internal bus while allowing the full ipv4 address range for the external interface

We have designed a device to be used as one device, but using ethernet ipv4 inside to communicate with internal not linux-based ipv4-speaking peripherals, juste like what we could do using pci or usb, ...
0
votes
1answer
2k views

How to create permanent linux network namespace

I know that ip netns add xxx command can be used to create a linux network namespace, but it is not permanent, meaning after server reboot the created namespace will be gone. Then how can I create a ...
0
votes
0answers
382 views

Not able to ping ips created inside docker container using namespace in centos7

I have a docker container running inside centOS7. Now docker creates a bridge by default named as docker0 in host system. Inside the docker container, we have created another bridge named as eth2 ...
4
votes
1answer
3k views

Run a systemd unit in a specified network namespace

I would like to instruct systemd to 'run a unit' in a specified, pre-existing network namespace, in particular to start the unit's process(es) in the namespace.
3
votes
0answers
242 views

Linux device route without broadcast

I have the following setup: A network namespace, ns1 A pair of virtual interfaces, ns_ext1 and ns_int1. ns_ext exists in the global namespace, and ns_int1 exists in ns1. A GRE device, gre1, which ...
4
votes
3answers
8k views

How can I move an interface out of a network namespace?

If I move an interface temporarily into a netns with ip link set eth10 netns myns then it no longer is visible in the root, only within the namespace myns. How do I move it back, something like (...
3
votes
1answer
1k views

cannot ping linux network namespace within the same subnet

Here is a quick summary of the issue. I cannot communicate with a linux network namespace within the same subnet. I am running Ubuntu 14.04.1 LTS on a headless server. I have been troubleshooting this ...
1
vote
0answers
612 views

How to allow applications in network namespace access to global filesystem?

I have several applications that are potentially high-risk and high-throughput (like bind, ntpd, etc.). I plan on having a "management domain" for OS tasks, updates, SNMP, automation, etc. and a "...
0
votes
1answer
953 views

How to connect custom network namespace to root network namespace?

I would like to connect the root network namespace to my custom network namespace in my Ubuntu box. Here is my network diagram: Basically my custom network namespace is the one who control the vm ...
2
votes
2answers
3k views

How to configure a Linux network namespace that allows UDP broadcast

I'm trying to use the ip netns family of commands in Linux to create a network namespace in which I can run a program that uses UDP broadcast. I do not need access to the Internet, or any interface on ...
2
votes
1answer
3k views

Linux kernel bug w/ netns and/or Xen guest - “unregister_netdevice: waiting for lo to become free”

I am running a web crawler in a Xen-based VM (on Linode); it makes heavy use of network namespaces to control use of VPNs on a per-crawl-process basis. It's been running mostly continuously for the ...
-1
votes
1answer
537 views

Hosts cannot ping in two name spaces using Open Vswitch

I have two name spaces red and blue. Red is connected to host1, and blue is connected to host2, but these two hosts cannot ping each other. Here is the commands that I put: ip link add host1 type ...
13
votes
2answers
12k views

How can I switch from a custom linux network namespace back to the default one?

With ip netns exec you can execute a command in a custom network namespace - but is there also a way to execute a command in the default namespace? For example, after executing these two commands: ...
1
vote
1answer
168 views

process group A default route tun0, B default route tun1, etc

I have a Linux box with N tunnel interfaces, tun0, tun1, and so on. I want to set things up so that a particular group of processes, A, has its default (and only) route pointed at tun0. Meanwhile, a ...
1
vote
2answers
3k views

Is it possible to do Linux network namespaces (netns) on MacOS?

Context - I'm trying to get a docker cluster running on MacOSX. Part of the install process for getting docker running is to install pipework. Pipework relies on /var/run/netns My question is: Is ...
1
vote
1answer
5k views

Linux network namespaces - ping fails on specific veth

I just started to exploring network namespaces. I try to implement the following simple setting following the article in http://www.opencloudblog.com/?p=42 +--------+ +--------...
2
votes
1answer
3k views

Howto query and change network namespace on linux?

I was wondering if there is a way to Query the network namespace the current shell is in Change the current network namespace of the current shell I know I can do things like sudo ip netns exec <...