2 ms·
I first learnt of network namespaces from configuring WireGuard. They offer a very neat way of ensuring all traffic uses your wg interface, in brief: - create
by OJFord 7y ago
I first learnt of network namespaces from configuring WireGuard. They offer a very neat way of ensuring all traffic uses your wg interface, in brief:
- create a new netns, call it 'physical' say
- move your physical device's interface to 'physical'
- create wg interface in 'physical'
- move wg interface to init ns
It works because it 'remembers' where it was created and remains bound to it for sending encrypted packets over the physical device, but is now the only interface available to processes by default (i.e. without a superuser making them use 'physical' ns directly).
Not long enough; want to read more: https://www.wireguard.com/netns https://www.wireguard.com/netns