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.

Filter by
Sorted by
Tagged with
1 vote
2 answers
76 views

Linux ping between 2 network namespaces

Quiet new to Linux networking and couldn't find an answer for it on similar questions Trying to create 2 namespaces and ping between them ip netns add red; ip netns add blue; ip link add dev v-red ...
user avatar
0 votes
1 answer
89 views

systemd-resolve resolves incorrectly inside a network namespace

I have an Ubuntu machine with a network namespace (ns1) connected to the host network namespace via veth. I created a MASQUERADE rule in iptables to access the internet and I can ping 8.8.8.8 from the ...
user avatar
0 votes
0 answers
115 views

Cannot connect macvlan to the internet

When I tried to connect macvlan to the internet and it was not successful. I used namespace to accomplish that. I also checked the comments on this question - How to connect macvlan to the internet? I ...
user avatar
  • 1
0 votes
1 answer
88 views

Connect to internet through network connection inside network namespace without setting as a default route

I need to do a setup like this (with Linux): I want to have a network namespace (let's say weth_ns) with a network interface connected to internet (weth0) I want to have a different network interface ...
user avatar
-2 votes
1 answer
185 views

How can I run two docker containers in the same network namespace? [closed]

I want to run two docker containers in the same Linux network namespace. My goal is to route all my torrent traffic through OpenVPN. This script successfully creates a openvpn client container. I can ...
user avatar
1 vote
0 answers
118 views

After a while, /etc/resolv.conf stops using /etc/netns/X/resolv.conf

My setup: /etc/ns-shared-resolv.conf is written to regularly with nameserver x.x.x.x, updated from a script /etc/netns/ag2/resolv.conf is a symlink to the above (along with ag3, ag4).. for central ...
user avatar
0 votes
0 answers
119 views

systemd-nspawn - run a host binary with network isolation

I am trying to run a binary sitting on the host machine using systemd-nspawn with networking support. I am trying to run multiple copies of the binary where each instance would have its IP address. I ...
user avatar
1 vote
1 answer
140 views

How can I run docker container in existing network namespace?

I have an existing network namespace: dewi@dewiserver:~$ ip netns list dewinetns235 (id: 0) How can I get a docker container to use and run inside this network namespace? e.g. run something like ...
user avatar
0 votes
0 answers
174 views

Why doesn't qbittorrent work when using a openvpn kill switch?

I am trying to implement a OpenVPN killswitch. My goal is for ALL traffic to be forced through the OpenVPN tun interface ++ iptables -vL -n -t filter Chain INPUT (policy DROP 2 packets, 221 bytes) ...
user avatar
0 votes
1 answer
238 views

Force new process to use the specific network interface (using netns/network namespaces)

I have a number of interfaces available on Ubuntu 20.04 machine. Among others enx0c5b8f279a64 and usb0 with the later being used as the default one. I want to make sure that a particular process ...
user avatar
  • 11
0 votes
2 answers
185 views

Can't chain more than one network namespace together

Problem Statement With the below configuration a veth pair is created between the default/main net namespace and a netns called ns1. The config also creates a second veth pair: veth2 is in netns ns1 ...
user avatar
  • 4,112
2 votes
1 answer
101 views

Can I change the default sysctl values in grub?

When using kernels older than 5.1, if a user creates a network namespace, it starts with the default sysctl values. Even if the root namespaces changed those values with sysctl, the new network ...
user avatar
1 vote
1 answer
331 views

How to set /proc/sys/net/ipv6/conf/all/forwarding to 1 by default in network namespaces?

By default, when I create a network namespace, I get: /proc/sys/net/ipv6/conf/all/forwarding=0 Even if it is 1 in my root network namespace or in /etc/sysctl.conf. I was wondering where network ...
user avatar
1 vote
0 answers
79 views

How to whitelist egress traffic with a NetworkPolicy that doesn't prevent Apache Ignite from starting up?

I have some more or less complex microservice architecture, where Apache Ignite is used as a stateless database / cache. The Ignite Pod is the only Pod in its Namespace and the architecture has to ...
user avatar
  • 131
0 votes
1 answer
131 views

How conntrack and network namespaces works together?

Is nf_conntrack respects network namespaces? Does it creates a separate table for each network namespace based on its sysctl limits, or does it share memory (and limits) between different network ...
user avatar
0 votes
1 answer
211 views

iptables NETMAP not reliably adjusting source address of multicast UDP packets

In an embedded/IoT use case, I have a management host running Linux that needs to be able to talk to multiple networks that each use a common set of static IP addresses. This mostly works fine, ...
user avatar
  • 133
1 vote
1 answer
260 views

Why are my packets refusing to be routed?

I'm setting up a rather unusual network configuration meant to afford some additional protection to certain containers running on a host. There are some external requirements that are beyond the ...
user avatar
1 vote
0 answers
709 views

How to connect macvlan to the internet?

I want to connect macvlan to the internet, but i can't. I added macvlan to the network namespace, what to do next? I am using VPS server (Cloud VPS), OS Debian 10 My default gateway, outside the ...
user avatar
  • 111
0 votes
1 answer
69 views

Using netns to force Java application use specify IP

My VPS provider assigned 4 IPv4 to my vps. However, This assigned to single NIC, and VLAN not working(Maybe it is my configuration problem). If I try using VLAN, I can't get external network using ...
user avatar
1 vote
3 answers
812 views

How to use ss in specific network namespace

Whilst investigating some TCP network issues in containers I tried to use ss to peek into container network TCP stack. We are running Amazon Linux in AWS: # uname -a Linux 4.14.173-137.229.amzn2....
user avatar
  • 1,778
0 votes
1 answer
1k views

Unable to ping container from outside

I've to connect to a service running inside a runc container, I've written the below script and is able to ping the container from the host and can connect to the internet from inside the container. ...
user avatar
  • 121
2 votes
1 answer
759 views

Alpine linux veth network/bridge has no internet

I have been trying to follow multiple guides to setup a veth-pair for 2 namespaces which can communicate with each other on alpine linux. So far I have communication between namespaces working but ...
user avatar
  • 123
0 votes
0 answers
981 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
  • 3
0 votes
1 answer
308 views

Issues resolving queries using bind and linux namespaces

I have been wracking my brain trying to resolve an issue using bind for DNS resolution in centos The setup I have is not typical (this was inherited). Basically on the server there is a namespace ...
user avatar
1 vote
2 answers
281 views

Bonding 2 interfaces inside a linux network namespace

I'd like to be able to bond/aggregate 2 interfaces inside a Linux network namespace. The configuration I'm working with is the following: On the root linux net stack I have two physical ethernet ...
user avatar
2 votes
1 answer
1k views

Run docker in an existing network namespace?

Would it be possible to run a docker container inside an existing namespace ? I created a namespace using: ip netns add client Now I want to run a container (with a bridge or host network, whatever is ...
user avatar
  • 31
2 votes
2 answers
2k views

Inter-Guest Network in KVM without a Bridge

I would like to have a psuedo-wire between two guests in KVM. I cannot use a bridge of any type as the guest VMs are actually virtual switches themselves. Conceptually, it seems that a veth-pair is ...
user avatar
  • 21
5 votes
0 answers
1k views

Windows equivalent of Linux Network Namespace

Does windows have an equivalent of the Linux Network Namespace? I want to create a new interface and have that interface only accessible to specific applications, that interface would not be ...
user avatar
0 votes
1 answer
101 views

Weird issue with linux network namespace switching

I'm writing a small prometheus exporter in Go to publish network metrics for docker containers. There is a goroutine which gathers the values in the following way: 1. Get all docker containers using ...
user avatar
2 votes
2 answers
445 views

Unable to reach network namespace through master

I'm trying to create an isolated lab using network namespaces. It works correctly, that is, only the machines in the network namespace can talk. But now I want reach the machines by localhost using v-...
user avatar
  • 133
0 votes
1 answer
225 views

ping server in namespace from remote machine

If I run web server in default namespace of SERVER machine I can curl it from REMOTE machine doing that: curl http://SERVER:80/ Now I put web server in namespace nested with providing veth peered ...
user avatar
0 votes
1 answer
464 views

How to access the files present inside namespace to the outside in Linux Machine?

I have linux system where i created network namespace "BLUE_NAME", requirement to access the /var/tmp files present in the BLUE_NAME network space to outside of the name space (Host Machine).Request ...
user avatar
6 votes
1 answer
5k views

Cannot create nested network namespace

Is seems that one is not able to create a network namespace from a network namespace. It results in "Error: Peer netns reference is invalid.". Is this a bug or is there some kind of limitation that I ...
user avatar
1 vote
1 answer
1k views

Ping not working in network namespace

If I do: sudo ip link add l4 type veth sudo ip addr add "7.7.7.7/24" dev l4 ping 7.7.7.7 PING 7.7.7.7 (7.7.7.7) 56(84) bytes of data. 64 bytes from 7.7.7.7: icmp_seq=1 ttl=64 time=0.023 ms 64 bytes ...
user avatar
  • 11
3 votes
1 answer
3k views

Netstat and ss doesn't see connection

I'm trying to find which application running on Kubernetes cluster is using a specific port to communicate with RabbitMQ cluster. On RabbitMQ I see that connection is coming from 192.168.1.10:34226. ...
user avatar
  • 466
3 votes
2 answers
7k 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 ...
user avatar
  • 131
1 vote
1 answer
2k 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 ...
user avatar
0 votes
0 answers
58 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 ...
user avatar
0 votes
0 answers
508 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 ...
user avatar
  • 141
0 votes
1 answer
598 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 ~$...
user avatar
  • 111
3 votes
2 answers
2k 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 ...
user avatar
  • 449
0 votes
2 answers
829 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 ...
user avatar
  • 101
0 votes
1 answer
1k 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 ...
user avatar
2 votes
1 answer
2k 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 ...
user avatar
1 vote
0 answers
823 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 ...
user avatar
  • 1,436
1 vote
0 answers
176 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 ...
user avatar
4 votes
1 answer
864 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 ...
user avatar
  • 141
0 votes
1 answer
393 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....
user avatar
1 vote
0 answers
251 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 ...
user avatar
  • 119
2 votes
1 answer
3k 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 ...
user avatar