{"id":507,"date":"2017-07-06T09:56:11","date_gmt":"2017-07-06T15:56:11","guid":{"rendered":"http:\/\/jmcristobal.com.mx\/?p=507"},"modified":"2022-03-27T00:11:35","modified_gmt":"2022-03-27T07:11:35","slug":"macro-switchport-host","status":"publish","type":"post","link":"https:\/\/jmcristobal.com\/es\/2017\/07\/06\/macro-switchport-host\/","title":{"rendered":"Macro switchport host &#8211; Cisco IOS"},"content":{"rendered":"<p>Hace unos d\u00edas al estar configurando los puertos de un switch y revisando el funcionamiento de STP, me encontr\u00e9 en la CLI el comando \"switchport host\", al investigar un poco sobre el funcionamiento de \u00e9ste, pude corroborar que se trata de una macro, ahora bien \u00bfqu\u00e9 es una macro?<br><br>Cisco dice que \"una macro es un conjunto de comandos que se pueden ejecutar en la CLI. Las macros no contienen nuevos comandos CLI, simplemente es un grupo de comandos CLI ya existentes\".<br><br>Entonces \"switchport host\" se utiliza para la configuraci\u00f3n en capa 2 de un puerto del switch, este comando hace tres cosas:<\/p>\n\n\n\n<ol><li>Configura el puerto en modo acceso<\/li><li>Habilita spanning-tree portfast<\/li><li>Deshabilita Etherchannel<\/li><\/ol>\n\n\n\n<p>Es una macro a tener en cuenta debido a los comandos que utiliza, esta macro nos puede ahorrar tiempo en la administraci\u00f3n de switches Cisco.<br><br>Ojo! este comando no funciona en un puerto que este modo route, es decir, para los puertos de los switches de capa 3 es necesario que el puerto ya est\u00e9 en modo switchport, de caso contrario les mandar\u00e1 un mensaje como este \"Command rejected: Gi0\/1 not a switching port\". <em>&#8220;Command rejected: Gi0\/1 not a switching port&#8221;.<\/em><br><br>Ejemplo, configurar con \"switchport host\" los primeros 10 puertos de un switch:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"adoc\" class=\"language-adoc\">jmcristobal# conf t\njmcristobal(config)# interface range g0\/1 - 10\njmcristobal(config-if-range)# switchport host\n switchport mode will be set to access\n spanning-tree portfast will be enabled\n channel group will be disabled\njmcristobal(config-if-range)#<\/code><\/pre>\n\n\n\n<p>Para quitar el comando es:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code lang=\"adoc\" class=\"language-adoc\">jmcristobal(config-if)# no switchport host<\/code><\/pre>\n\n\n\n<p><span data-preserver-spaces=\"true\">Esta macro se introdujo desde la versi\u00f3n 4.0(0)N1(1a) del Cisco IOS.<\/span><\/p>\n\n\n\n<p><strong><span data-preserver-spaces=\"true\">Note:<\/span><\/strong><span data-preserver-spaces=\"true\">&nbsp;El comando no est\u00e1 disponible en el simulador Packet Tracer (versi\u00f3n 7.0.0.0306).<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>A few days ago, when I was configuring the ports of a switch and reviewing the operation of STP, I found in <\/p>","protected":false},"author":2,"featured_media":1392,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[233],"tags":[280,281,327,340,356,381,422,427,428],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v19.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Macro switchport host - Cisco IOS - JMCristobal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Macro switchport host - Cisco IOS - JMCristobal\" \/>\n<meta property=\"og:description\" content=\"A few days ago, when I was configuring the ports of a switch and reviewing the operation of STP, I found in\" \/>\n<meta property=\"og:url\" content=\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\" \/>\n<meta property=\"og:site_name\" content=\"JMCristobal\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/web.facebook.com\/JMCristobalHomepage\" \/>\n<meta property=\"article:published_time\" content=\"2017-07-06T15:56:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-03-27T07:11:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/d1gdqjscev06po.cloudfront.net\/wp-content\/uploads\/2022\/01\/RS.png\" \/>\n\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t<meta property=\"og:image:height\" content=\"206\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"JMCristobal\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@jmcristobalhome\" \/>\n<meta name=\"twitter:site\" content=\"@jmcristobalhome\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"JMCristobal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\"},\"author\":{\"name\":\"JMCristobal\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/e7cca8371cd491cf444cc824f30ae118\"},\"headline\":\"Macro switchport host &#8211; Cisco IOS\",\"datePublished\":\"2017-07-06T15:56:11+00:00\",\"dateModified\":\"2022-03-27T07:11:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\"},\"wordCount\":222,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization\"},\"keywords\":[\"cisco\",\"cli\",\"host\",\"ios\",\"macro\",\"portfast\",\"spanning-tree\",\"switch\",\"switchport\"],\"articleSection\":[\"Enterprise Infrastructure\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\",\"url\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\",\"name\":\"Macro switchport host - Cisco IOS - JMCristobal\",\"isPartOf\":{\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#website\"},\"datePublished\":\"2017-07-06T15:56:11+00:00\",\"dateModified\":\"2022-03-27T07:11:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Macro switchport host &#8211; Cisco IOS\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#website\",\"url\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/\",\"name\":\"JMCristobal\",\"description\":\"Networking and more\",\"publisher\":{\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"es\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization\",\"name\":\"JMCristobal\",\"url\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/jmcristobal.com\/wp-content\/uploads\/2021\/09\/Logo-JMCristobal.png\",\"contentUrl\":\"https:\/\/jmcristobal.com\/wp-content\/uploads\/2021\/09\/Logo-JMCristobal.png\",\"width\":518,\"height\":436,\"caption\":\"JMCristobal\"},\"image\":{\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.youtube.com\/JMCristobalHomepage\",\"https:\/\/web.facebook.com\/JMCristobalHomepage\",\"https:\/\/twitter.com\/jmcristobalhome\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/e7cca8371cd491cf444cc824f30ae118\",\"name\":\"JMCristobal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b549739a2a57394801aef27a76efdb3d?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b549739a2a57394801aef27a76efdb3d?s=96&d=mm&r=g\",\"caption\":\"JMCristobal\"},\"url\":\"https:\/\/jmcristobal.com\/es\/author\/jmcristobal\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Macro switchport host - Cisco IOS - JMCristobal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/","og_locale":"es_ES","og_type":"article","og_title":"Macro switchport host - Cisco IOS - JMCristobal","og_description":"A few days ago, when I was configuring the ports of a switch and reviewing the operation of STP, I found in","og_url":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/","og_site_name":"JMCristobal","article_publisher":"https:\/\/web.facebook.com\/JMCristobalHomepage","article_published_time":"2017-07-06T15:56:11+00:00","article_modified_time":"2022-03-27T07:11:35+00:00","og_image":[{"width":350,"height":206,"url":"https:\/\/d1gdqjscev06po.cloudfront.net\/wp-content\/uploads\/2022\/01\/RS.png","type":"image\/png"}],"author":"JMCristobal","twitter_card":"summary_large_image","twitter_creator":"@jmcristobalhome","twitter_site":"@jmcristobalhome","twitter_misc":{"Escrito por":"JMCristobal","Tiempo de lectura":"2 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#article","isPartOf":{"@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/"},"author":{"name":"JMCristobal","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/e7cca8371cd491cf444cc824f30ae118"},"headline":"Macro switchport host &#8211; Cisco IOS","datePublished":"2017-07-06T15:56:11+00:00","dateModified":"2022-03-27T07:11:35+00:00","mainEntityOfPage":{"@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/"},"wordCount":222,"commentCount":0,"publisher":{"@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization"},"keywords":["cisco","cli","host","ios","macro","portfast","spanning-tree","switch","switchport"],"articleSection":["Enterprise Infrastructure"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/","url":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/","name":"Macro switchport host - Cisco IOS - JMCristobal","isPartOf":{"@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#website"},"datePublished":"2017-07-06T15:56:11+00:00","dateModified":"2022-03-27T07:11:35+00:00","breadcrumb":{"@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/d1gdqjscev06po.cloudfront.net\/es\/2017\/07\/06\/macro-switchport-host\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/"},{"@type":"ListItem","position":2,"name":"Macro switchport host &#8211; Cisco IOS"}]},{"@type":"WebSite","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#website","url":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/","name":"JMCristobal","description":"Networking and more","publisher":{"@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"es"},{"@type":"Organization","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#organization","name":"JMCristobal","url":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/","logo":{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/logo\/image\/","url":"https:\/\/jmcristobal.com\/wp-content\/uploads\/2021\/09\/Logo-JMCristobal.png","contentUrl":"https:\/\/jmcristobal.com\/wp-content\/uploads\/2021\/09\/Logo-JMCristobal.png","width":518,"height":436,"caption":"JMCristobal"},"image":{"@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.youtube.com\/JMCristobalHomepage","https:\/\/web.facebook.com\/JMCristobalHomepage","https:\/\/twitter.com\/jmcristobalhome"]},{"@type":"Person","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/e7cca8371cd491cf444cc824f30ae118","name":"JMCristobal","image":{"@type":"ImageObject","inLanguage":"es","@id":"http:\/\/ec2-52-7-70-250.compute-1.amazonaws.com\/es\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b549739a2a57394801aef27a76efdb3d?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b549739a2a57394801aef27a76efdb3d?s=96&d=mm&r=g","caption":"JMCristobal"},"url":"https:\/\/jmcristobal.com\/es\/author\/jmcristobal\/"}]}},"jetpack_featured_media_url":"https:\/\/jmcristobal.com\/wp-content\/uploads\/2022\/01\/RS.png","_links":{"self":[{"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/posts\/507"}],"collection":[{"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/comments?post=507"}],"version-history":[{"count":16,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/posts\/507\/revisions"}],"predecessor-version":[{"id":1804,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/posts\/507\/revisions\/1804"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/media\/1392"}],"wp:attachment":[{"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/media?parent=507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/categories?post=507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jmcristobal.com\/es\/wp-json\/wp\/v2\/tags?post=507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}