ip link set veth1 netns testns

Category: Local Network & Public Hosting

ip link set veth1 netns testns

Move one veth end into a namespace

This slides the veth1 end of a virtual cable into the testns namespace, leaving veth0 on the host, which connects the two network stacks. Assign addresses on both ends, for example 10.0.0.1 and 10.0.0.2, and bring the links up before traffic can flow. This is the classic recipe for namespace-based testing.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.