Skip to main content

Questions tagged [network-namespaces]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
23 views

Debian network namespace isolation

I have an AppImage which I need to run 3 instances of, concurrently. Each instance will use it's own profile (Home directory). That's all very easy: HOME=/home/user/home AppName.appimage Now the ...
rogerwhite's user avatar
1 vote
1 answer
69 views

Connecting two network namespaces over a bridge

I'm trying to make one network namespace to be able to ping another namespace via a bridge. Here are the commands I'm executing: # create two namespaces ip netns add ns0 ip netns add ns1 # create a ...
AhmedWas's user avatar
  • 247
0 votes
0 answers
23 views

How does k3s expose nodeports on linux?

I am investigating connectivity issues where k3s nodeport only accepts incommoding connections on one ip/interface but not on others. During this I realized that ports exposed using k3s nodeport do ...
Diydumbster's user avatar
0 votes
0 answers
12 views

Virtual interface pair forwarding packets to each other

The goal is very simple: anything sent to pair1, as outgoing packet, should appear on pair0 as an incoming packet and vice versa. I am thinking on a layer3-only, virtual interface now. tun could do ...
peterh's user avatar
  • 9,818
0 votes
0 answers
17 views

How to forward received data towards network namespace?

My goal is to forward received data to another pc. I have three devices (A, B and C) connected into the same network. A uses pyzmq to publish data in which B is subscribed. Then, B must send this ...
Raúl Parada Medina's user avatar
0 votes
1 answer
225 views

systemd Fails to Create Network Namespace after Debian Update

I'm running my own flavor of Debian (trixie, 6.1.0-9-amd64). I had set up a custom systemd service to establish a network namespace and route VPN traffic through it (which has worked flawlessly for ...
stevo1977's user avatar
2 votes
0 answers
157 views

Application does DNS outside of its Network Namespace?

I am using unshare to create a network namespace: unshare -rn bash I already have the a working setup with veth-interfaces as described in this guide: https://josephmuia.ca/2018-05-16-net-namespaces-...
Aykut's user avatar
  • 21
0 votes
1 answer
643 views

Running Application in Specific Network Namespace Without Sudo?

I am trying to run google-chrome with a specific network namespace, but when I do there is no audio. I run the command so that it is running in the network namespace as follows: sudo ip netns exec ...
Mark's user avatar
  • 11
0 votes
0 answers
81 views

Port forwarding socks5 proxy across network namespaces

I've finally set up the netns veth openvpn connection that works, made overrides to systemd service files so openvpn depended on netns single shot service and tor of openvpn service. Tor works, at ...
Xle6yWek's user avatar
  • 103
3 votes
1 answer
597 views

Separate network namespaces for different users?

I'm running Arch Linux on a laptop. What I want to achieve: Multiple users When each user logs in on a tty (which could be while another user is logged in on another tty---they're all me), they're in ...
user747267's user avatar
1 vote
0 answers
103 views

How to forward packets between net namespaces?

I have a lima VM with linux running Ubuntu 23.04 with kernel 6.2 and cgroupsv2. This VM is meant to serve as docker host. When I create docker network in this VM I get an interface in its own ...
Patryk's user avatar
  • 14.2k
2 votes
1 answer
90 views

Redirecting locally originated traffic with DNAT in OUTPUT chain not working as expected

I am having a dumb, and I am hoping you lovely people can jumpstart my brain. I am running a service in a local network namespace. The namespace looks like this: # ip -n ns1 addr 1: lo: <LOOPBACK,...
larsks's user avatar
  • 35.7k
2 votes
1 answer
368 views

Root network namespace as transit between 2 other net namespaces

I am trying to communicate between two network namespaces that are connected through the root namespaces using veth pairs as seen in the diagram. I am unable to perform a ping from netns A to netns B. ...
Rahul Raj Purohit's user avatar
1 vote
0 answers
65 views

Pipewire sound card hijacked by netns

I sometimes run my browser in a VPN netns, like this: sudo ip netns exec vpnns sudo -u myuser google-chrome & This works great, except sometimes it seems that the netns "steals" the ...
Thomas's user avatar
  • 218
2 votes
2 answers
1k views

How to use network namespaces for vpn split tunneling

My aim is to route the default namespace through my vpn, and create a new namespace which does not route through the vpn (so i can selectively launch programs that should not have access to the remote ...
Neurofibromin's user avatar
1 vote
0 answers
185 views

How to firewall a network namespace using firewalld?

I'm running fedora 36 using firewalld as my firewall. I set up a network namespace called "wireguard". It contains the interface wg0 which connects to Mullvad VPN. I set it up like this: ip ...
minamikoarikui's user avatar
2 votes
1 answer
2k views

What is the difference between using Linux VRF, network namespaces and using different routing tables?

The ip-vrf manual reads : A VRF provides traffic isolation at layer 3 for routing, similar to how a VLAN is used to isolate traffic at layer 2. Fundamentally, a VRF is a separate routing table. At ...
Rêve's user avatar
  • 21
0 votes
0 answers
190 views

Forward traffic from public IP to namespace

I have two VMs VM-A & VM-B connected via IPIP Tunnel in a namespace. I want the application in VM-B which is under namespace to be accessed from the public IP of VM-C. Can someone help me how can ...
ph3ro's user avatar
  • 378
1 vote
0 answers
103 views

Wireguard to endpoint Inside a Namespace

I have three VM's. VM-A,VM-B & VM-X. I have a application running on the backend server VM-X. VM-A is the Main frontend server which has high capacity. VM-B is just a standby server of low ...
ph3ro's user avatar
  • 378
0 votes
1 answer
768 views

Ubuntu 22.04 netns with veth connected to bridge unable to ping gateway

Hey guys this is probably just something stupid I'm missing, but I'm having trouble setting up a net namespace to use for my VPN. The weird part is that this script/setup was working, and has suddenly ...
samikool's user avatar
1 vote
0 answers
155 views

Prevent network namespaces / lxd-bridges from talking to each other, but keep internet access?

Following goal: I have lxd containers each set of containers should have their dedicated isolated network each should still be able to connect to the internet (e.g. apt update or curl), but not leak ...
stackbox's user avatar
0 votes
0 answers
464 views

socat streaming UDP is slower than TCP

I'm currently using subprocess.run(["socat", f"udp-listen:{_to},fork,reuseaddr,bind=127.0.0.1", f"""exec:'sudo ip netns exec {netns} socat STDIO "UDP-connect:...
DrownedSuccess's user avatar
0 votes
1 answer
181 views

How can i map multiple ports in systemd-nspawn container?

I'm writing a container manager script which depends on nspawn, and the container is using a Virtual Ethernet Connection(-n opt). but it looks like that nspawn only support port mapping for single ...
Tsing Kwai's user avatar
1 vote
1 answer
247 views

If ports are unpriviledged, why can't I access them if I am root in a namespace?

I've run sudo sysctl -w net.ipv4.ip_unprivileged_port_start=1. However, sudo ip netns exec myvpn unshare -r python -m http.server -b 127.0.0.1 2 does not work. Strangely enough, this does: sudo ip ...
DrownedSuccess's user avatar
1 vote
0 answers
16 views

Advertising VXLAN learned MACs into a different namespace

I would like to run a l2 evpn (vxlan) bgp speaker in a different namespace and advertise the learned addresses into another namespace. In building the following topology, the BGP daemon populates the ...
Alex Turner's user avatar
2 votes
1 answer
1k views

Linux packet mark across network namespaces

I am trying to use iptables to packet mark packets of a certain source/destination IP in the mangle table on a given host. The packets are later forwarded to a particular network namespace on the same ...
Alexander. C's user avatar
0 votes
0 answers
1k views

How do I start a Docker container in custom network namespace?

How do I make docker run to setns to the network namespace of my choice when starting a container? I want something like --net host mode, but aiming to the namespace of Docker server itself. Or should ...
Vi.'s user avatar
  • 5,813
2 votes
0 answers
516 views

Docker overlay network connection between containers lags simetimesin multiples of 1s

Two containers talking to each other on overlay network with high traffic (connection frequency) occasionally got connection lag almost exact multiple of 1s. It doesn't matter whether it is same host ...
DevilaN's user avatar
  • 1,976
0 votes
1 answer
113 views

How can I copy $BASHPID in bash script?

I have a network namespace and I want to run command with this netns bash pid, how can I do it in bash script? Code example: sudo ip netns add ns1 #this is my network namespace #In separate shell I ...
Spams's user avatar
  • 3
0 votes
1 answer
1k views

How to connect Linux network namespace with other VM using internal network?

I have two Virtual Machnes (VM) in Virtualbox connected with internal network. On the first one I have network namespace named n0. I want to connect this namespace to network interface and finally ...
Spams's user avatar
  • 3
3 votes
1 answer
1k views

Capture DNS traffic to and from a network namespace using tshark

How can I capture traffic specifically from a network interface inside a network namespace using tshark? In my case, the network interface tun0 is moved into the network namespace called vpn. Normally ...
EarthIsHome's user avatar
0 votes
0 answers
220 views

Runing libreoffice from network namespace session?

I am using Ubuntu Mate: $ echo $DESKTOP_SESSION; cat /etc/issue; uname -a; mate Ubuntu 20.04.4 LTS \n \l Linux mypc 5.4.0-104-generic #118-Ubuntu SMP Wed Mar 2 19:02:41 UTC 2022 x86_64 x86_64 x86_64 ...
sdaau's user avatar
  • 6,818
3 votes
1 answer
1k views

IPv6 forwarding doesn't work in a network namespace

I have 3 Linux VMs connected like this: / server1 \ | ens19 2001:1::2 | \ / | / \ | ens19 2001:1::1 | | ...
Chris's user avatar
  • 33
0 votes
1 answer
828 views

Can't access directory from netns

I created a simple test netns : sudo ip netns add test Then I brought up the lo interface. I'm currently in the home directory of user1, and by executing sudo ip netns exec test ls -la I see all the ...
eric's user avatar
  • 1
2 votes
2 answers
596 views

Is cgroup a type of namespace?

Is cgroup a type of namespace? I am asking this because I have seen blogs talking as if cgroup and namespaces are different. However, in different linux commands , cgroup is considered as a type of ...
Ahmad Ismail's user avatar
  • 2,688
4 votes
1 answer
2k views

How can I use a bind mount in a network namespace?

I have an app I run in a network namespace. This works well. I want to run the app multiple times, in different namespaces. For convenience, I want to bind mount the app's working directory to ...
sea chub's user avatar
  • 205
0 votes
0 answers
1k views

Bridging between network namespaces using tun or tap devices

I am trying to create two tap interfaces which are connected via a userspace program which should be able to see (and later modify) all packets going over the "wire". While this works when I ...
tim0s42's user avatar
0 votes
1 answer
1k views

To persist a namespace, create a bind mount point on which /proc/PID?

From https://man7.org/linux/man-pages/man1/n.1.html : By default, a new namespace remains in existence only as long as it has at least one member process. A namespace can be made persistent— that ...
Carlos Vazquez's user avatar
1 vote
1 answer
1k views

Can't establish communication between two network namespaces using bridge network

I'm following this video about network namespaces in Linux, and trying to practice it myself, but for some reason it doesn't work. What I've done is: After creating 2 network namespaces named "...
YoavKlein's user avatar
  • 362
0 votes
1 answer
312 views

How to use VXLAN to connect netns under multiple subnets like K8S's Flannel?

I have used $ ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ group 239.1.1.1 \ dev enp0s8 and $ ip link add vxlan0 type vxlan \ id 42 \ dstport 4789 \ ...
RyuRyu's user avatar
  • 1
1 vote
1 answer
3k views

How to move interface into nonstandard network namespace as unprivileged user

I have a Linux network namespace bind mounted at ~/mynamespace as follows: unshare -mrn; touch ~/mynamespace; # executed in the console opened by the first command unshare --net=~/mynamespace true; # ...
user54978635's user avatar
1 vote
1 answer
2k views

IP forwarding in linux namespaces

I am currently trying to simulate a network using network namespaces under Linux. I have already set up the nodes and connected them, and they can ping each other, one hop at a time. But I am really ...
ObiBabobi's user avatar
2 votes
1 answer
1k views

How to setup veth with 9000 MTU to simulate sending and receiving large UDP multicast packets on the same host?

The sender needs to transmit large data packets to the receiver (which is on the same host with 1500 MTU) and I think this can be simulated using veth with 9000 MTU, from my reading on it. But I'm not ...
Anand's user avatar
  • 23
0 votes
1 answer
333 views

ip netns exec cannot start ONLY mate-terminal and gnome-terminal?

I am using the newns script from here: https://superuser.com/questions/983727/route-only-specific-traffic-through-vpn ... except on this system: $ mate-about -v MATE Desktop Environment 1.24.0 $ cat /...
sdaau's user avatar
  • 6,818
0 votes
0 answers
197 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 ...
Cart.AT's user avatar
1 vote
2 answers
980 views

How to set up stateless NAT for two UDP connections from a global network to special network namespace?

There is the requirement to set up a stateless NAT for two UDP connections from a physical network adapter in global network namespace via a linked pair of virtual network adapters to a service ...
Mofi's user avatar
  • 111
2 votes
2 answers
1k 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....
markonius's user avatar
  • 357
2 votes
1 answer
587 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 ...
Fil. Christou's user avatar
4 votes
0 answers
3k 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 ...
cj8scrambler's user avatar
3 votes
2 answers
1k 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/...
cryptarch's user avatar
  • 1,280