{"id":10,"date":"2020-03-23T23:52:43","date_gmt":"2020-03-23T23:52:43","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=10"},"modified":"2020-03-28T22:54:52","modified_gmt":"2020-03-28T22:54:52","slug":"linux-network-namespaces","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2020\/03\/23\/linux-network-namespaces\/","title":{"rendered":"Linux Network Namespaces"},"content":{"rendered":"\n<p>At work, we use a vendor whose Network Operating System (NOS) is based in Linux. I am a network engineer so I was troubleshooting an issue inside a VRF. I couldn&#8217;t use much of the normal commands in the default VRF. So I opened a ticket with the vendor and learned a bit how the VRFs are implemented under the hoods. Obviously (not for me) they use Linux Namespaces, after googling the meaning of the commands they sent. My search brought me to the following links:<\/p>\n\n\n\n<p>This is a good intro:<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.scottlowe.org\/2013\/09\/04\/introducing-linux-network-namespaces\/\">https:\/\/blog.scottlowe.org\/2013\/09\/04\/introducing-linux-network-namespaces\/<\/a><\/p>\n\n\n\n<p>From this link, I took some examples in my quick search<\/p>\n\n\n\n<p><a href=\"https:\/\/kashyapc.fedorapeople.org\/virt\/openstack\/neutron\/neutron-diagnostics.txt\">https:\/\/kashyapc.fedorapeople.org\/virt\/openstack\/neutron\/neutron-diagnostics.txt<\/a><\/p>\n\n\n\n<p>At the end I used commands like these:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">$ sudo ip netns list\n$ sudo ip netns exec ns-INET ip link list\n$ sudo ip netns exec ns-VRF1 arp -a\n$ sudo ip netns exec ns-VRF1 route -n\n$ sudo ip netns exec ns-VRF1 telnet -b src_ip dst_ip port\n$ sudo ip netns exec ns-VRF1 tcpdump -i lo4 -nn  tcp 179\n$ sudo ip netns exec ns-VRF1 ss --tcp --info\n$ sudo ip netns exec ns-VRF1 ss --tcp --info -nt src IP<\/pre>\n\n\n\n<p>As well, &#8220;ss&#8221; is such a useful command for troubleshooting and I always feel that I dont make the most of it:<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-binarytides\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"K8Bx4k7wCU\"><a href=\"https:\/\/www.binarytides.com\/linux-ss-command\/\">10 examples of Linux ss command to monitor network connections<\/a><\/blockquote><iframe loading=\"lazy\" title=\"&#8220;10 examples of Linux ss command to monitor network connections&#8221; &#8212; BinaryTides\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"https:\/\/www.binarytides.com\/linux-ss-command\/embed\/#?secret=K8Bx4k7wCU\" data-secret=\"K8Bx4k7wCU\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>At work, we use a vendor whose Network Operating System (NOS) is based in Linux. I am a network engineer so I was troubleshooting an issue inside a VRF. I couldn&#8217;t use much of the normal commands in the default VRF. So I opened a ticket with the vendor and learned a bit how the &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2020\/03\/23\/linux-network-namespaces\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Linux Network Namespaces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,2],"tags":[],"class_list":["post-10","post","type-post","status-publish","format-standard","hentry","category-unix","category-networks"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":1,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"predecessor-version":[{"id":11,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/10\/revisions\/11"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}