Where to start First steps track · 15 stages
Linux Labs

The veth pair and network namespaces

cheat sheet · Ubuntu 24.04 · iproute2 https://lab.dimsanych.ru/en/wiki/veth/

Cheat sheet

  • sudo ip netns add lab-client a new namespace
  • ip netns list which namespaces exist
  • sudo ip link add lab1 type veth peer lab0 a veth pair: lab1 <-> lab0
  • sudo ip link set lab0 netns lab-client one end into the namespace
  • sudo ip -n lab-client address add 192.0.3.10/24 dev lab0
  • sudo ip -n lab-client link set lab0 up ip inside the namespace
  • sudo ip netns exec lab-client ping -c 2 192.0.2.1 any program there
  • sudo ip -n lab-client -br link the namespace's interfaces
  • sudo ip netns delete lab-client delete with its end
Loading…