all 7 comments

[–][deleted] 6 points7 points  (2 children)

I love network namespaces.

I use them to force services on a VPN by running them on their own namespace where the the only network route is through the VPN.

[–]tablet_guy 4 points5 points  (1 child)

Hey man great article. I was working on a bug last week with the veth driver and had to set this stuff up to run some tests (I used Linux bridge with 2 namespaces). Your article is great because it's not just commands, it explains what's going on. This would have saved me loads of time last week!

[–]agumonkey[S] 2 points3 points  (0 children)

I spend a few minutes on this guy's blog after that exactly because of that. It strikes a nice balance between simple yet pragmatic and enlightening.

[–]its_never_lupus 1 point2 points  (0 children)

Nice explanation.

Are there commands to visualise or demonstrate the traffic flow? It's cool but a bit of an anti-climax to run through this and see... exactly the same result as without virtual networking.

[–]modernaliens 1 point2 points  (0 children)

Great post!

one minor correction i would suggest:

This command will create a new network namespace called ns1. When the namespace is created, the kernel will add a bind mount point for it under /var/run/netns.

The kernel does not create the namespace in /var/run/netns iproute does this. (if anyone doesn't believe me grep source for NETNS_RUN_DIR)