{"id":714,"date":"2017-03-23T13:06:04","date_gmt":"2017-03-23T19:06:04","guid":{"rendered":"http:\/\/www.cavanaugh.pro\/sean\/?p=714"},"modified":"2017-03-30T12:52:40","modified_gmt":"2017-03-30T18:52:40","slug":"turning-on-all-cumulus-linux-interfaces","status":"publish","type":"post","link":"https:\/\/www.cavanaugh.pro\/sean\/turning-on-all-cumulus-linux-interfaces\/","title":{"rendered":"Turning on all Cumulus Linux interfaces"},"content":{"rendered":"<p>Cumulus Linux has a cool &#8216;feature&#8217; it inherited from Linux. &nbsp;On most network switches &nbsp;a port is either Layer2 or Layer3. &nbsp;When a port is&nbsp;layer2 it has to be part of a VLAN. &nbsp;Linux does understand and work with VLANs&nbsp;but it can have a port that is running at layer2 but not part of a VLAN. &nbsp;We can configure a port under \/etc\/network\/interfaces like this:<\/p>\n<pre>auto swp1\r\niface swp1\r\n<\/pre>\n<p>If we ifup this port its not part of a VLAN, and its not Layer3. &nbsp;<\/p>\n<p>Why would we want to do this? &nbsp;Honestly the most common reason is that we can check physical connections by using lldp before this port is part of a broadcast domain (VLAN) that could cause loops or unexpected behavior.<\/p>\n<p>What if I cabled a switch and don&#8217;t know what ports are connected? &nbsp;You could create a stanza for each swp like above, use something like <a href=\"https:\/\/support.cumulusnetworks.com\/hc\/en-us\/articles\/202868023-Configuring-etc-network-interfaces-with-Mako\">mako<\/a> or do a simple bash loop on the command line like this:<\/p>\n<pre>cumulus@leaf01:~$ for swp in {1..54}; do sudo ip link set swp$swp; done\r\n<\/pre>\n<p>Now all 54 ports are admin up at layer2 so we can check connections, but its not routing or switching. &nbsp;Now you can use a &#8220;net show int&#8221; or use the linux command &#8220;ip link show&#8221;<\/p>\n<pre>cumulus@leaf01:~$ ip link show | grep LOWER_UP\r\n1: lo: &lt;LOOPBACK,UP,LOWER_UP&gt; mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default\r\n2: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc mq master mgmt state UP mode DEFAULT group default qlen 1000\r\n11: swp9: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9216 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000\r\n51: swp49: &lt;BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP&gt; mtu 9216 qdisc pfifo_fast master peerlink state UP mode DEFAULT group default qlen 1000\r\n52: swp50: &lt;BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP&gt; mtu 9216 qdisc pfifo_fast master peerlink state UP mode DEFAULT group default qlen 1000\r\n53: swp51: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9216 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000\r\n54: swp52: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 9216 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000<\/pre>\n<p>You can even just use lldp here<\/p>\n<pre>cumulus@leaf01:~$ net show lldp\r\n\r\nLocal Port    Speed    Mode                 Remote Port    Remote  Host     Summary\r\n------------  -------  -------------  ----  -------------  ---------------  --------------------------\r\neth0          1G       Mgmt           ====  swp23          oob-mgmt-switch  IP: 10.50.100.100\/24(DHCP)\r\nswp9          10G      NotConfigured  ====  swp51          leaf07\r\nswp49         40G      NotConfigured  ====  swp49          exit02           \r\nswp50         40G      NotConfigured  ====  swp50          exit02           \r\nswp51         40G      NotConfigured  ====  swp30          spine01\r\nswp52         40G      NotConfigured  ====  swp30          spine02\r\n<\/pre>\n<p>Yay now we can go configure them now that we know how they are cabled up. Its great to be lazy \ud83d\ude42<\/p>\n<p>Update 3\/30\/2017<\/p>\n<p>The famous Daniel Walton (yeah the Daniel that has his name on <a href=\"https:\/\/tools.ietf.org\/html\/draft-walton-bgp-add-paths-06\">this<\/a>, <a href=\"https:\/\/tools.ietf.org\/id\/draft-walton-bgp-route-oscillation-stop-07.txt\">this<\/a> and my personal favorite <a href=\"https:\/\/tools.ietf.org\/html\/draft-walton-bgp-hostname-capability-00\">this<\/a>.) let me know that Cumulus Linux&#8217;s new NCLU (Network Command Line Utility) also has a method of doing this quickly.  <a href=\"https:\/\/twitter.com\/dwalton76\/status\/845036464773742593\">You can check out his tweet here.<\/a>  NCLU uses the net command and has the ability to do a range of ports really quickly.  One caveat vs using ip link set&#8230; this will make persistent config (meaning the ports are actually configured under \/etc\/network\/interfaces).  If you don&#8217;t want the config to remain you can do a &#8220;net del&#8221; then a &#8220;net commit&#8221;<\/p>\n<pre>\r\nnet add int swp1-54\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Cumulus Linux has a cool &#8216;feature&#8217; it inherited from Linux. &nbsp;On most network switches &nbsp;a port is either Layer2 or Layer3. &nbsp;When a port is&nbsp;layer2 it has to be part of a VLAN. &nbsp;Linux does understand and work with VLANs&nbsp;but it can have a port that is running at layer2 but not part of a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.cavanaugh.pro\/sean\/turning-on-all-cumulus-linux-interfaces\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Turning on all Cumulus Linux interfaces&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[6],"tags":[],"class_list":["post-714","post","type-post","status-publish","format-standard","hentry","category-networking"],"_links":{"self":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/714","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/comments?post=714"}],"version-history":[{"count":4,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/714\/revisions"}],"predecessor-version":[{"id":718,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/posts\/714\/revisions\/718"}],"wp:attachment":[{"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/media?parent=714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/categories?post=714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cavanaugh.pro\/sean\/wp-json\/wp\/v2\/tags?post=714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}