{"id":181,"date":"2025-09-10T15:05:35","date_gmt":"2025-09-10T14:05:35","guid":{"rendered":"https:\/\/horrillo.eu\/?p=181"},"modified":"2025-09-16T08:56:17","modified_gmt":"2025-09-16T07:56:17","slug":"crear-un-bonding-con-vlan-en-rhel-9-4","status":"publish","type":"post","link":"https:\/\/horrillo.eu\/?p=181","title":{"rendered":"Crear un bonding LACP con VLAN en RHEL 9.4"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Mi experiencia, creando mi primer bonding<\/p>\n<\/blockquote>\n\n\n\n<p>Creaci\u00f3n de un bonding con dos vlan en RHEL 9.4, usando nmcli.<\/p>\n\n\n\n<p>Cosas importantes antes de empezar:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>SOLO PUEDE HABER UN GATEWAY (en grande, que yo siempre la lio)<\/li>\n\n\n\n<li>Hay que indicar el <strong>hash policy<\/strong> si nuestro switch usa una capa superior al 2.<\/li>\n<\/ol>\n\n\n\n<p>Vamos a empezar, lo primero es crear el bonding principal de d\u00f3nde colgar\u00e1n todos:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection add type bond con-name bond1 ifname bond1 bond.options \"mode=802.3ad,miimon=1000\"<\/code><\/pre>\n\n\n\n<p>mode &#8211;&gt; Modo del bond (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb).<br>El modo 802.3ad es el <strong>Link Aggregation Control Protocol (LACP)<\/strong>, permite combinar m\u00faltiples interfaces de red f\u00edsicas en un solo enlace l\u00f3gico para mejorar el rendimiento y proporcionar redundancia.<br>miimon &#8211;&gt; Intervalo en ms para chequear el estado del enlace (ej. 1000).<\/p>\n\n\n\n<p>Como no lo queremos por DHCP y tampoco usaremos IPV6, lo indicamos de la siguiente manera:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond1 ipv4.method disable \nnmcli connection modify bond1 ipv6.method ignore<\/code><\/pre>\n\n\n\n<p>Ahora le indicamos el hash policy de conexi\u00f3n con el switch y las opciones de lacp:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond1 +bond.options \u201clacp_rate=1\" \nnmcli connection modify bond1 +bond.options \"xmit_hash_policy=layer3+4\"<\/code><\/pre>\n\n\n\n<p>lacp_rate &#8211;&gt; 1 (modo r\u00e1pido, env\u00eda LACPDU cada 1 segundo. Si queremos modo lento, pondremos 0. Env\u00eda LACPDU cada 30 segundos.<br>xmit_hash_policy &#8211;&gt; Indica el m\u00e9todo de distribuci\u00f3n de tr\u00e1fico entre las interfaces f\u00edsicas que forman parte del bonding. <\/p>\n\n\n\n<p>Layer 3 (capa de red): Direcci\u00f3n IP de origen y destino<br>Layer 4 (capa de transporte): Puerto TCP\/UDP de origen y destino.<br>Con estas opciones, el sistema calcula un hash usando IP y puertos del tr\u00e1fico, y lo usa para decidir por cu\u00e1l interfaz f\u00edsica enviar cada flujo.<\/p>\n\n\n\n<p>Si no indicas nada, por defecto el bonding se crea con layer 2. La mayor\u00eda de switch solo permiten layer 2.<\/p>\n\n\n\n<p>Ahora a\u00f1adiremos las tarjetas de red que formar\u00e1n el bonding, en mi caso, dos:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection add type ethernet con-name bond1-slave1 ifname ens2f1np1 master bond1 \nnmcli connection add type ethernet con-name bond1-slave2 ifname ens5f1np1 master bond1<\/code><\/pre>\n\n\n\n<p>Ahora crearemos la VLAN que colgar\u00e1 del bonding (bond1) y que har\u00e1 uso de las tarjetas de red, la VLAN tiene que coincidir con la VLAN del switch y tener el puerto configurado en modo trunk:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection add type vlan con-name bond1-vlan606 ifname bond1.606 vlan.parent bond1 vlan.id 606<\/code><\/pre>\n\n\n\n<p>Como no queremos tener DHCP, asignamos ip manual al VLAN de la siguiente manera:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond1-vlan606 ipv4.address '10.47.232.116\/23' ipv4.gateway '10.47.232.1' ipv4.method manual<\/code><\/pre>\n\n\n\n<p>RECORDAR!!! SOLO PUEDE HABER UN GATEWAY CONFIGURADO EN LAS CONEXIONES DE RED!!! Si creamos otra VLAN, con nombre bond1-vlan900, esta VLAN tendr\u00e1 que ir sin gateway!!<\/p>\n\n\n\n<p>Ahora vamos a habilitar las conexiones para el autoarranque, en principio, el bond1 levantar\u00eda todas las dem\u00e1s, pero es una configuraci\u00f3n que no molesta tener:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection modify bond1 connection.autoconnect yes \nnmcli connection modify bond1-slave1 connection.autoconnect yes \nnmcli connection modify bond1-slave2 connection.autoconnect yes \nnmcli connection modify bond1-vlan606 connection.autoconnect yes<\/code><\/pre>\n\n\n\n<p>Activamos todas las conexiones:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmcli connection up bond1 \nnmcli connection up bond1-slave1\nnmcli connection up bond1-slave2 \nnmcli connection up bond1-vlan606<\/code><\/pre>\n\n\n\n<p>Si el router est\u00e1 bien configurado, ya deber\u00eda funcionar todo.<\/p>\n\n\n\n<p>Podemos confirmar el estado mirando:<br><strong>cat \/proc\/net\/bonding\/bond1<\/strong><br>Aqui podemos ver el estado del bonding.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)<\/p>\n\n\n\n<p>Bonding Mode: IEEE 802.3ad Dynamic link aggregation<br>Transmit Hash Policy: layer3+4 (2)<br>MII Status: up<br>MII Polling Interval (ms): 1000<br>Up Delay (ms): 0<br>Down Delay (ms): 0<\/p>\n\n\n\n<p>802.3ad info<br>LACP rate: fast<br>Aggregator selection policy (ad_select): stable<br>Active Aggregator Info:<br>Aggregator ID: 1<br>Number of ports: 2<br>Actor Key: 17<br>Partner Key: 1<br>Partner Mac Address: 00:11:22:33:44:55<\/p>\n\n\n\n<p>Slave Interface: ens2f1np1<br>MII Status: up<br>Speed: 1000 Mbps<br>Duplex: full<br>Link Failure Count: 0<br>Permanent HW addr: 00:aa:bb:cc:dd:01<br>Aggregator ID: 1<\/p>\n\n\n\n<p>Slave Interface: ens5f1np1<br>MII Status: up<br>Speed: 1000 Mbps<br>Duplex: full<br>Link Failure Count: 0<br>Permanent HW addr: 00:aa:bb:cc:dd:02<br>Aggregator ID: 1<\/p>\n<\/blockquote>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mi experiencia, creando mi primer bonding Creaci\u00f3n de un bonding con dos vlan en RHEL 9.4, usando nmcli. Cosas importantes antes de empezar: Vamos a empezar, lo primero es crear el bonding principal de d\u00f3nde colgar\u00e1n todos: mode &#8211;&gt; Modo del bond (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb).El modo 802.3ad es el Link Aggregation [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6],"tags":[9,14],"class_list":["post-181","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-red"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog<\/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:\/\/horrillo.eu\/?p=181\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog\" \/>\n<meta property=\"og:description\" content=\"Mi experiencia, creando mi primer bonding Creaci\u00f3n de un bonding con dos vlan en RHEL 9.4, usando nmcli. Cosas importantes antes de empezar: Vamos a empezar, lo primero es crear el bonding principal de d\u00f3nde colgar\u00e1n todos: mode &#8211;&gt; Modo del bond (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb).El modo 802.3ad es el Link Aggregation [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/horrillo.eu\/?p=181\" \/>\n<meta property=\"og:site_name\" content=\"Mi blog\" \/>\n<meta property=\"article:published_time\" content=\"2025-09-10T14:05:35+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-09-16T07:56:17+00:00\" \/>\n<meta name=\"author\" content=\"Juan Antonio Horrillo de Haro\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Juan Antonio Horrillo de Haro\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tiempo de lectura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/horrillo.eu\/?p=181#article\",\"isPartOf\":{\"@id\":\"https:\/\/horrillo.eu\/?p=181\"},\"author\":{\"name\":\"Juan Antonio Horrillo de Haro\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\"},\"headline\":\"Crear un bonding LACP con VLAN en RHEL 9.4\",\"datePublished\":\"2025-09-10T14:05:35+00:00\",\"dateModified\":\"2025-09-16T07:56:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/horrillo.eu\/?p=181\"},\"wordCount\":527,\"commentCount\":1,\"keywords\":[\"Linux\",\"Red\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/horrillo.eu\/?p=181#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/horrillo.eu\/?p=181\",\"url\":\"https:\/\/horrillo.eu\/?p=181\",\"name\":\"Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog\",\"isPartOf\":{\"@id\":\"https:\/\/horrillo.eu\/#website\"},\"datePublished\":\"2025-09-10T14:05:35+00:00\",\"dateModified\":\"2025-09-16T07:56:17+00:00\",\"author\":{\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\"},\"breadcrumb\":{\"@id\":\"https:\/\/horrillo.eu\/?p=181#breadcrumb\"},\"inLanguage\":\"es\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/horrillo.eu\/?p=181\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/horrillo.eu\/?p=181#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Portada\",\"item\":\"https:\/\/horrillo.eu\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Crear un bonding LACP con VLAN en RHEL 9.4\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/horrillo.eu\/#website\",\"url\":\"https:\/\/horrillo.eu\/\",\"name\":\"Mi blog\",\"description\":\"Blog de inform\u00e1tica\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/horrillo.eu\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"es\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec\",\"name\":\"Juan Antonio Horrillo de Haro\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"es\",\"@id\":\"https:\/\/horrillo.eu\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g\",\"caption\":\"Juan Antonio Horrillo de Haro\"},\"url\":\"https:\/\/horrillo.eu\/?author=3\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog","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:\/\/horrillo.eu\/?p=181","og_locale":"es_ES","og_type":"article","og_title":"Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog","og_description":"Mi experiencia, creando mi primer bonding Creaci\u00f3n de un bonding con dos vlan en RHEL 9.4, usando nmcli. Cosas importantes antes de empezar: Vamos a empezar, lo primero es crear el bonding principal de d\u00f3nde colgar\u00e1n todos: mode &#8211;&gt; Modo del bond (balance-rr, active-backup, balance-xor, broadcast, 802.3ad, balance-tlb, balance-alb).El modo 802.3ad es el Link Aggregation [&hellip;]","og_url":"https:\/\/horrillo.eu\/?p=181","og_site_name":"Mi blog","article_published_time":"2025-09-10T14:05:35+00:00","article_modified_time":"2025-09-16T07:56:17+00:00","author":"Juan Antonio Horrillo de Haro","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Juan Antonio Horrillo de Haro","Tiempo de lectura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/horrillo.eu\/?p=181#article","isPartOf":{"@id":"https:\/\/horrillo.eu\/?p=181"},"author":{"name":"Juan Antonio Horrillo de Haro","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec"},"headline":"Crear un bonding LACP con VLAN en RHEL 9.4","datePublished":"2025-09-10T14:05:35+00:00","dateModified":"2025-09-16T07:56:17+00:00","mainEntityOfPage":{"@id":"https:\/\/horrillo.eu\/?p=181"},"wordCount":527,"commentCount":1,"keywords":["Linux","Red"],"articleSection":["Linux"],"inLanguage":"es","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/horrillo.eu\/?p=181#respond"]}]},{"@type":"WebPage","@id":"https:\/\/horrillo.eu\/?p=181","url":"https:\/\/horrillo.eu\/?p=181","name":"Crear un bonding LACP con VLAN en RHEL 9.4 - Mi blog","isPartOf":{"@id":"https:\/\/horrillo.eu\/#website"},"datePublished":"2025-09-10T14:05:35+00:00","dateModified":"2025-09-16T07:56:17+00:00","author":{"@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec"},"breadcrumb":{"@id":"https:\/\/horrillo.eu\/?p=181#breadcrumb"},"inLanguage":"es","potentialAction":[{"@type":"ReadAction","target":["https:\/\/horrillo.eu\/?p=181"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/horrillo.eu\/?p=181#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Portada","item":"https:\/\/horrillo.eu\/"},{"@type":"ListItem","position":2,"name":"Crear un bonding LACP con VLAN en RHEL 9.4"}]},{"@type":"WebSite","@id":"https:\/\/horrillo.eu\/#website","url":"https:\/\/horrillo.eu\/","name":"Mi blog","description":"Blog de inform\u00e1tica","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/horrillo.eu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"es"},{"@type":"Person","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/56d9626d9bb38bf236909b6750326bec","name":"Juan Antonio Horrillo de Haro","image":{"@type":"ImageObject","inLanguage":"es","@id":"https:\/\/horrillo.eu\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/79ee3e66414c28cf98f6cc347c7ef785b422e524406a3103c77ee923bdc738e8?s=96&d=mm&r=g","caption":"Juan Antonio Horrillo de Haro"},"url":"https:\/\/horrillo.eu\/?author=3"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/181","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=181"}],"version-history":[{"count":7,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions"}],"predecessor-version":[{"id":191,"href":"https:\/\/horrillo.eu\/index.php?rest_route=\/wp\/v2\/posts\/181\/revisions\/191"}],"wp:attachment":[{"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/horrillo.eu\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}