Merge pull request #259 from manuelver/feature/translateES-07
This commit is contained in:
commit
40840ba6c8
BIN
2022/es/Days/Images/Day20_Linux9.png
Normal file
BIN
2022/es/Days/Images/Day20_Linux9.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 497 KiB |
Binary file not shown.
Before Width: | Height: | Size: 502 KiB |
@ -1,27 +1,29 @@
|
||||
#! /usr/bin/bash
|
||||
if [ -z "${1}" ]
|
||||
then
|
||||
echo "What is your intended username?"
|
||||
echo "¿Qué nombre de usuario quieres?\n"
|
||||
read username
|
||||
echo "What is your password"
|
||||
read password
|
||||
echo "¿Cuál es el password?"
|
||||
echo "(Cuando teclees no se verá nada por aquí)\n"
|
||||
read -s password
|
||||
|
||||
#A user can be passed in as a command line argument
|
||||
echo "$username user account being created."
|
||||
# Un usuario puede ser pasado como un argumento en la línea de comandos
|
||||
echo "\nSe está creando la cuenta de usuario $username\n"
|
||||
|
||||
#A user is created with the name of command line argument
|
||||
# Se crea un usuario con el nombre del argumento.
|
||||
sudo useradd -m $username
|
||||
|
||||
#A password can be parsed in as a command line argument.
|
||||
# Se puede pasar una contraseña como argumento en la línea de comandos.
|
||||
# Se establece la contraseña para el usuario.
|
||||
sudo chpasswd <<< $username:$password
|
||||
|
||||
sleep 2
|
||||
echo "If you want to delete the user then pass 'del' and username in command line argument. e.g: ./create-user.sh del username"
|
||||
echo "Si quieres borrar el usuario entonces pasa 'del' y nombre de usuario en el argumento de la línea de comandos. e.g: ./create-user.sh del username"
|
||||
|
||||
else
|
||||
sudo userdel -rf "${2}"
|
||||
sleep 2
|
||||
echo "${2} user account successfully deleted."
|
||||
echo "La cuenta de usuario ${2} se ha eliminado con éxito."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -273,5 +273,6 @@ Entonces, si todo está configurado correctamente, podrá acceder a través de s
|
||||
- [Learn the Linux Fundamentals - Part 1](https://www.youtube.com/watch?v=kPylihJRG70)
|
||||
- [Linux for hackers (don't worry you don't need to be a hacker!)](https://www.youtube.com/watch?v=VbEx7B_PTOE)
|
||||
- [Webminal](https://www.webminal.org/)
|
||||
- [Guía básica de Vim](https://gitea.vergaracarmona.es/man-linux/Guia-VIM)
|
||||
|
||||
Nos vemos en el [Día 19](day19.md).
|
||||
|
@ -1,56 +1,93 @@
|
||||
## Automate tasks with bash scripts
|
||||
## Automatizar tareas con scripts bash
|
||||
|
||||
The shell that we are going to use today is the bash but we will cover another shell tomorrow when we dive into ZSH.
|
||||
El shell que vamos a ver hoy es el bash pero cubriremos otro shell mañana: ZSH.
|
||||
|
||||
BASH - **B**ourne **A**gain **Sh**ell
|
||||
|
||||
We could almost dedicate a whole section of 7 days to shell scripting much like the programming languages, bash gives us the capability of working alongside other automation tools to get things done.
|
||||
Casi podríamos dedicar una sección entera de 7 días a los scripts de shell al igual que los lenguajes de programación, bash nos da la capacidad de trabajar junto a otras herramientas de automatización para hacer las cosas.
|
||||
|
||||
I still speak to a lot of people who have set up some complex shell scripts to make something happen and they rely on this script for some of the most important things in the business, I am not saying we need to understand shell/bash scripting for this purpose, this is not the way. But we should learn shell/bash scripting to work alongside our automation tools and for ad-hoc tasks.
|
||||
Mucha gente ha llegado a configurar scripts de shell realmente complejos para hacer que suceda algo. Algunas cosas muy importantes en los negocios dependen de scripts. No necesitaremos entender al completo el shell/bash scripting para este propósito, que nunca está de más, pero este no es el camino que cogeremos. Lo que sí que haremos es aprender lo básico de shell/bash scripting para trabajar junto a nuestras herramientas de automatización y para tareas ad-hoc.
|
||||
|
||||
An example of this that we have used in this section could be the VAGRANTFILE we used to create our VM, we could wrap this into a simple bash script that deleted and renewed this every Monday morning so that we have a fresh copy of our Linux VM every week, we could also add all the software stack that we need on said Linux machine and so on all through this one bash script.
|
||||
Un ejemplo de esto podría ser el VAGRANTFILE que usamos para crear nuestra MV. Podríamos envolver esto en un simple script bash que borrara y renovara esto cada lunes por la mañana para que tengamos una copia fresca de nuestra MV Linux cada semana. También podríamos añadir toda la pila de software que necesitamos en dicha máquina Linux y así hacerlo todo a través de un único script bash, una única orden.
|
||||
|
||||
I think another thing I am at least hearing is that hands-on scripting questions are becoming more and more apparent in all lines of interviews.
|
||||
Otra cosa es que las preguntas sobre scripts prácticos son cada vez más frecuentes en las entrevistas para los puestos relacionados con la Administración de sistemas, entornos cloud y filosofía DevOps.
|
||||
|
||||
### Getting started
|
||||
Vamos a darle duro que tenemos mucho por delante en el día de hoy.
|
||||
### Empecemos
|
||||
|
||||
As with a lot of things we are covering in this whole 90 days, the only real way to learn is through doing. Hands-on experience is going to help soak all of this into your muscle memory.
|
||||
Como con otros conceptos que estamos cubriendo en estos 90 días, la única manera real de aprender es prácticando. No os quedéis tan solo leyendo estas lineas y dando el capítulo como hecho. La experiencia práctica va a ayudar a empapar todo esto en tu memoria muscular, aunque tardes algunos días más merece la pena que practiques todo lo que puedas.
|
||||
|
||||
First of all, we are going to need a text editor. On [Day 17](day17.md) we covered probably the two most common text editors and a little on how to use them.
|
||||
Para empezar vamos a necesitar un editor de texto. En el [Día 17](day17.md) cubrimos los dos editores de texto más comunes y un poco sobre cómo usarlos. (Espero que hayas visto más por tu cuenta ;)
|
||||
|
||||
Let's get straight into it and create our first shell script.
|
||||
Vamos a ponernos manos a la obra y a crear nuestro primer script de shell. Así, en frío, creamos un archivo.
|
||||
|
||||
`touch 90DaysOfDevOps.sh`
|
||||
```shell
|
||||
touch 90DaysOfDevOps.sh
|
||||
```
|
||||
|
||||
Followed by `nano 90DaysOfDevOps.sh` this will open our new blank shell script in nano. Again you can choose your text editor of choice here.
|
||||
Y lo abrimos con el editor nano (El preferido de los valencianos).
|
||||
|
||||
The first line of all bash scripts will need to look something like this `#!/usr/bin/bash` this is the path to your bash binary.
|
||||
```shell
|
||||
nano 90DaysOfDevOps.sh
|
||||
```
|
||||
|
||||
You should however check this in the terminal by running `which bash` if you are not using Ubuntu then you might also try `whereis bash` from the terminal.
|
||||
Esto abrirá nuestro nuevo shell script en blanco en nano. De nuevo, puedes elegir el editor de texto que prefieras.
|
||||
|
||||
However, you may see other paths listed in already created shell scripts which could include:
|
||||
La primera línea de todos los scripts bash deberá ser algo así
|
||||
|
||||
```bash
|
||||
#!/usr/bin/bash
|
||||
```
|
||||
Esta es la ruta a tu binario bash. Esta línea conocida como `SHEBANG`, `HASHBANG` o `SHARPBANG`, conseguiréis llamar o indicar que intérprete de comandos o consola de sistema, debe ejecutar o interpretar este script.
|
||||
|
||||
Sin embargo, deberías comprobarlo en el terminal ejecutando
|
||||
|
||||
```shell
|
||||
which bash
|
||||
```
|
||||
|
||||
Este comando nos permitirá ver la ubicación del binario.
|
||||
|
||||
Si no estás usando Ubuntu y sigues perdiendo el tiempo con Sistemas Operativos privativos, entonces también podrías intentar
|
||||
|
||||
```shell
|
||||
whereis bash
|
||||
```
|
||||
|
||||
Sin embargo, puede ver otras rutas listadas en scripts de shell ya creados que podrían incluir:
|
||||
|
||||
- `#!/bin/bash`
|
||||
- `#!/usr/bin/env bash`
|
||||
|
||||
In the next line in our script, I like to add a comment and add the purpose of the script or at least some information about me. You can do this by using the `#` This allows us to comment on particular lines in our code and provide descriptions of what the upcoming commands will be doing. I find the more notes the better for the user experience especially if you are sharing this.
|
||||
En la siguiente línea de nuestro script, lo ideal es añadir un comentario explicando el propósito del script o al menos alguna información para quien venga detrás. Que puedes ser tú mismo en un par de semanas, así que explicatelo para tí, pero como si tuvieses alzheimer. Los comentarios en los scripts son con almohadilla: `#`. Esto nos permite comentar líneas particulares en nuestro fichero para que no afecten al código. Se utiliza para proporcionar descripciones de los comandos, del flujo del código, información del autor, mención a fuentes, etc. Como comenté antes, es indispensable si se comparte esto.
|
||||
|
||||
I sometimes use figlet, a program we installed earlier in the Linux section to create some asci art to kick things off in our scripts.
|
||||
figlet, el programa que instalamos en días anteriores, sirve para crear arte asci, el cual queda muy vistoso para iniciar scripts.
|
||||
|
||||

|
||||
|
||||
All of the commands we have been through earlier in this Linux section ([Day15](day15.md)) could be used here as a simple command to test our script.
|
||||
Todos los comandos que repasamos en el [Día 15](día15.md) podrían usarse en los scripts como un simple comando para probar.
|
||||
|
||||
Let's add a simple block of code to our script.
|
||||
Añadamos un simple bloque de código a nuestro script.
|
||||
|
||||
```
|
||||
```bash
|
||||
mkdir 90DaysOfDevOps
|
||||
cd 90DaysOfDevOps
|
||||
touch Day19
|
||||
ls
|
||||
```
|
||||
|
||||
You can then save this and exit your text editor, if we run our script with `./90DaysOfDevOps.sh` you should get a permission denied message. You can check the permissions of this file using the `ls -al` command and you can see highlighted we do not have executable rights on this file.
|
||||
Luego puedes guardar esto y salir de tu editor de texto, si ejecutamos el script con
|
||||
|
||||
```shell
|
||||
./90DaysOfDevOps.sh
|
||||
```
|
||||
|
||||
deberías obtener un mensaje de permiso denegado. Puedes comprobar los permisos de este fichero usando el comando
|
||||
|
||||
```shell
|
||||
ls -al
|
||||
```
|
||||
y podrás ver resaltado que no tenemos derechos ejecutables sobre este fichero.
|
||||
|
||||

|
||||
|
||||
@ -58,46 +95,58 @@ We can change this using `chmod +x 90DaysOfDevOps.sh` and then you will see the
|
||||
|
||||

|
||||
|
||||
Now we can run our script again using `./90DaysOfDevOps.sh` after running the script has now created a new directory, changed into that directory and then created a new file.
|
||||
Podemos cambiar esto usando
|
||||
|
||||
```shell
|
||||
chmod +x 90DaysOfDevOps.sh
|
||||
```
|
||||
y entonces verás la `x` que significa que ahora podemos ejecutar nuestro script.
|
||||
|
||||

|
||||
|
||||
Pretty basic stuff but you can start to see hopefully how this could be used to call on other tools as part of ways to make your life easier and automate things.
|
||||
Bastante básico, pero puedes empezar a ver cómo esto lo puedes utilizar para llamar a otras herramientas para hacer tu vida más fácil y automatizar las cosas.
|
||||
|
||||
### Variables, Conditionals
|
||||
### Variables, Condicionales
|
||||
|
||||
A lot of this section is a repeat of what we covered when we were learning Golang but I think it's worth us diving in here again.
|
||||
Gran parte de esta sección es una repetición de lo que vimos aprendiendo [Golang](day11.md), pero vale la pena que lo repasemos de nuevo para asentar conocimientos.
|
||||
|
||||
- ### Variables
|
||||
#### Variables
|
||||
|
||||
Variables enable us to define once a particular repeated term that is used throughout a potentially complex script.
|
||||
Las variables nos permiten definir un término particular que se utiliza varias veces a lo largo de un script. Sirve para simplificar el código que puede ser potencialmente complejo.
|
||||
|
||||
To add a variable you simply add it like this to a clean line in your script.
|
||||
|
||||
`challenge="90DaysOfDevOps"`
|
||||
|
||||
This way when and where we use `$challenge` in our code, if we change the variable it will be reflected throughout.
|
||||
|
||||

|
||||
|
||||
If we now run our `sh` script you will see the printout that was added to our script.
|
||||
|
||||

|
||||
|
||||
We can also ask for user input that can set our variables using the following:
|
||||
Es muy simple declarar una variable, añádela con una línea limpia en el script.
|
||||
|
||||
```bash
|
||||
challenge="90DaysOfDevOps"
|
||||
```
|
||||
|
||||
De esta forma, donde usemos `$challenge` estaremos dando el valor de la variable y si cambiamos este valor de la variable se reflejará en todos los lugares donde la hayamos usado.
|
||||
|
||||

|
||||
|
||||
Si ahora ejecutamos nuestro script `sh` veremos la impresión que se ha añadido a nuestro script.
|
||||
|
||||

|
||||
|
||||
También podemos pedir un input del usuario para que establezca el valor de la variables utilizando lo siguiente:
|
||||
|
||||
```bash
|
||||
echo "Enter your name"
|
||||
read name
|
||||
```
|
||||
|
||||
This would then define the input as the variable `$name` We could then use this later on.
|
||||
Esto definiría la variable `$name`. Con lo que podemos utilizar este valor más adelante.
|
||||
|
||||
- ### Conditionals
|
||||
#### Condicionales
|
||||
|
||||
Maybe we want to find out who we have on our challenge and how many days they have completed, we can define this using `if` `if-else` `else-if` conditionals, this is what we have defined below in our script.
|
||||
Para saber a quién tenemos en nuestro reto y cuántos días han completado, podemos ayudarnos con los condicionales
|
||||
- `if`
|
||||
- `if-else`
|
||||
- `else-if`,
|
||||
|
||||
```
|
||||
Atentos al siguiente código.
|
||||
|
||||
```bash
|
||||
#!/bin/bash
|
||||
# ___ ___ ____ ___ __ ____ ___
|
||||
# / _ \ / _ \| _ \ __ _ _ _ ___ / _ \ / _| _ \ _____ __/ _ \ _ __ ___
|
||||
@ -107,7 +156,7 @@ Maybe we want to find out who we have on our challenge and how many days they ha
|
||||
# |___/ |_|
|
||||
#
|
||||
# This script is to demonstrate bash scripting!
|
||||
|
||||
#
|
||||
# Variables to be defined
|
||||
|
||||
ChallengeName=#90DaysOfDevOps
|
||||
@ -132,25 +181,25 @@ else
|
||||
fi
|
||||
```
|
||||
|
||||
You can also see from the above that we are running some comparisons or checking values against each other to move on to the next stage. We have different options here worth noting.
|
||||
Puedes ver que estamos realizando algunas comparaciones o comprobando valores entre sí. Aquí tenemos diferentes opciones que vale la pena destacar.
|
||||
|
||||
- `eq` - if the two values are equal will return TRUE
|
||||
- `ne` - if the two values are not equal will return TRUE
|
||||
- `gt` - if the first value is greater than the second value will return TRUE
|
||||
- `ge` - if the first value is greater than or equal to the second value will return TRUE
|
||||
- `lt` - if the first value is less than the second value will return TRUE
|
||||
- `le` - if the first value is less than or equal to the second value will return TRUE
|
||||
- `eq` - si los dos valores son iguales devolverá TRUE
|
||||
- `ne` - si los dos valores no son iguales devolverá TRUE
|
||||
- `gt` - si el primer valor es mayor que el segundo valor devolverá TRUE
|
||||
- `ge` - si el primer valor es mayor o igual que el segundo valor devolverá TRUE
|
||||
- `lt` - si el primer valor es menor que el segundo valor devolverá TRUE
|
||||
- `le` - si el primer valor es menor o igual que el segundo valor devolverá TRUE
|
||||
|
||||
We might also use bash scripting to determine information about files and folders, this is known as file conditions.
|
||||
También podemos usar scripts bash para determinar información sobre archivos y carpetas, esto se conoce como condiciones de archivo.
|
||||
|
||||
- `-d file` True if the file is a directory
|
||||
- `-e file` True if the file exists
|
||||
- `-f file` True if the provided string is a file
|
||||
- `-g file` True if the group id is set on a file
|
||||
- `-r file` True if the file is readable
|
||||
- `-s file` True if the file has a non-zero size
|
||||
- `-d file` TRUE si el fichero es un directorio
|
||||
- `-e file` TRUE si el fichero existe
|
||||
- `-f file` TRUE si la cadena proporcionada es un fichero
|
||||
- `-g file` TRUE si el id de grupo está establecido en un fichero
|
||||
- `-r file` TRUE si el fichero es legible
|
||||
- `-s file` TRUE si el fichero tiene un tamaño distinto de cero
|
||||
|
||||
```
|
||||
```bash
|
||||
FILE="90DaysOfDevOps.txt"
|
||||
if [ -f "$FILE" ]
|
||||
then
|
||||
@ -162,92 +211,128 @@ fi
|
||||
|
||||

|
||||
|
||||
Providing we have that file still in our directory we should get the first echo command back. But if we remove that file then we should get the second echo command.
|
||||
Siempre que tengamos ese archivo todavía en nuestro directorio deberíamos obtener el primer comando echo. Pero si eliminamos ese archivo entonces deberíamos obtener el segundo comando echo del script.
|
||||
|
||||

|
||||
|
||||
You can hopefully see how this can be used to save you time when searching through a system for specific items.
|
||||
Esto puede ser utilizado para ahorrar mucho tiempo al buscar en un sistema elementos específicos.
|
||||
|
||||
I found this amazing repository on GitHub that has what seems to be an endless amount of scripts [DevOps Bash Tools](https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/README.md)
|
||||
Este repositorio tiene lo que parece ser una interminable cantidad de scripts que puedes probar: [DevOps Bash Tools](https://github.com/HariSekhon/DevOps-Bash-tools/blob/master/README.md)
|
||||
|
||||
### Example
|
||||
#### Ejemplo
|
||||
|
||||
**Scenario**: We have our company called "90DaysOfDevOps" and we have been running a while and now it is time to expand the team from 1 person to lots more over the coming weeks, I am the only one so far that knows the onboarding process so we want to reduce that bottleneck by automating some of these tasks.
|
||||
*Escenario*:
|
||||
|
||||
**Requirements**:
|
||||
Tenemos nuestra empresa llamada "90DaysOfDevOps" funcionando desde hace un tiempo y ahora queremos ampliar el equipo de 1 persona a muchas más. Yo soy el único hasta ahora que conoce el proceso de incorporación por lo que queremos reducir ese cuello de botella mediante la automatización de algunas tareas.
|
||||
|
||||
- A user can be passed in as a command line argument.
|
||||
- A user is created with the name of the command line argument.
|
||||
- A password can be parsed as a command line argument.
|
||||
- The password is set for the user
|
||||
- A message of successful account creation is displayed.
|
||||
*Requisitos*:
|
||||
|
||||
Let's start with creating our shell script with `touch create_user.sh`
|
||||
- Un usuario puede ser pasado como argumento en la línea de comandos.
|
||||
- Se crea un usuario con el nombre del argumento.
|
||||
- Se puede pasar una contraseña como argumento en la línea de comandos.
|
||||
- Se establece la contraseña para el usuario.
|
||||
- Se muestra un mensaje de éxito en la creación de cuenta.
|
||||
|
||||
Before we move on let's also make this executable using `chmod +x create_user.sh`
|
||||
|
||||
then we can use `nano create_user.sh` to start editing our script for the scenario we have been set.
|
||||
|
||||
We can take a look at the first requirement "A user can be passed in as a command line argument" we can use the following
|
||||
Comencemos creando nuestro script de shell con
|
||||
|
||||
```shell
|
||||
touch create_user.sh
|
||||
```
|
||||
|
||||
Antes de continuar hagámoslo ejecutable usando
|
||||
|
||||
```shell
|
||||
chmod +x create_user.sh
|
||||
```
|
||||
|
||||
Para empezar a editar nuestro script para el escenario planteado podemos usar
|
||||
|
||||
```shell
|
||||
nano create_user.sh
|
||||
```
|
||||
|
||||
O también vim, según cuál sea nuestro editor preferido.
|
||||
|
||||
```shell
|
||||
vim create_user.sh
|
||||
```
|
||||
|
||||
Podemos echar un vistazo al primer requisito "Un usuario puede ser pasado como un argumento en la línea de comandos". Podemos usar lo siguiente
|
||||
|
||||
```bash
|
||||
#! /usr/bin/bash
|
||||
|
||||
#A user can be passed in as a command line argument
|
||||
# Un usuario puede ser pasado como un argumento en la línea de comandos
|
||||
echo "$1"
|
||||
```
|
||||
|
||||

|
||||
|
||||
Go ahead and run this using `./create_user.sh Michael` replace Michael with your name when you run the script.
|
||||
Ejecuta este script utilizando
|
||||
|
||||
```shell
|
||||
./create_user.sh Michael
|
||||
```
|
||||
|
||||
Veremos como sustituye el valor de la variable impresa con `echo` por el argumento que le hemos dado.
|
||||
|
||||

|
||||
|
||||
Next up we can take that second requirement "A user is created with the name of command line argument" this can be done with the `useradd` command. The `-m` option is to create the user home directory as /home/username
|
||||
A continuación podemos tomar ese segundo requisito "Se crea un usuario con el nombre del argumento" esto se puede hacer con el comando `useradd`. La opción `-m` es para crear el directorio home del usuario como /home/nombredeusuario
|
||||
|
||||
```
|
||||
```bash
|
||||
#! /usr/bin/bash
|
||||
|
||||
#A user can be passed in as a command line argument
|
||||
# Un usuario puede ser pasado como un argumento en la línea de comandos
|
||||
echo "$1 user account being created."
|
||||
|
||||
#A user is created with the name of the command line argument
|
||||
# Se crea un usuario con el nombre del argumento.
|
||||
sudo useradd -m "$1"
|
||||
|
||||
```
|
||||
|
||||
Warning: If you do not provide a user account name then it will error as we have not filled the variable `$1`
|
||||
⚠️ *Cuidado: Si no proporcionas un nombre de cuenta de usuario entonces dará error ya que la variable `$1` no tiene valor.*
|
||||
|
||||
We can then check this account has been created with the `awk -F: '{ print $1}' /etc/passwd` command.
|
||||
Podemos comprobar que esta cuenta ha sido creada con el comando
|
||||
|
||||
```shell
|
||||
awk -F: '{ print $1}' /etc/passwd
|
||||
```
|
||||
|
||||

|
||||
|
||||
Our next requirement is "A password can be parsed as a command line argument." First of all, we are not going to ever do this in production it is more for us to work through a list of requirements in the lab to understand.
|
||||
Nuestros siguientes requisitos son "Se puede pasar una contraseña como argumento en la línea de comandos" y "Se establece la contraseña para el usuario".
|
||||
|
||||
```
|
||||
⚠️ *Cuidado: Nunca vamos a hacer esto en producción, las contraseñas nunca deben pasar por la línea de comando ni por un script ya que quedan expuestas y puede ser un vector de ataque. Siempre pasarán por un proceso previo de codificación y encriptación. Esto solo lo hacemos para la practica de añadir argumentos que gestione el script con las variables.*
|
||||
|
||||
```bash
|
||||
#! /usr/bin/bash
|
||||
|
||||
#A user can be passed in as a command line argument
|
||||
# Un usuario puede ser pasado como un argumento en la línea de comandos
|
||||
echo "$1 user account being created."
|
||||
|
||||
#A user is created with the name of the command line argument
|
||||
# Se crea un usuario con el nombre del argumento.
|
||||
sudo useradd -m "$1"
|
||||
|
||||
#A password can be parsed as a command line argument.
|
||||
# Se puede pasar una contraseña como argumento en la línea de comandos.
|
||||
# Se establece la contraseña para el usuario.
|
||||
sudo chpasswd <<< "$1":"$2"
|
||||
```
|
||||
|
||||
If we then run this script with the two parameters `./create_user.sh 90DaysOfDevOps password`
|
||||
Si luego ejecutamos este script con los dos parámetros
|
||||
|
||||
You can see from the below image that we executed our script it created our user and password and then we manually jumped into that user and confirmed with the `whoami` command.
|
||||
```shell
|
||||
./create_user.sh 90DaysOfDevOps password
|
||||
```
|
||||
|
||||
Podéis ver en la siguiente imagen que creó nuestro usuario y contraseña. Luego entramos a ese usuario y confirmamos quien era el usuario activo con `whoami`.
|
||||
|
||||

|
||||
|
||||
The final requirement is "A message of successful account creation is displayed." We already have this in the top line of our code and we can see on the above screenshot that we have a `90DaysOfDevOps user account being created` shown. This was left from our testing with the `$1` parameter.
|
||||
El requisito final es "Se muestra un mensaje de éxito en la creación de cuenta." ya lo tenemos en la línea superior del código y podemos ver en la captura de pantalla anterior que muestra `90DaysOfDevOps user account being created`. Esto se quedó de las pruebas con el parámetro `$1`.
|
||||
|
||||
Now, this script can be used to quickly onboard and set up new users on to our Linux systems. But maybe instead of a few of the historic people having to work through this and then having to get other people their new usernames or passwords we could add some user input that we have previously covered earlier on to capture our variables.
|
||||
Ahora, este script puede ser utilizado para integrar y configurar rápidamente nuevos usuarios en nuestros sistemas Linux. Pero para que quede más vistoso y lo pueda utilizar cualquiera, podemos añadir la entrada de usuario y password mediante lo que vimos anteriormente. Mira como queda el código de bonico.
|
||||
|
||||
```
|
||||
```bash
|
||||
#! /usr/bin/bash
|
||||
|
||||
echo "What is your intended username?"
|
||||
@ -255,39 +340,51 @@ read username
|
||||
echo "What is your password"
|
||||
read password
|
||||
|
||||
#A user can be passed in as a command line argument
|
||||
echo "$username user account being created."
|
||||
# Un usuario puede ser pasado como un argumento en la línea de comandos
|
||||
echo "$1 user account being created."
|
||||
|
||||
#A user is created with the name of the command line argument
|
||||
sudo useradd -m $username
|
||||
# Se crea un usuario con el nombre del argumento.
|
||||
sudo useradd -m "$1"
|
||||
|
||||
# Se puede pasar una contraseña como argumento en la línea de comandos.
|
||||
# Se establece la contraseña para el usuario.
|
||||
sudo chpasswd <<< "$1":"$2"
|
||||
|
||||
# Se muestra un mensaje de éxito en la creación de cuenta.
|
||||
echo "The Account for $username has successfully been created"
|
||||
|
||||
#A password can be parsed as a command line argument.
|
||||
sudo chpasswd <<< $username:$password
|
||||
```
|
||||
|
||||
With the steps being more interactive,
|
||||
Así los pasos son más interactivos,
|
||||
|
||||

|
||||
|
||||
Just to finish this off maybe we do want to output a successful output to say that our new user account has finished being created.
|
||||
Para terminar, podemos dar un output de éxito para confirmar que la nueva cuenta de usuario se ha creado.
|
||||
|
||||

|
||||
|
||||
One thing I did notice was that we are displaying the password on our input we can hide this by using the `-s` flag in the line of code `read -s password`
|
||||
Un detalle más sería ocultar la entrada de la contraseña con el flag `-s` en la línea de código
|
||||
|
||||
```bash
|
||||
read -s password
|
||||
```
|
||||
|
||||

|
||||
|
||||
If you do want to delete the user you have created for lab purposes then you can do that with `sudo userdel test_user`
|
||||
Además, podríamos borrar el usuario creado con
|
||||
|
||||
[Example Script](Linux/create-user.sh)
|
||||
```bash
|
||||
sudo userdel test_user
|
||||
```
|
||||
Podéis ver el [Script completo](Linux/create-user.sh) con los comentarios y las impresiones en pantalla traducidas al castellano.
|
||||
|
||||
Once again I am not saying this is going to be something that you do create in your day to day but it was something I thought of that would highlight the flexibility of what you could use shell scripting for.
|
||||
Una vez más, esto no es algo que vayas a utilizar en el día a día, pero forma parte de la base necesaria para cuando lo necesites. Además, pone de manifiesto la flexibilidad que proporciona el shell scripting.
|
||||
|
||||
Think about any repeatable tasks that you do every day or week or month and how could you better automate that, first option is likely going to be using a bash script before moving into more complex territory.
|
||||
Piensa en las tareas repetitivas que haces todos los días y cómo podrías automatizarlas, la primera opción probablemente sea usar un script bash,pero existen territorios complejos, así que a practicar, practicar y practicar.
|
||||
|
||||
I have created a very simple bash file that helps me spin up a Kubernetes cluster using minikube on my local machine along with data services and Kasten K10 to help demonstrate the requirements and needs around data management. [Project Pace](https://github.com/MichaelCade/project_pace/blob/main/singlecluster_demo.sh) But I did not feel this appropriate to raise here as we have not covered Kubernetes yet.
|
||||
Para último ejemplo, echad un vistazo a este simple bash que ayuda a levantar un clúster Kubernetes usando minikube en una máquina local, junto con los servicios de datos y Kasten K10 para ayudar a demostrar los requisitos y necesidades en torno a la gestión de datos: [Project Pace](https://github.com/MichaelCade/project_pace/blob/main/singlecluster_demo.sh) Quizá sea muy avanazado ya que no hemos visto Kubernetes todavía, pero puede ayudar a ver posibilidades del scripting.
|
||||
|
||||
## Resources
|
||||
## Recursos
|
||||
|
||||
- [Bash in 100 seconds](https://www.youtube.com/watch?v=I4EWvMFj37g)
|
||||
- [Bash script with practical examples - Full Course](https://www.youtube.com/watch?v=TPRSJbtfK4M)
|
||||
@ -297,5 +394,7 @@ I have created a very simple bash file that helps me spin up a Kubernetes cluste
|
||||
- [Vim tutorial](https://www.youtube.com/watch?v=IiwGbcd8S7I)
|
||||
- [Learn the Linux Fundamentals - Part 1](https://www.youtube.com/watch?v=kPylihJRG70)
|
||||
- [Linux for hackers (don't worry you don't need to be a hacker!)](https://www.youtube.com/watch?v=VbEx7B_PTOE)
|
||||
- [Webminal](https://www.webminal.org/)
|
||||
- [Guía básica de Vim](https://gitea.vergaracarmona.es/man-linux/Guia-VIM)
|
||||
|
||||
See you on [Day20](day20.md)
|
||||
Nos vemos en el [Día 20](day20.md).
|
||||
|
@ -1,102 +1,146 @@
|
||||
## Dev workstation setup - All the pretty things
|
||||
## Configuración de la estación de trabajo de desarrollo - Todas las cosas bonitas
|
||||
|
||||
Not to be confused with us setting Linux servers up this way but I wanted to also show off the choice and flexibility that we have within the Linux desktop.
|
||||
No debemos confundirnos la configuración de servidores Linux con la de escritorio, pero es relevante mostrar la elección y la flexibilidad que podemos tener en el escritorio Linux.
|
||||
|
||||
I have been using a Linux Desktop for almost a year now and I have it configured just the way I want from a look and feel perspective. Using our Ubuntu VM on Virtual Box we can run through some of the customisations I have made to my daily driver.
|
||||
El autor, estuvo usando un escritorio Linux durante casi un año y su configuración muestra una perspectiva de apariencia especializada para el trabajo SysAdmin. Podemos probar en la máquina virtual de Ubuntu en Virtual Box, para poder ver algunas de estas personalizaciones. El traductor lleva más de 10 años en entornos Linux así que algún aporte encontraréis en la versión en castellano.
|
||||
|
||||
I have put together a YouTube video walking through the rest as some people might be able to better follow along:
|
||||
Vídeo en YouTube para quien quiera seguirlo por esta vía (Clicar en imagen):
|
||||
|
||||
[](https://youtu.be/jeEslAtHfKc)
|
||||
|
||||
Out of the box, our system will look something like the below:
|
||||
Recordemos, nuestro Ubuntu 20.04 en Virtual box se verá algo así:
|
||||
|
||||

|
||||
|
||||
We can also see our default bash shell below,
|
||||
También podemos ver el shell bash por defecto a continuación:
|
||||
|
||||

|
||||
|
||||
A lot of this comes down to dotfiles something we will cover in this final Linux session of the series.
|
||||
Mucho de esto se reduce a dotfiles algo que cubriremos en esta última sesión de Linux de nuestro viaje 90DaysOfDevOps.
|
||||
|
||||
### dotfiles
|
||||
|
||||
First up I want to dig into dotfiles, I have said on a previous day that Linux is made up of configuration files. These dotfiles are configuration files for your Linux system and applications.
|
||||
Primero vamos a profundizar en los dotfiles. Linux está hecho de archivos de configuración de sistema y de aplicaciones, los llamados dotfiles.
|
||||
|
||||
I will also add that dotfiles are not just used to customise and make your desktop look pretty, there are also dotfile changes and configurations that will help you with productivity.
|
||||
Los dotfiles no sólo se usan para personalizar y hacer que se vea más bonito tu escritorio, también hay cambios y configuraciones de dotfiles que te ayudarán con la productividad añadiendo funcionalidades o quitando, si prefieres el minimalismo.
|
||||
|
||||
As I mentioned many software programs store their configurations in these dotfiles. These dotfiles assist in managing functionality.
|
||||
La mayoría del software que encontrarás para Linux almacenana sus configuraciones en estos dotfiles. Cada dotfile comienza con un punto `.` para que permanezcan ocultos y no incurrir en error.
|
||||
|
||||
Each dotfile starts with a `.` You can probably guess where the naming came from?
|
||||
|
||||
So far we have been using bash as our shell which means you will have a .bashrc and .bash_profile in our home folder. You can see below a few dotfiles we have on our system.
|
||||
Hasta ahora hemos estado utilizando bash como nuestro shell. Pues bien, bash tiene varios archivos de configuración en nuestra carpeta `$HOME`: .bashrc y .bash_profile . A continuación puedes ver algunos dotfiles que tenemos en nuestro sistema recién instalado.
|
||||
|
||||

|
||||
|
||||
We are going to be changing our shell, so we will later be seeing a new `.zshrc` configuration dotfile.
|
||||
Vamos a cambiar nuestro shell por zsh, así que más adelante veremos un nuevo dotfile de configuración `.zshrc`.
|
||||
|
||||
But now you know if we refer to dotfiles you know they are configuration files. We can use them to add aliases to our command prompt as well as paths to different locations. Some people publish their dotfiles so they are publicly available. You will find mine here on my GitHub [MichaelCade/dotfiles](https://github.com/MichaelCade/dotfiles) here you will find my custom `.zshrc` file, my terminal of choice is terminator which also has some configuration files in the folder and then also some background options.
|
||||
Ahora ya sabes que si nos referimos a dotfiles estamos hablando de los archivos de configuración. Por ejemplo, los de shell, podemos utilizarlos para añadir alias a nuestro símbolo del sistema, así como rutas a diferentes ubicaciones. Algunas personas publican sus dotfiles para que estén disponibles públicamente. Encontrarás el del autor, Michael Cade, en [MichaelCade/dotfiles](https://github.com/MichaelCade/dotfiles) con el archivo personalizado `.zshrc`. La terminal escogida, Terminator, también tiene algunos archivos de configuración en la carpeta y también algunas opciones de fondo.
|
||||
|
||||
Por otra parte, el traductor también tiene publicada la configuración de la shell en [gitea.vergaracarmona.es/man-linux/zsh-shell](https://gitea.vergaracarmona.es/man-linux/zsh-shell). Aquí encontrarás otra forma de personalizar, cada uno debe buscar su comodidad. En este caso también se usa zsh con Oh my zsh y la terminal [Tilix](https://github.com/gnunn1/tilix).
|
||||
|
||||
### ZSH
|
||||
|
||||
As I mentioned throughout our interactions so far we have been using a bash shell the default shell with Ubuntu. ZSH is very similar but it does have some benefits over bash.
|
||||
Como hemos mencionado, hasta ahora hemos estado usando un shell bash que es el que viene por defecto con Ubuntu. ZSH es muy similar pero tiene algunos beneficios sobre bash.
|
||||
|
||||
Zsh has features like interactive Tab completion, automated file searching, regex integration, advanced shorthand for defining command scope, and a rich theme engine.
|
||||
Zsh tiene características como:
|
||||
- El completado interactivo de Tabuladores.
|
||||
- Búsqueda automatizada de archivos.
|
||||
- Integración regex.
|
||||
- Taquigrafía avanzada para definir el alcance de los comandos.
|
||||
- Un extenso motor de temas.
|
||||
- etc.
|
||||
|
||||
We can use our `apt` package manager to get zsh installed on our system. Let's go ahead and run `sudo apt install zsh` from our bash terminal. I am going to do this from within the VM console vs being connected over SSH.
|
||||
Podemos instalar zsh con nuestro gestor de paquetes `apt`. Vamos a ejecutar:
|
||||
```shell
|
||||
sudo apt install zsh
|
||||
```
|
||||
En la imagen veréis que se utiliza la consola de la máquina virtual en lugar de estar conectado a través de SSH. Lo podéis hacer como queráis, no necesitáis interfaz gráfica.
|
||||
|
||||
When the installation command is complete you can run `zsh` inside your terminal, this will then start a shell configuration script.
|
||||
Cuando el comando de instalación se haya completado puedes ejecutar `zsh`. La primera vez que se haga iniciará un script de configuración del nuevo shell.
|
||||
|
||||

|
||||
|
||||
I selected `1` to the above question and now we have some more options.
|
||||
De base, sin ningún tipo de extensión o plugin, ya es muy configurable. Seleccionamos `1` a la pregunta anterior para ver algunas opciones más.
|
||||
|
||||

|
||||
|
||||
You can see from this menu that we can make some out of the box edits to make ZSH configured to our needs.
|
||||
Podrás ver que podemos hacer algunos cambios para configurar ZSH a nuestro gusto o necesidades.
|
||||
|
||||
If you exit the wizard with a `0` and then use the `ls -al | grep .zshrc` you should see we have a new configuration file.
|
||||
Si sales del asistente con un `0` y luego usas
|
||||
|
||||
Now we want to make zsh our default shell every time we open our terminal, we can do this by running the following command to change our shell `chsh -s $(which zsh)` we then need to log out and back in again for the changes to take place.
|
||||
```shell
|
||||
ls -al | grep .zshrc
|
||||
```
|
||||
|
||||
When you log back and open a terminal it should look something like this. We can also confirm our shell has now been changed over by running `which $SHELL`
|
||||
deberías ver que tenemos un nuevo archivo de configuración.
|
||||
|
||||
Ya que tenemos un shell más potente y personalizable que bash, vamos a hacer que zsh sea el shell por defecto cada vez que abramos un terminal. Podemos hacer esto ejecutando el siguiente comando
|
||||
|
||||
```shell
|
||||
chsh -s $(which zsh)
|
||||
```
|
||||
|
||||
Entonces tendremos que cerrar la sesión y volver a entrar de nuevo para que se realicen los cambios. También podemos ejecutar en la/s terminal/es abierta/s el comando
|
||||
|
||||
```shell
|
||||
exec zsh
|
||||
```
|
||||
|
||||
También podemos confirmar que nuestro shell ha cambiado ejecutando `which $SHELL`.
|
||||
|
||||

|
||||
|
||||
I generally perform this step on each Ubuntu desktop I spin up and find in general without going any further that the zsh shell is a little faster than bash.
|
||||
El autor, Michael Cade, generalmente realiza este paso en cada escritorio Ubuntu que arranca ya que considera que el shell zsh es un poco más rápido que bash.
|
||||
|
||||
El traductor lo instala tan solo en los equipos con los que trabaja habitualmente. Bash va incorporado dentro de zsh, al igual que sh, y considera que como velocidad el más liviano siempre ganará la partida. Entre estos tres es sh. Pero zsh tiene grandes posibilidades de personalización, con lo cuál puede ser mucho más productivo para trabajar con él. Esto es importante tenerlo en cuenta a la hora de crear scripts, sh siempre será estará instalado y será el más rápido, pero seguramente las distros con tan solo sh no tendrán muchos de los scripts y programas básicos, como los que puedes encontrar en Ubuntu.
|
||||
|
||||
### OhMyZSH
|
||||
|
||||
Next up we want to make things look a little better and also add some functionality to help us move around within the terminal.
|
||||
Para hacer que las cosas se vean un poco mejor y también añadir un poco de funcionalidades utilizaremos el framework gratuito y de código abierto
|
||||
OhMyZSH.
|
||||
|
||||
OhMyZSH is a free and open source framework for managing your zsh configuration. There are lots of plugins, themes and other things that just make interacting with the zsh shell a lot nicer.
|
||||
Con este framework, podremos gestionar la configuración y personalización de zsh hasta niveles estratosféricos. Tiene un montón de plugins, temas y muchos otros recursos que hacen que interactuar con el shell zsh sea mucho más agradable y productivo. Todo esto gracias a una gran comunidad que mantiene y alimenta el proyecto.
|
||||
|
||||
You can find out more about [ohmyzsh](https://ohmyz.sh/)
|
||||
Es muy recomendable que dediques un tiempo a examinar todo su potencial, tanto en su [web](https://ohmyz.sh/) como en su [repositorio](https://github.com/ohmyzsh/ohmyzsh/).
|
||||
|
||||
Let's get Oh My ZSH installed, we have a few options with `curl` `wget` or `fetch` we have the first two available on our system but I will lead with `curl`
|
||||
Vamos a instalar Oh My ZSH. Si vamos a su documentación veremos que tenemos distintas opciones: `curl` `wget` o `fetch`. Las dos primeras están disponibles por defecto en Ubuntu. Para hacerlo con `curl` sería así:
|
||||
|
||||
`sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"`
|
||||
```shell
|
||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
|
||||
```
|
||||
|
||||
When you have run the above command you should see some output like the below.
|
||||
Cuando hayas ejecutado el comando anterior deberías ver una salida como la mostrada en la siguiente captura de pantalla.
|
||||
|
||||

|
||||
|
||||
Now we can move on to start putting a theme in for our experience, there are well over 100 bundled with Oh My ZSH but my go-to for all of my applications and everything is the Dracula theme.
|
||||
Ahora podemos empezar a poner un tema, hay más de 100 incluidos con Oh My ZSH. El favorito de Michael Cade es el tema de Drácula.
|
||||
|
||||
I also want to add that these two plugins are a must when using Oh My ZSH.
|
||||
Dos plugins imprescindibles para Oh My ZSH se instala así:
|
||||
|
||||
`git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions`
|
||||
```shell
|
||||
git clone https://github.com/zsh-users/zsh-autosuggestions.git $ZSH_CUSTOM/plugins/zsh-autosuggestions
|
||||
```
|
||||
|
||||
`git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting`
|
||||
```shell
|
||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $ZSH_CUSTOM/plugins/zsh-syntax-highlighting
|
||||
```
|
||||
Luego tendremos que editar el dotfile con nuestro editor favorito (Como vimos en días anteriores, puede ser nano o vim) `~/.zshrc`
|
||||
|
||||
`nano ~/.zshrc`
|
||||
Para incluir los plugins debes añadirlos en:
|
||||
|
||||
edit the plugins to now include `plugins=(git zsh-autosuggestions zsh-syntax-highlighting)`
|
||||
```sh
|
||||
plugins=(
|
||||
git
|
||||
zsh-autosuggestions
|
||||
zsh-syntax-highlighting
|
||||
)
|
||||
```
|
||||
|
||||
## Gnome Extensions
|
||||
Así ya tendrás los primeros plugins añadidos. Puedes ver el dotfile completo del traductor [aquí](https://gitea.vergaracarmona.es/man-linux/zsh-shell/src/branch/master/files/zshrc).
|
||||
|
||||
I also use Gnome extensions, and in particular the list below
|
||||
## Extensiones Gnome
|
||||
|
||||
[Gnome extensions](https://extensions.gnome.org)
|
||||
También puedes usar las extensiones de Gnome. En particular, Michael Cade, te recomienda la siguiente lista:
|
||||
|
||||
[Extensiones Gnome](https://extensions.gnome.org)
|
||||
|
||||
- Caffeine
|
||||
- CPU Power Manager
|
||||
@ -104,9 +148,9 @@ I also use Gnome extensions, and in particular the list below
|
||||
- Desktop Icons
|
||||
- User Themes
|
||||
|
||||
## Software Installation
|
||||
## Instalación de Software
|
||||
|
||||
A short list of the programs I install on the machine using `apt`
|
||||
Una breve lista de los programas que instala el autor usando `apt`.
|
||||
|
||||
- VSCode
|
||||
- azure-cli
|
||||
@ -122,25 +166,34 @@ A short list of the programs I install on the machine using `apt`
|
||||
|
||||
### Dracula theme
|
||||
|
||||
This site is the only theme I am using at the moment. Looks clear, and clean and everything looks great. [Dracula Theme](https://draculatheme.com/) It also has you covered when you have lots of other programs you use on your machine.
|
||||
Este es el tema que usa el autor Michael Cade. Se ve claro, y limpio y todo se ve muy bien. [Dracula Theme](https://draculatheme.com/) también cubre cuando tienes muchos otros programas en tu máquina.
|
||||
|
||||
From the link above we can search for zsh on the site and you will find at least two options.
|
||||
Desde el enlace anterior podemos buscar zsh en el sitio y encontrarás al menos dos opciones.
|
||||
|
||||
Follow the instructions listed to install either manually or using git. Then you will need to finally edit your `.zshrc` configuration file as per below.
|
||||
Sigue las instrucciones listadas para instalar ya sea manualmente o usando git. Luego necesitarás finalmente editar tu archivo de configuración `.zshrc` como se indica a continuación.
|
||||
|
||||

|
||||
|
||||
You are next going to want the [Gnome Terminal Dracula theme](https://draculatheme.com/gnome-terminal) with all instructions available here as well.
|
||||
|
||||
It would take a long time for me to document every step so I created a video walkthrough of the process. (**Click on the image below**)
|
||||
También puedes escoger el [Gnome Terminal Dracula theme](https://draculatheme.com/gnome-terminal). Llevaría mucho tiempo documentar cada paso, pero puedes ver un vídeo con el proceso. (Haga clic en la imagen)
|
||||
|
||||
[](https://youtu.be/jeEslAtHfKc)
|
||||
|
||||
If you made it this far, then we have now finished our Linux section of the #90DaysOfDevOps. Once again I am open to feedback and additions to resources here.
|
||||
Como mencioné anteriormente, también puedes ver otra personalización del traductor en el [repositorio zsh-shell](https://gitea.vergaracarmona.es/man-linux/zsh-shell).
|
||||
|
||||
I also thought on this it was easier to show you a lot of the steps through video vs writing them down here, what do you think about this? I do have a goal to work back through these days and where possible create video walkthroughs to add in and better maybe explain and show some of the things we have covered. What do you think?
|
||||
Puedes ver el resultado en la siguiente captura.
|
||||
|
||||
## Resources
|
||||

|
||||
|
||||
## Extra del traductor
|
||||
|
||||
En diciembre de 2022 se realizó la instalación de Ubuntu 22.04.01 en un equipo de trabajo. Se documento un índice de los pasos seguidos y, en el futuro, se irá completando con guías de cada una de las instalaciones. Puede que incluso con un script que instale todos los programas extras con una sola ejecución: [Repositorio "Preparación de un equipo"](https://gitea.vergaracarmona.es/manuelver/preparacion-equipo).
|
||||
|
||||
---
|
||||
|
||||
Si has llegado hasta aquí te tengo que dar la enhorabuena, hemos terminado los días de Linux de los #90DaysOfDevOps. No olvides investigar por tu cuenta y prácticas mucho muchísimo. Los conocimientos adquiridos de manera autodidacta suelen ser los que nunca se olvidan.
|
||||
|
||||
|
||||
## Recursos
|
||||
|
||||
- [Bash in 100 seconds](https://www.youtube.com/watch?v=I4EWvMFj37g)
|
||||
- [Bash script with practical examples - Full Course](https://www.youtube.com/watch?v=TPRSJbtfK4M)
|
||||
@ -148,9 +201,13 @@ I also thought on this it was easier to show you a lot of the steps through vide
|
||||
- [The Beginner's guide to SSH](https://www.youtube.com/watch?v=2QXkrLVsRmk)
|
||||
- [Vim in 100 Seconds](https://www.youtube.com/watch?v=-txKSRn0qeA)
|
||||
- [Vim tutorial](https://www.youtube.com/watch?v=IiwGbcd8S7I)
|
||||
- [Guía básica de Vim](https://gitea.vergaracarmona.es/man-linux/Guia-VIM)
|
||||
- [Learn the Linux Fundamentals - Part 1](https://www.youtube.com/watch?v=kPylihJRG70)
|
||||
- [Linux for hackers (don't worry you don't need to be a hacker!)](https://www.youtube.com/watch?v=VbEx7B_PTOE)
|
||||
- [Webminal](https://www.webminal.org/)
|
||||
- [Preparación de un equipo Ubuntu 22.04](https://gitea.vergaracarmona.es/manuelver/preparacion-equipo)
|
||||
- [Configuración personal de la shell con zsh](https://gitea.vergaracarmona.es/man-linux/zsh-shell)
|
||||
|
||||
Tomorrow we start our 7 days of diving into Networking, we will be looking to give ourselves the foundational knowledge and understanding of Networking around DevOps.
|
||||
Mañana empezamos nuestros 7 días de inmersión en Redes, vamos a tratar de ver los conocimientos básicos y la comprensión de Redes en torno a DevOps. Abróchate el cinturón y...
|
||||
|
||||
See you on [Day21](day21.md)
|
||||
Nos vemos en el [Día 21](day21.md) 🦾
|
||||
|
@ -1,106 +1,115 @@
|
||||
## The Big Picture: DevOps and Networking
|
||||
## El panorama: DevOps & Networking
|
||||
|
||||
As with all sections, I am using open and free training materials and a lot of the content can be attributed to others. In the case of the networking section a large majority of the content shown is from [Practical Networking](https://www.practicalnetworking.net/)'s free [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). It is mentioned in the resources as well as a link but it's appropriate to highlight this as from a community point of view, I have leveraged this course to help myself understand more about particular areas of technologies. This repository is a repository for my note taking and enabling the community to hopefully benefit from this and the listed resources.
|
||||
Como en todas las secciones, se están utilizando materiales de formación abiertos y gratuitos. Gran parte del contenido se puede atribuir a otros. En el caso de la sección de redes una gran mayoría del contenido mostrado es gratuito de [Practical Networking](https://www.practicalnetworking.net/) y [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). Se menciona en los recursos, así como un enlace, pero es apropiado destacar esto desde el punto de vista de la comunidad. Se ha aprovechado este curso para ayudarme a entender más acerca de las áreas particulares de las tecnologías. Este repositorio sirve para que yo tome notas y para que la comunidad pueda beneficiarse de esto y de los recursos enumerados.
|
||||
|
||||
Welcome to Day 21! We are going to be getting into Networking over the next 7 days, Networking and DevOps are the overarching themes but we will need to get into some of the networking fundamentals as well.
|
||||
¡Bienvenidos al Día 21! Vamos a ver la creación de redes en los próximos 7 días. En DevOps es necesario adquirir algunos conocimientos básicos sobre la creación de redes para poder defendernos en cualquier puesto de ingeniero de plataforma.
|
||||
|
||||
Ultimately as we have said previously DevOps is about a culture and process change within your organisation this as we have discussed can be Virtual Machines, Containers, or Kubernetes but it can also be the network, If we are using those DevOps principles for our infrastructure that has to include the network more to the point from a DevOps point of view you also need to know about the network as in the different topologies and networking tools and stacks that we have available.
|
||||
En última instancia, como hemos dicho anteriormente, DevOps se trata de un cambio de cultura y proceso dentro de las organizaciones, hemos visto que pudiera ser con máquinas virtuales, con contenedores o con Kubernetes. Pues también puede ser con la red. Si estamos utilizando los principios DevOps para nuestra infraestructura tiene que incluir la red con un punto de vista DevOps, valga la redundancia. También necesitas saber acerca de la red como las diferentes topologías, herramientas de red y los posibles stacks que tenemos disponibles.
|
||||
|
||||
I would argue that we should have our networking devices configured using infrastructure as code and have everything automated like we would our virtual machines, but to do that we have to have a good understanding of what we are automating.
|
||||
Lo recomendable es tener nuestros dispositivos de red configurados utilizando la infraestructura como código ([IaC](https://es.wikipedia.org/wiki/Infraestructura_como_c%C3%B3digo)), ya hemos comentado alguna vez que significa esto. También debemos tener todo automatizado como lo haríamos con nuestras máquinas virtuales, pero para hacer esto deberíamos adquirir una buena comprensión de lo que estamos automatizando.
|
||||
|
||||
### What is NetDevOps | Network DevOps?
|
||||
Al lío.
|
||||
|
||||
You may also hear the terms Network DevOps or NetDevOps. Maybe you are already a Network engineer and have a great grasp on the network components within the infrastructure you understand the elements used around networking such as DHCP, DNS, NAT etc. You will also have a good understanding of the hardware or software-defined networking options, switches, routers etc.
|
||||
### ¿Qué es NetDevOps | Network DevOps?
|
||||
|
||||
But if you are not a network engineer then we probably need to get foundational knowledge across the board in some of those areas so that we can understand the end goal of Network DevOps.
|
||||
Dentro de la cultura cloud escucharás términos como Network DevOps o NetDevOps. Tal vez ya seas ingeniero de redes y tengas un gran dominio de los componentes de red dentro de la infraestructura, entonces comprenderás los elementos utilizados en torno a las redes, como DHCP, DNS, NAT, etc, además de la importancia que tienen todos estos elementos. Por lo tanto, también tendrás un buen conocimiento de las opciones de redes definidas por hardware o software, switches, routers, etc.
|
||||
|
||||
But in regards to those terms, we can think of NetDevOps or Network DevOps as applying the DevOps Principles and Practices to the network, applying version control and automation tools to the network creation, testing, monitoring, and deployments.
|
||||
En el caso de que no seas un ingeniero de redes, probablemente necesites una ayudita para alcanzar unos conocimientos básicos de esta área y así poder entender el objetivo final de Network DevOps.
|
||||
|
||||
If we think of Network DevOps as having to require automation, we mentioned before about DevOps breaking down the silos between teams. If the networking teams do not change to a similar model and process then they become the bottleneck or even the failure overall.
|
||||
En lo que respecta a los términos NetDevOps o Network DevOps, podemos pensarlos como la aplicación de los principios y prácticas de DevOps a la red, aplicando herramientas de control de versiones y automatización a la creación, testing, monitorización y despliegue de la red.
|
||||
|
||||
Using the automation principles around provisioning, configuration, testing, version control and deployment is a great start. Automation is overall going to enable speed of deployment, stability of the networking infrastructure and consistent improvement as well as the process being shared across multiple environments once they have been tested. Such as a fully tested Network Policy that has been fully tested on one environment can be used quickly in another location because of the nature of this being in code vs a manually authored process which it might have been before.
|
||||
A really good viewpoint and outline of this thinking can be found here. [Network DevOps](https://www.thousandeyes.com/learning/techtorials/network-devops)
|
||||
Si pensamos en DevOps de Red como algo que tiene que requerir automatización, tenemos que volver atrás a cuando mencionamos DevOps como rompedor de silos entre equipos. Si los equipos de redes no cambian a un modelo y proceso similares, entonces se convierten en el cuello de botella o incluso en el fracaso general.
|
||||
|
||||
## Networking The Basics
|
||||
Utilizar los principios de automatización en torno al aprovisionamiento, la configuración, el testing, el control de versiones y el despliegue es un gran comienzo. En general, la automatización va a permitir mejorar la agilidad y velocidad en los despliegues, consiguiendo estabilidad de la infraestructura de red y la mejora consecuente, así como el proceso que se comparte a través de múltiples entornos una vez que han sido probados. Por ejemplo, una política de red totalmente probada en un entorno puede utilizarse rápidamente en otra ubicación, ya que se trata de un código y no de un proceso manual.
|
||||
Un buen punto de vista y resumen de este pensamiento se puede encontrar aquí: [Network DevOps](https://www.thousandeyes.com/learning/techtorials/network-devops).
|
||||
|
||||
Let's forget the DevOps side of things to begin with here and we now need to look very briefly into some of the Networking fundamentals.
|
||||
## Lo básico de Networking
|
||||
|
||||
### Network Devices
|
||||
Vamos a olvidarnos del punto de vista DevOps durante un rato y miraremos muy brevemente algunos fundamentos de red.
|
||||
|
||||
If you prefer this content in video form, check out these videos from Practical Networking:
|
||||
*Si prefieres este contenido en forma de vídeo, echa un vistazo a estos vídeos de Practical Networking:*
|
||||
|
||||
* [Network Devices - Hosts, IP Addresses, Networks - Networking Fundamentals - Lesson 1a](https://www.youtube.com/watch?v=bj-Yfakjllc&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=1)
|
||||
* [Network Devices - Hub, Bridge, Switch, Router - Networking Fundamentals - Lesson 1b
|
||||
](https://www.youtube.com/watch?v=H7-NR3Q3BeI&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=2)
|
||||
* [*Network Devices - Hosts, IP Addresses, Networks - Networking Fundamentals - Lesson 1a*](https://www.youtube.com/watch?v=bj-Yfakjllc&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=1)
|
||||
* [*Network Devices - Hub, Bridge, Switch, Router - Networking Fundamentals - Lesson 1b*](https://www.youtube.com/watch?v=H7-NR3Q3BeI&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=2)
|
||||
|
||||
**Host** are any devices which send or receive traffic.
|
||||
### Dispositivos de red
|
||||
|
||||
**Host** - Son todos los dispositivos que envían o reciben tráfico.
|
||||
|
||||

|
||||
|
||||
**IP Address** the identity of each host.
|
||||
**Dirección IP** - La identidad de cada host.
|
||||
|
||||

|
||||
|
||||
**Network** is what transports traffic between hosts. If we did not have networks there would be a lot of manual movement of data!
|
||||
**Network** - Es lo que transporta el tráfico entre los hosts. Si no tuviéramos redes, ¡habría mucho movimiento manual de datos!
|
||||
|
||||
A logical group of hosts which require similar connectivity.
|
||||
Un grupo lógico de hosts que requieren una conectividad similar.
|
||||
|
||||

|
||||
|
||||
**Switches** facilitate communication **_within_** a network. A switch forwards data packets between hosts. A switch sends packets directly to hosts.
|
||||
**Switches** - Facilitan la comunicación dentro de una red. Reenvía paquetes de datos entre hosts y envía paquetes directamente a los hosts.
|
||||
|
||||
- Network: A Grouping of hosts which require similar connectivity.
|
||||
- Hosts on a Network share the same IP address space.
|
||||
- Network: Agrupación de hosts que requieren una conectividad similar.
|
||||
- Los hosts de una red comparten el mismo espacio de direcciones IP.
|
||||
|
||||
> *Los más avanzados pueden actuar como un router, salvando las distancias. Podrían enrutar entre dispositivos con las mismas características pero no tendrían todos los protocolos de enrutamiento que puede ofrecer un router.*
|
||||
|
||||

|
||||
1
|
||||
**Router** - Facilita la comunicación entre redes. Hemos dicho que un switch se ocupa de la comunicación dentro de una red, pues bien, el router nos permite unir estas redes o al menos dar acceso entre ellas si está permitido.
|
||||
|
||||
**Router** facilitates communication between networks. As we said before that a switch looks after communication within a network a router allows us to join these networks together or at least give them access to each other if permitted.
|
||||
> *No estamos hablando del router que conocemos en nuestras casas. Estamos hablando solo del aparato que se ocupar en enrutar. Lo que conocemos actualmente como routers, los que nos proveen las [ISP](https://es.wikipedia.org/wiki/Proveedor_de_servicios_de_internet), a mi parecer defectuosos, realmente se componen de 4 elementos: Router, switch, punto de acceso y modem. Se debe tener en cuenta esta diferencia de dispositivos para entender mejor los conceptos que tratamos.*
|
||||
|
||||
A router can provide a traffic control point (security, filtering, redirecting) More and more switches also provide some of these functions now.
|
||||
Un router puede proporcionar un punto de control del tráfico (seguridad, filtrado, redireccionamiento) Cada vez son más los conmutadores que también proporcionan algunas de estas funciones.
|
||||
|
||||
Routers learn which networks they are attached to. These are known as routes, a routing table is all the networks a router knows about.
|
||||
Los routers aprenden a qué redes están conectados. Una routing table contiene el conjunto de redes que conoce un router.
|
||||
|
||||
A router has an IP address in the networks they are attached to. This IP is also going to be each host's way out of their local network also known as a gateway.
|
||||
Un router tiene una dirección IP en las redes a las que está conectado. Esta IP también va a ser la salida de cada host de su red local, también conocida como puerta de enlace (gateway).
|
||||
|
||||
Routers also create the hierarchy in networks I mentioned earlier.
|
||||
Los routers también crean la jerarquía en las redes que he mencionado antes.
|
||||
|
||||
> *Los más avanzados pueden actuar con funcionalidades idénticas de un switch*
|
||||
|
||||

|
||||
|
||||
## Switches vs Routers
|
||||
|
||||
**Routing** is the process of moving data between networks.
|
||||
**Routing** es el proceso de mover datos entre redes.
|
||||
|
||||
- A router is a device whose primary purpose is Routing.
|
||||
- Un router es un dispositivo cuyo propósito principal es el enrutamiento.
|
||||
|
||||
**Switching** is the process of moving data within networks.
|
||||
**Switching** es el proceso de mover datos dentro de una red.
|
||||
|
||||
- A Switch is a device whose primary purpose is switching.
|
||||
- Un switch es un dispositivo cuya función principal es la conmutación.
|
||||
|
||||
This is very much a foundational overview of devices as we know there are many different Network Devices such as:
|
||||
Hemos dado un vistazo general de algunos dispositivos pero debemos saber que existen muchos más con otras funcionalidades en la red, como:
|
||||
|
||||
- Access Points
|
||||
- Firewalls
|
||||
- Load Balancers
|
||||
- Layer 3 Switches
|
||||
- IDS / IPS
|
||||
- Proxies
|
||||
- Virtual Switches
|
||||
- Virtual Routers
|
||||
- Puntos de acceso.
|
||||
- Firewalls (físicos, de hardware).
|
||||
- Load Balancers (físicos, de hardware).
|
||||
- Switches de capa 3.
|
||||
- IDS / IPS.
|
||||
- Proxies.
|
||||
- Switches virtuales (lógicos, de software).
|
||||
- Routers virtuales (lógicos, de software).
|
||||
|
||||
Although all of these devices are going to perform Routing and/or Switching.
|
||||
Aunque todos los dispositivos anteriores van a realizar de una u otra forma el Routing y/o el Switching.
|
||||
|
||||
Over the next few days, we are going to get to know a little more about this list.
|
||||
En los próximos días vamos a conocer un poco más:
|
||||
|
||||
- OSI Model
|
||||
- Network Protocols
|
||||
- Modelo OSI.
|
||||
- Protocolos de red.
|
||||
- DNS (Domain Name System)
|
||||
- NAT
|
||||
- DHCP
|
||||
- Subnets
|
||||
|
||||
## Resources
|
||||
Son conceptos muy importantes ya que serán la base para conocer las redes. Si no conoces los términos lo mejor es que sigas con los siguientes días de red. Si los conoces, puedes repasarlos o ir directamente al siguiente tema: [Cloud Provider](day28.md)
|
||||
|
||||
## Rercursos
|
||||
|
||||
* [Networking Fundamentals](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi)
|
||||
* [Computer Networking full course](https://www.youtube.com/watch?v=IPvYjXCsTg8)
|
||||
|
||||
See you on [Day22](day22.md)
|
||||
Nos vemos en el [Día 22](day22.md).
|
||||
|
@ -1,99 +1,106 @@
|
||||
The content below comes mostly from Practical Networking's [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). If you prefer this content in video form, check out these two videos:
|
||||
El contenido que figura a continuación procede en su mayor parte de Practical Networking [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). Si prefieres este contenido en forma de vídeo, echa un vistazo a estos dos vídeos:
|
||||
|
||||
* [The OSI Model: A Practical Perspective - Layers 1 / 2 / 3](https://www.youtube.com/watch?v=LkolbURrtTs&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=3)
|
||||
* [The OSI Model: A Practical Perspective - Layers 4 / 5+](https://www.youtube.com/watch?v=0aGqGKrRE0g&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=4)
|
||||
|
||||
## The OSI Model - The 7 Layers
|
||||
## El Modelo OSI - Las 7 Capas
|
||||
|
||||
The overall purpose of networking as an industry is to allow two hosts to share data. Before networking if I want to get data from this host to this host I'd have to plug something into this host walk it over to the other host and plug it into the other host.
|
||||
El propósito general de las redes como industria es permitir que dos hosts compartan datos entre ellos. Antes de la conexión en red, si se necesitaba trasladar datos de un host a otro, se tenía que conectar algo en el primer host, llevarlo al otro host y conectarlo allí para conseguir nuestro propósito. Nos ha solucionado muchos aspectos de la vida siendo una revolución industrial, social y creando incluso una [cultura](https://es.wikipedia.org/wiki/Cibercultura) propia.
|
||||
|
||||
Networking allows us to automate this by allowing the host to share data automatically across the wire for these hosts to do this they must follow a set of rules.
|
||||
La conexión en red nos permite automatizar el proceso mencionados, permitiendo que un host comparta datos automáticamente a través de la conexión, sea por cable o por redes inalámbricas. Para que estos hosts puedan realizar esta labor, es necesario que sigan un conjunto de reglas comunes.
|
||||
|
||||
This is no different than any language. English has a set of rules that two English speakers must follow. Spanish has its own set of rules. French has its own set of rules, while networking also has its own set of rules
|
||||
Esto no es diferente de cualquier idioma. El inglés tiene una serie de reglas que deben seguir dos angloparlantes. El español tiene sus propias reglas. El francés tiene sus propias reglas, y el trabajo en red también tiene las suyas.
|
||||
|
||||
The rules for networking are divided into seven different layers and those layers are known as the OSI model.
|
||||
Las reglas de las redes actualmente más utilizadas se dividen en siete capas diferentes y esas capas se conocen como el modelo OSI. Aunque existen otros modelos, este es el más extendido y el que ha creado un estándar.
|
||||
|
||||
### Introduction to the OSI Model
|
||||
### Introducción al Modelo OSI
|
||||
|
||||
The OSI Model (Open Systems Interconnection Model) is a framework used to describe the functions of a networking system. The OSI model characterises computing functions into a universal set of rules and requirements to support interoperability between different products and software. In the OSI reference model, the communications between a computing system are split into seven different abstraction layers: **Physical, Data Link, Network, Transport, Session, Presentation, and Application**.
|
||||
El modelo OSI (Open Systems Interconnection Model) es un marco utilizado para describir las funciones de un sistema de red. El modelo OSI caracteriza las funciones informáticas en un conjunto universal de reglas y requisitos para apoyar la interoperabilidad entre diferentes productos y software. En el modelo de referencia OSI, las comunicaciones entre un sistema informático se dividen en siete capas de abstracción diferentes:
|
||||
|
||||

|
||||
- **Física**
|
||||
- **Enlace de Datos**
|
||||
- **Red**
|
||||
- **Transporte**
|
||||
- **Sesión**
|
||||
- **Presentación**
|
||||
- **Aplicación**.
|
||||
|
||||
### Physical
|
||||
Veamos un poco sobre estas capas.
|
||||
|
||||
Layer 1 in the OSI model and this is known as physical, the premise of being able to get data from one host to another through a means be it physical cable or we could also consider Wi-Fi in this layer as well. We might also see some more legacy hardware seen here around hubs and repeaters to transport the data from one host to another.
|
||||
### Física
|
||||
|
||||
Capa 1 en el modelo OSI se conoce como la capa física, la premisa de ser capaz de obtener datos de un host a otro a través de un medio ya sea el cable físico o también podríamos considerar los medios inalámbricos como el Wi-Fi en esta capa. Algo más de hardware heredado de esta capa son los hubs y los repetidores para transportar los datos de un host a otro.
|
||||
|
||||

|
||||
|
||||
### Data Link
|
||||
### Enlace de datos
|
||||
|
||||
Layer 2, the data link enables a node to node transfer where data is packaged into frames. There is also a level of error correcting that might have occurred at the physical layer. This is also where we introduce or first see MAC addresses.
|
||||
En la capa 2, el enlace de datos permite una transferencia de nodo a nodo donde los datos se empaquetan en tramas. También hay un nivel de corrección de errores que podría haber ocurrido en la capa física. Aquí es donde introducimos o vemos por primera vez las direcciones MAC.
|
||||
|
||||
This is where we see the first mention of switches that we covered on our first day of networking on [Day 21](day21.md)
|
||||
Los switches que describimos en el [Día 21](day21.md) trabajan principalmente en esta capa.
|
||||
|
||||

|
||||
|
||||
### Network
|
||||
### Red
|
||||
|
||||
You have likely heard the term layer 3 switches or layer 2 switches. In our OSI model Layer 3, the Network has a goal of an end to end delivery, this is where we see our IP addresses also mentioned in the first-day overview.
|
||||
Es probable que hayas oído el término switches de capa 3 o switches de capa 2. En nuestro modelo OSI Capa 3, la Red tiene como objetivo una entrega de extremo a extremo, aquí es donde vemos nuestras direcciones IP también mencionadas en el resumen del [Día 21](day21.md).
|
||||
|
||||
Routers and hosts exist at layer 3, remember the router is the ability to route between multiple networks. Anything with an IP could be considered Layer 3.
|
||||
Los Routers y los hosts se ubican en la capa 3, recuerda que el router es la capacidad de enrutar entre múltiples redes. Cualquier dispositivo con IP podría considerarse de Capa 3.
|
||||
|
||||

|
||||
|
||||
So why do we need addressing schemes on both Layers 2 and 3? (MAC Addresses vs IP Addresses)
|
||||
Entonces, ¿por qué necesitamos esquemas de direccionamiento en las Capas 2 y 3? (Direcciones MAC vs Direcciones IP)
|
||||
|
||||
If we think about getting data from one host to another, each host has an IP address but there are several switches and routers in between. Each of the devices has that layer 2 MAC address.
|
||||
Si pensamos en la transmisión de datos de un host a otro, cada host tiene una dirección IP, pero hay varios switches y routers entre ellos. Cada uno de los dispositivos tiene una dirección MAC de capa 2.
|
||||
|
||||
The layer 2 MAC address will go from host to switch/router only, it is focused on hops whereas the layer 3 IP addresses will stay with that packet of data until it reaches its end host. (End to End)
|
||||
La dirección MAC de capa 2 sólo irá de host a switch/router, se centra en los saltos mientras que las direcciones IP de capa 3 permanecerán con ese paquete de datos hasta que llegue a su host final. (De extremo a extremo)
|
||||
|
||||
IP Addresses - Layer 3 = End to End Delivery
|
||||
> Direcciones IP - Capa 3 = Entrega de extremo a extremo.
|
||||
|
||||
MAC Addresses - Layer 2 = Hop to Hop Delivery
|
||||
> Direcciones MAC - Capa 2 = Entrega de Salto a Salto.
|
||||
|
||||
Now there is a network protocol that we will get into but not today called ARP(Address Resolution Protocol) which links our Layer3 and Layer2 addresses.
|
||||
Un protocolo de red que veremos, pero no hoy, es el ARP (Protocolo de Resolución de Direcciones) el cuál enlaza nuestras direcciones de Capa3 y Capa2.
|
||||
|
||||
### Transport
|
||||
### Transporte
|
||||
|
||||
Service to Service delivery, Layer 4 is there to distinguish data streams. In the same way that Layer 3 and Layer 2 both had their addressing schemes, in Layer 4 we have ports.
|
||||
Entrega de Servicio a Servicio, la Capa 4 está ahí para distinguir los flujos de datos. De la misma manera que la Capa 3 y la Capa 2 tenían sus esquemas de direccionamiento, en la Capa 4 tenemos puertos.
|
||||
|
||||

|
||||
|
||||
### Session, Presentation, Application
|
||||
### Sesión, Presentación, Aplicación
|
||||
|
||||
The distinction between Layers 5,6,7 is or had become somewhat vague.
|
||||
La distinción entre las Capas 5, 6 y 7 es, o había llegado a ser, algo difusa.
|
||||
|
||||
It is worth looking at the [TCP IP Model](https://www.geeksforgeeks.org/tcp-ip-model/) to get a more recent understanding.
|
||||
Merece la pena consultar el [TCP IP Model](https://www.geeksforgeeks.org/tcp-ip-model/) para obtener una comprensión más reciente.
|
||||
|
||||
Let's now try and explain what's happening when hosts are communicating with each other using this networking stack. This host has an application that's going to generate data that is meant to be sent to another host.
|
||||
Intentemos comprender qué ocurre cuando los hosts se comunican entre sí utilizando el modelo OSI. El primer host tiene una aplicación que va a generar datos que están destinados a ser enviados a otro host.
|
||||
|
||||
The source host is going to go through is what's known as the encapsulation process. That data will be first sent to layer 4.
|
||||
El host de origen va a pasar por lo que se conoce como proceso de encapsulación. Esos datos serán enviados primero a la capa 4.
|
||||
|
||||
Layer 4 is going to add a header to that data which can facilitate the goal of layer 4 which is service to service delivery. This is going to be a port using either TCP or UDP. It is also going to include the source port and destination port.
|
||||
La capa 4 va a añadir una cabecera a esos datos que puede facilitar el objetivo de la capa 4 que es la entrega de servicio a servicio. Se trata de un puerto TCP o UDP. También incluirá el puerto de origen y el puerto de destino. Esto se conoce como segmento (datos y puerto).
|
||||
|
||||
This may also be known as a segment (Data and Port)
|
||||
Este segmento bajará por la pila OSI hasta la capa 3, la capa de red, y la capa de red añadirá otra cabecera a estos datos.
|
||||
Esta cabecera va a facilitar el objetivo de la capa 3 que es la entrega de extremo a extremo, lo que significa que en esta cabecera tendrás una dirección IP de origen y una IP de destino, la cabecera más los datos también pueden ser referidos como un paquete.
|
||||
|
||||
This segment is going to be passed down the OSI stack to layer 3, the network layer, and the network layer is going to add another header to this data.
|
||||
This header is going to facilitate the goal of layer 3 which is the end to end delivery meaning in this header you will have a source IP address and a destination IP, the header plus data may also be referred to as a packet.
|
||||
La capa 3 tomará ese paquete y se lo pasará a la capa 2, la capa 2 añadirá otra cabecera a esos datos para cumplir el objetivo de la capa 2 de entrega de salto a salto, lo que significa que esta cabecera incluirá una dirección mac de origen y de destino. Esto se conoce como trama cuando se tiene la cabecera de capa 2 y los datos.
|
||||
|
||||
Layer 3 will then take that packet and hand it off to layer 2, layer 2 will once again add another header to that data to accomplish layer 2's goal of hop to hop delivery meaning this header will include a source and destination mac address.
|
||||
This is known as a frame when you have the layer 2 header and data.
|
||||
|
||||
That frame then gets converted into ones and zeros and sent over the Layer 1 Physical cable or wifi.
|
||||
Esa trama luego se convierte en unos y ceros y se envía a través de la capa 1 de cable físico o wifi.
|
||||
|
||||

|
||||
|
||||
I did mention above the naming for each layer of header plus data but decided to draw this out as well.
|
||||
¡No es increíble!
|
||||
|
||||

|
||||
|
||||
The Application sending the data is being sent somewhere so the receiving is somewhat in reverse to get that back up the stack and into the receiving host.
|
||||
La aplicación que envía los datos está siendo enviada a alguna parte por lo que la recepción es algo a la inversa para conseguir que vuelva a la pila y en el host receptor. Es decir, llega a la capa física, sigue por la capa de enlace de datos, la de red, la de transporte hasta la de sesión.
|
||||
|
||||

|
||||
|
||||
## Resources
|
||||
Esto en cada pequeña transmisión de datos que efectuamos en la red. ¿Es tan apasionante para mí como para tí? Pues sigamos al siguiente día.
|
||||
|
||||
## Recursos
|
||||
|
||||
* [Networking Fundamentals](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi)
|
||||
- [Computer Networking full course](https://www.youtube.com/watch?v=IPvYjXCsTg8)
|
||||
|
||||
See you on [Day23](day23.md)
|
||||
Nos vemos en el [Día 23](day23.md).
|
||||
|
@ -1,113 +1,105 @@
|
||||
The content below comes mostly from Practical Networking's [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). If you prefer this content in video form, check out this video:
|
||||
El contenido que figura a continuación procede en su mayor parte de Practical Networking [Networking Fundamentals series](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi). Si prefieres este contenido en forma de vídeo, echa un vistazo a este vídeo:
|
||||
|
||||
* [Network Protocols - ARP, FTP, SMTP, HTTP, SSL, TLS, HTTPS, DNS, DHCP](https://www.youtube.com/watch?v=E5bSumTAHZE&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=12)
|
||||
|
||||
|
||||
## Network Protocols
|
||||
## Protocolos de red
|
||||
|
||||
A set of rules and messages that form a standard. An Internet Standard.
|
||||
Conjunto de reglas y mensajes que forman un estándar de Internet.
|
||||
|
||||
- ARP - Address Resolution Protocol
|
||||
- ARP - Address Resolution Protocol (Protocolo de resolución de direcciones)
|
||||
|
||||
If you want to get really into the weeds on ARP you can read the Internet Standard here. [RFC 826](https://datatracker.ietf.org/doc/html/rfc826)
|
||||
Si quieres profundizar en ARP puedes leer el estándar de Internet [RFC 826](https://datatracker.ietf.org/doc/html/rfc826).
|
||||
|
||||
Connects IP addresses to fixed physical machine addresses, also known as MAC addresses across a layer 2 network.
|
||||
Básicamente, conecta direcciones IP a direcciones de máquinas físicas fijas, también conocidas como direcciones MAC, a través de una red de capa 2.
|
||||
|
||||

|
||||
|
||||
- FTP - File Transfer Protocol
|
||||
- FTP - File Transfer Protocol (Protocolo de transferencia de archivos)
|
||||
|
||||
Allows for the transfer of files from source to destination. Generally, this process is authenticated but there is the ability if configured to use anonymous access. You will more frequently now see FTPS which provides SSL/TLS connectivity to FTP servers from the client for better security. This protocol would be found in the Application layer of the OSI Model.
|
||||
Permite la transferencia de archivos de origen a destino. Generalmente, este proceso es autenticado pero existe la posibilidad, si se configura, de utilizar acceso anónimo. Ahora es más frecuente ver FTPS, que proporciona conectividad SSL/TLS a servidores FTP desde el cliente para una mayor seguridad. Este protocolo se encuentra en la capa de Aplicación del Modelo OSI.
|
||||
|
||||

|
||||
|
||||
- SMTP - Simple Mail Transfer Protocol
|
||||
- SMTP - Simple Mail Transfer Protocol (Protocolo simple de transferencia de correo)
|
||||
|
||||
Used for email transmission, mail servers use SMTP to send and receive mail messages. You will still find even with Microsoft 365 that the SMTP protocol is used for the same purpose.
|
||||
Utilizado para la transmisión de correo electrónico, los servidores de correo utilizan SMTP para enviar y recibir mensajes de correo. Incluso con Microsoft 365 se sigue utilizando el protocolo SMTP para el mismo fin.
|
||||
|
||||

|
||||
|
||||
- HTTP - Hyper Text Transfer Protocol
|
||||
- HTTP - Hyper Text Transfer Protocol (Protocolo de transferencia de hipertexto)
|
||||
|
||||
HTTP is the foundation of the internet and browsing content. Giving us the ability to easily access our favourite websites. HTTP is still heavily used but HTTPS is more so used or should be used on most of your favourite sites.
|
||||
HTTP es la base de Internet y de la navegación de contenidos. Nos permite acceder fácilmente a nuestros sitios web favoritos. HTTP todavía se utiliza mucho, pero HTTPS se utiliza más o debería utilizarse en la mayoría de tus sitios favoritos.
|
||||
|
||||

|
||||
|
||||
- SSL - Secure Sockets Layer | TLS - Transport Layer Security
|
||||
- SSL - Secure Sockets Layer (Capa de sockets seguros) | TLS - Transport Layer Security (Seguridad de la capa de transporte)
|
||||
|
||||
TLS has taken over from SSL, TLS is a **Cryptographic Protocol** that provides secure communications over a network. It can and will be found in the mail, Instant Messaging and other applications but most commonly it is used to secure HTTPS.
|
||||
TLS ha tomado el relevo de SSL, TLS es un **Protocolo Criptográfico** que proporciona seguridad a las comunicaciones a través de una red. Lo puedes encontrar en el correo, en la mensajería instantánea y en otras aplicaciones, pero más comúnmente se utiliza para asegurar HTTPS. Más arriba se mencionó la nomenclatura de cada capa de encabezado y datos, pero esto también es.
|
||||
|
||||

|
||||
|
||||
- HTTPS - HTTP secured with SSL/TLS
|
||||
- HTTPS - HTTP securizado con SSL/TLS
|
||||
|
||||
An extension of HTTP, used for secure communications over a network, HTTPS is encrypted with TLS as mentioned above. The focus here was to bring authentication, privacy and integrity whilst data is exchanged between hosts.
|
||||
Una extensión de HTTP, utilizada para comunicaciones seguras a través de una red, HTTPS está encriptado con TLS como se mencionó anteriormente. El objetivo es aportar autenticación, privacidad e integridad al intercambio de datos entre hosts.
|
||||
|
||||

|
||||
|
||||
- DNS - Domain Name System
|
||||
- DNS - Domain Name System (Sistema de Nombres de Dominio)
|
||||
|
||||
The DNS is used to map human-friendly domain names for example we all know [google.com](https://google.com) but if you were to open a browser and put in [8.8.8.8](https://8.8.8.8) you would get Google as we pretty much know it. However good luck trying to remember all of the IP addresses for all of your websites where some of them we even use google to find information.
|
||||
Todos conocemos [google.com](https://google.com) pero si abriéramos un navegador y pusiéramos [8.8.8.8](https://8.8.8.8) obtendríamos Google tal y como lo conocemos. No podríamos recordar todas las direcciones IP de todos los sitios web que nos interesan, aun utilizando un buscador como Google o DuckDuckGo para buscar información, necesitamos que las direcciones sean fáciles de recordar.
|
||||
|
||||
This is where DNS comes in, it ensures that hosts, services and other resources are reachable.
|
||||
Aquí es donde entra en juego el DNS, que garantiza que los hosts, servicios y otros recursos sean accesibles para humanos.
|
||||
|
||||
On all hosts, if they require internet connectivity then they must have DNS to be able to resolve those domain names. DNS is an area you could spend Days and Years on learning. I would also say from experience that DNS is mostly the common cause of all errors when it comes to Networking. Not sure if a Network engineer would agree there though.
|
||||
En todos los hosts, si requieren conectividad a Internet, entonces deben tener DNS para poder resolver esos nombres de dominio. Las DNS son un área en la que podrías pasar años aprendiendo. También diría por experiencia que las DNS son la causa más común de todos los errores cuando se trata de redes. Aunque no estoy seguro de que un ingeniero de redes esté de acuerdo.
|
||||
|
||||

|
||||
|
||||
- DHCP - Dynamic Host Configuration Protocol
|
||||
- DHCP - Dynamic Host Configuration Protocol (Protocolo de configuración dinámica de host)
|
||||
|
||||
We have discussed a lot about protocols that are required to make our hosts work, be it accessing the internet or transferring files between each other.
|
||||
Hemos hablado mucho de los protocolos necesarios para que nuestros hosts funcionen, ya sea accediendo a Internet o transfiriendo archivos entre ellos. Pues bien, necesitamos al menos 4 elementos en cada host para que sea capaz de realizar ambas tareas:
|
||||
|
||||
There are 4 things that we need on every host for it to be able to achieve both of those tasks.
|
||||
|
||||
- IP Address
|
||||
- Subnet Mask
|
||||
- Default Gateway
|
||||
- Dirección IP
|
||||
- Máscara de subred
|
||||
- Puerta de enlace predeterminada
|
||||
- DNS
|
||||
|
||||
We have covered IP address being a unique address for your host on the network it resides, we can think of this as our house number.
|
||||
Ya hemos visto la **dirección IP**, que es una dirección única para tu host en la red en la que reside, podemos pensar en ella como el número de nuestra casa.
|
||||
|
||||
Subnet mask we will cover shortly, but you can think of this as postcode or zip code.
|
||||
La **máscara de subred** la veremos en breve, pero podemos pensar en ella como en un código postal.
|
||||
|
||||
A default gateway is the IP of our router generally on our network providing us with that Layer 3 connectivity. You could think of this as the single road that allows us out of our street.
|
||||
Una **puerta de enlace** predeterminada, generalmente en nuestra red, es la IP de nuestro router que nos proporciona la conectividad de capa 3. Podría verse como la puerta de enlace única. Y, buscando un posible símil, se podría ver como la única carretera que nos permite salir de nuestra calle.
|
||||
|
||||
Then we have DNS as we just covered to help us convert complicated public IP addresses to more suitable and rememberable domain names. Maybe we can think of this as the giant sorting office to make sure we get the right post.
|
||||
Luego tenemos la DNS, como hemos visto, es la forma de ayudarnos a convertir direcciones IP públicas difíciles de recordar en nombres de dominio más adecuados. Podríamos verlos como una gigantesca oficina de clasificación para asegurarnos de que recibimos el correo correcto.
|
||||
|
||||
As I said each host requires these 4 things, if you have 1000 or 10,000 hosts then that is going to take you a very long time to determine each one of these individually. This is where DHCP comes in and allows you to determine a scope for your network and then this protocol will distribute to all available hosts in your network.
|
||||
Como hemos visto, cada host requiere de estos 4 elementos, si tienes 1000 o 10.000 hosts entonces eso te va a llevar mucho tiempo para determinar cada uno individualmente. Es aquí donde DHCP entra en juego y le permite determinar un alcance para su red que este protocolo distribuirá a todos los hosts disponibles en su red de forma dinámica.
|
||||
|
||||
Another example is you head into a coffee shop, grab a coffee and sit down with your laptop or your phone let's call that your host. You connect your host to the coffee shop WiFi and you gain access to the internet, messages and mail start pinging through and you can navigate web pages and social media. When you connected to the coffee shop WiFi your machine would have picked up a DHCP address either from a dedicated DHCP server or most likely from the router also handling DHCP.
|
||||
Otro ejemplo: entras en una cafetería, coges un café y te sientas con tu portátil o tu teléfono. Conectas tu host al WiFi de la cafetería y obtienes acceso a Internet, los mensajes y el correo empiezan a llegar y puedes navegar por páginas web y redes sociales. Cuando te conectas a la WiFi de la cafetería, tu máquina habrá recogido una dirección DHCP de un servidor DHCP dedicado o, muy probablemente, del router, que también gestiona DHCP. (No estamos recomendando la wifi de las cafeterías, todos sabemos lo que pasa en esas redes.)
|
||||
|
||||

|
||||
|
||||
### Subnetting
|
||||
### Subnetting (Subredes)
|
||||
|
||||
A subnet is a logical subdivision of an IP network.
|
||||
Una subred es una subdivisión lógica de una red IP. Dividen las redes grandes en redes más pequeñas y manejables para que sean más eficientes.
|
||||
|
||||
Subnets break large networks into smaller, more manageable networks that run more efficiently.
|
||||
Cada subred es una subdivisión lógica de la red más grande. Los dispositivos conectados con una subred comparten identificadores de dirección IP comunes, lo que les permite comunicarse entre sí.
|
||||
|
||||
Each subnet is a logical subdivision of the bigger network. Connected devices with enough subnet share common IP address identifiers, enabling them to communicate with each other.
|
||||
Los routers gestionan la comunicación entre subredes.
|
||||
|
||||
Routers manage communication between subnets.
|
||||
El tamaño de una subred depende de los requisitos de conectividad y de la tecnología de red utilizada.
|
||||
|
||||
The size of a subnet depends on the connectivity requirements and the network technology used.
|
||||
Una organización es responsable de determinar el número y tamaño de las subredes dentro de los límites del espacio de direcciones disponibles, y los detalles quedan en manos de esa organización. Las subredes también pueden segmentarse en subredes aún más pequeñas, por ejemplo para enlaces punto a punto o subredes que soporten unos pocos dispositivos.
|
||||
|
||||
An organisation is responsible for determining the number and size of the subnets within the limits of address space
|
||||
available, and the details remain local to that organisation. Subnets can also be segmented into even smaller subnets for things like Point to Point links, or subnetworks supporting a few devices.
|
||||
Entre otras ventajas, segmentar subredes permite la reasignación y descongestiona la red, agilizando la comunicación y la eficiencia.
|
||||
|
||||
Among other advantages, segmenting large
|
||||
networks into subnets enable IP address
|
||||
reallocation and relieves network congestion, streamlining, network communication and efficiency.
|
||||
|
||||
Subnets can also improve network security.
|
||||
If a section of a network is compromised, it can be quarantined, making it difficult for bad actors to move around the larger network.
|
||||
Las subredes también pueden mejorar la seguridad de la red. Si una sección de una red se ve comprometida, puede ponerse en cuarentena, lo que dificulta que los actores maliciosos se muevan por la red más grande.
|
||||
|
||||

|
||||
|
||||
## Resources
|
||||
## Recursos
|
||||
|
||||
- [Networking Fundamentals](https://www.youtube.com/playlist?list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi)
|
||||
- [Subnetting Mastery](https://www.youtube.com/playlist?list=PLIFyRwBY_4bQUE4IB5c4VPRyDoLgOdExE)
|
||||
- [Computer Networking full course](https://www.youtube.com/watch?v=IPvYjXCsTg8)
|
||||
|
||||
See you on [Day 24](day24.md)
|
||||
Nos vemos en el [Día 24](day24.md).
|
||||
|
@ -1,137 +1,136 @@
|
||||
## Network Automation
|
||||
## Automatización de redes
|
||||
|
||||
### Basics of network automation
|
||||
### Fundamentos de la automatización de redes
|
||||
|
||||
Primary drivers for Network Automation
|
||||
Principales impulsores de la automatización de redes:
|
||||
|
||||
- Achieve Agility
|
||||
- Reduce Cost
|
||||
- Eliminate Errors
|
||||
- Ensure Compliance
|
||||
- Centralised Management
|
||||
- Lograr agilidad
|
||||
- Reducir costes
|
||||
- Eliminar errores
|
||||
- Garantizar el cumplimiento
|
||||
- Gestión centralizada
|
||||
|
||||
The automation adoption process is specific to each business. There's no one size fits all when it comes to deploying automation, the ability to identify and embrace the approach that works best for your organisation is critical in advancing towards maintaining or creating a more agile environment, the focus should always be on business value and end-user experience. (We said something similar right at the start in regards to the whole of DevOps and the culture change and the automated process that this brings)
|
||||
El proceso de adopción de la automatización es específico de cada empresa. No hay una talla única para todos cuando se trata de desplegar la automatización, la capacidad de identificar y adoptar el enfoque que mejor funciona para su organización es fundamental para avanzar hacia el mantenimiento o la creación de un entorno más ágil, el foco debe estar siempre en el valor de negocio y la experiencia del usuario final. (Ya se comentó unos días atrás algo parecido sobre la relación de DevOps y el cambio cultural y el proceso automatizado que conlleva).
|
||||
|
||||
To break this down you would need to identify how the task or process that you're trying to automate is going to achieve and improve the end-user experience or business value whilst following a step-by-step systematic approach.
|
||||
Para desglosar esto tendrías que identificar cómo la tarea o el proceso que estás tratando de automatizar va a lograr mejorar la experiencia del usuario final o el valor de negocio mientras sigues un enfoque sistemático paso a paso.
|
||||
|
||||
"If you don't know where you are going, any road will take you there."
|
||||
"Si no sabes adónde vas, cualquier camino te llevará allí".
|
||||
|
||||
Have a framework or design structure that you're trying to achieve know what your end goal is and then work step by step towards achieving that goal measuring the automation success at various stages based on the business outcomes.
|
||||
Tenga un marco o una estructura de diseño que intente alcanzar, sepa cuál es su objetivo final y trabaje paso a paso para conseguirlo, midiendo el éxito de la automatización en las distintas fases en función de los resultados empresariales.
|
||||
|
||||
Build concepts modelled around existing applications there's no need to design the concepts around automation in a bubble because they need to be applied to your application, your service, and your infrastructure, so begin to build the concepts and model them around your existing infrastructure, you're existing applications.
|
||||
No hay necesidad de diseñar los conceptos de automatización en una burbuja porque deben aplicarse a su aplicación, su servicio y su infraestructura, así que empiece a construir los conceptos y a modelarlos en torno a su infraestructura y sus aplicaciones actuales.
|
||||
|
||||
### Approach to Networking Automation
|
||||
### Enfoque de la automatización de redes
|
||||
|
||||
We should identify the tasks and perform a discovery on network change requests so that you have the most common issues and problems to automate a solution to.
|
||||
Debemos **identificar las tareas y las solicitudes de cambio de red** para que tener los problemas más comunes localizados para su posterior automatizar de la solución:
|
||||
|
||||
- Make a list of all the change requests and workflows that are currently being addressed manually.
|
||||
- Determine the most common, time-consuming and error-prone activities.
|
||||
- Prioritise the requests by taking a business-driven approach.
|
||||
- This is the framework for building an automation process, what must be automated and what must not.
|
||||
- Haga una lista de todas las solicitudes de cambio y flujos de trabajo que actualmente se abordan manualmente.
|
||||
- Determine las actividades más comunes, que consumen más tiempo y son más propensas a errores.
|
||||
- Priorice las solicitudes adoptando un enfoque orientado a la empresa.
|
||||
- Este es el marco para construir un proceso de automatización, qué debe automatizarse y qué no.
|
||||
|
||||
We should then divide tasks and analyse how different network functions work and interact with each other.
|
||||
A continuación, hay que **dividir las tareas y analizar** cómo funcionan e interactúan entre sí las distintas funciones de la red:
|
||||
|
||||
- The infrastructure/Network team receives change tickets at multiple layers to deploy applications.
|
||||
- Based on Network services, divide them into different areas and understand how they interact with each other.
|
||||
- Application Optimisation
|
||||
- ADC (Application Delivery Controller)
|
||||
- Firewall
|
||||
- DDI (DNS, DHCP, IPAM etc)
|
||||
- El equipo de infraestructura/red recibe tickets de cambio en múltiples capas para desplegar aplicaciones.
|
||||
- Basándose en los servicios de red, divídalos en diferentes áreas y comprenda cómo interactúan entre sí.
|
||||
- Optimización de aplicaciones
|
||||
- ADC - Application Delivery Controller (controlador de entrega de aplicaciones)
|
||||
- Firewalls
|
||||
- DDI (DNS, DHCP, IPAM, etc.)
|
||||
- Routing
|
||||
- Others
|
||||
- Identify various dependencies to address business and cultural differences and bring in cross-team collaboration.
|
||||
- Otros
|
||||
- Identificar las distintas dependencias para abordar las diferencias empresariales y culturales e introducir la colaboración entre equipos.
|
||||
|
||||
Reusable policies, define and simplify reusable service tasks, processes and input/outputs.
|
||||
**Políticas reutilizables**: Definir y simplificar tareas, procesos y entradas/salidas de servicios reutilizables.
|
||||
|
||||
- Define offerings for various services, processes and input/outputs.
|
||||
- Simplifying the deployment process will reduce the time to market for both new and existing workloads.
|
||||
- Once you have a standard process, it can be sequenced and aligned to individual requests for a multi-threaded approach and delivery.
|
||||
- Definir ofertas para diversos servicios, procesos y entradas/salidas.
|
||||
- Simplificar el proceso de implantación reducirá el tiempo de comercialización tanto de las cargas de trabajo nuevas como de las existentes.
|
||||
- Una vez que se dispone de un proceso estándar, se puede secuenciar y alinear con las solicitudes individuales para un enfoque y una entrega multihilo.
|
||||
|
||||
Combine the policies with business-specific activities. How does implementing this policy help the business? Saves time? Saves Money? Provides a better business outcome?
|
||||
**Combine las políticas con actividades específicas de la empresa**. ¿Cómo ayuda a la empresa la aplicación de esta política? ¿Ahorra tiempo? ¿Ahorra dinero? ¿Proporciona un mejor resultado empresarial?
|
||||
|
||||
- Ensure that service tasks are interoperable.
|
||||
- Associate the incremental service tasks so that they align to create business services.
|
||||
- Allow for the flexibility to associate and re-associate service tasks on demand.
|
||||
- Deploy Self-Service capabilities and pave the way for improved operational efficiency.
|
||||
- Allow for the multiple technology skillsets to continue to contribute with oversight and compliance.
|
||||
- Asegúrese de que las tareas de servicio son interoperables.
|
||||
- Asociar las tareas de servicio incrementales de modo que se alineen para crear servicios de negocio.
|
||||
- Permitir la flexibilidad para asociar y reasociar tareas de servicio bajo demanda.
|
||||
- Desplegar capacidades de autoservicio y allanar el camino para mejorar la eficiencia operativa.
|
||||
- Permitir que los múltiples conjuntos de habilidades tecnológicas sigan contribuyendo con la supervisión y el cumplimiento.
|
||||
|
||||
**Iterate** on the policies and process, adding and improving while maintaining availability and service.
|
||||
**Iterar** en las políticas y procesos, añadiendo y mejorando al tiempo que se mantiene la disponibilidad y el servicio:
|
||||
|
||||
- Start small by automating existing tasks.
|
||||
- Get familiar with the automation process, so that you can identify other areas that can benefit from automation.
|
||||
- iterate your automation initiatives, adding agility incrementally while maintaining the required availability.
|
||||
- Taking an incremental approach paves the way for success!
|
||||
- Empezar poco a poco con la automatizando las tareas existentes.
|
||||
- Familiarícese con el proceso de automatización, de modo que pueda identificar otras áreas que puedan beneficiarse de la automatización.
|
||||
- Itere sus iniciativas de automatización, añadiendo agilidad de forma incremental mientras mantiene la disponibilidad requerida.
|
||||
- Adoptar un enfoque gradual allana el camino hacia el éxito.
|
||||
|
||||
Orchestrate the network service!
|
||||
**Orquestar** el servicio de red:
|
||||
|
||||
- Automation of the deployment process is required to deliver applications rapidly.
|
||||
- Creating an agile service environment requires different elements to be managed across technology skillsets.
|
||||
- Prepare for an end to end orchestration that provides for control over automation and the order of deployments.
|
||||
- La automatización del proceso de despliegue es necesaria para ofrecer aplicaciones con rapidez.
|
||||
- La creación de un entorno de servicio ágil requiere la gestión de diferentes elementos a través de conjuntos de competencias tecnológicas.
|
||||
- Prepárese para una orquestación de extremo a extremo que permita controlar la automatización y el orden de las implantaciones.
|
||||
|
||||
## Network Automation Tools
|
||||
## Herramientas de Automatización de Red
|
||||
|
||||
The good news here is that for the most part, the tools we use here for Network automation are generally the same that we will use for other areas of automation or what we have already covered so far or what we will cover in future sessions.
|
||||
Una buena noticia es que, en su mayor parte, las herramientas que utilizamos para la automatización de redes son generalmente las mismas que utilizaremos para otras áreas de automatización. Lo que ya hemos cubierto hasta ahora o lo que cubriremos en futuras sesiones.
|
||||
|
||||
Operating System - As I have throughout this challenge, I am focusing on doing most of my learning with a Linux OS, those reasons were given in the Linux section but almost all of the tooling that we will touch albeit cross-OS platforms maybe today they all started as Linux based applications or tools, to begin with.
|
||||
**Sistema Operativo** - Este reto se centra en hacer la mayor parte del aprendizaje con un sistema operativo Linux. Las razones se dieron en la sección de Linux, pero casi todas las herramientas que tocaremos, aunque muchas ya sean multi-plataforma, la mayoría comenzaron como aplicaciones basadas en Linux.
|
||||
|
||||
Integrated Development Environment (IDE) - Again not much to say here other than throughout I would suggest Visual Studio Code as your IDE, based on the extensive plugins that are available for so many different languages.
|
||||
**Entorno de Desarrollo Integrado (IDE)** - De nuevo, no hay mucho que decir aquí aparte de que yo sugeriría Visual Studio Code como IDE, por sus gran cantidad de plugins disponibles para diferentes lenguajes.
|
||||
|
||||
Configuration Management - We have not got to the Configuration management section yet, but it is very clear that Ansible is a favourite in this area for managing and automating configurations. Ansible is written in Python but you do not need to know Python.
|
||||
**Gestión de la configuración** - Todavía no llegamos a la sección de gestión de la configuración, pero está muy claro que Ansible es uno de los favoritos en esta área para la gestión y automatización de configuraciones. Ansible está escrito en Python, pero no es necesario saber Python.
|
||||
|
||||
- Agentless
|
||||
- Only requires SSH
|
||||
- Large Support Community
|
||||
- Lots of Network Modules
|
||||
- Push only model
|
||||
- Configured with YAML
|
||||
- Open Source!
|
||||
- Agentless (Sin agente)
|
||||
- Sólo requiere SSH
|
||||
- Gran comunidad de soporte
|
||||
- Muchos módulos de red
|
||||
- Modelo sólo push
|
||||
- Configurado con YAML
|
||||
- ¡Código abierto!
|
||||
|
||||
[Link to Ansible Network Modules](https://docs.ansible.com/ansible/2.9/modules/list_of_network_modules.html)
|
||||
|
||||
We will also touch on **Ansible Tower** in the configuration management section, see this as the GUI front end for Ansible.
|
||||
Tocaremos **Ansible Tower** en la sección de gestión de la configuración, es una interfaz gráfica de Ansible.
|
||||
|
||||
CI/CD - Again we will cover more about the concepts and tooling around this but it's important to at least mention here as this spans not only networking but all provisioning of service and platform.
|
||||
**CI/CD** - Vamos a cubrir más aspectos acerca de los conceptos y herramientas en torno a la integración y el despliegue continuo, pero es importante al menos mencionarlo aquí, ya que esto abarca la creación de redes y mucho más, como todo el aprovisionamiento de servicios y plataformas.
|
||||
|
||||
In particular, Jenkins provides or seems to be a popular tool for Network Automation.
|
||||
En particular, Jenkins es una herramienta popular para la automatización de redes.
|
||||
|
||||
- Monitors git repository for changes and then initiates them.
|
||||
- Monitorea el repositorio git en busca de cambios y luego los inicia.
|
||||
|
||||
Version Control - Again something we will dive deeper into later on.
|
||||
**Control de versiones** - De nuevo algo en lo que profundizaremos más adelante.
|
||||
|
||||
- Git provides version control of your code on your local device - Cross-Platform
|
||||
- GitHub, GitLab, BitBucket etc are online websites where you define your repositories and upload your code.
|
||||
- Git proporciona control de versiones de el código en tu dispositivo local y en remoto.
|
||||
- Multiplataforma
|
||||
- GitHub, GitLab, Gitea, BitBucket, etc. Son sitios web en línea donde puedes guardar tus repositorios y subir código. También se conocen como forjas.
|
||||
|
||||
Language | Scripting - Something we have not covered here is Python as a language, I decided to dive into Go instead as the programming language based on my circumstances, I would say that it was a close call between Golang and Python and Python it seems to be the winner for Network Automation.
|
||||
**Lenguaje | Scripting** - Un lenguaje de programación que no cubriremos es Python. Se escogió Go en su lugar como el lenguaje de programación por una visión subjetiva de las posibles necesidades a cubrir, pero fue una elección reñida de Golang con Python, ya que Python está muy presente en todas partes y además parece ser el ganador para la Automatización de Redes.
|
||||
|
||||
- Nornir is something to mention here, an automation framework written in Python. This seems to take the role of Ansible but specifically around Network Automation. [Nornir documentation](https://nornir.readthedocs.io/en/latest/)
|
||||
- Nornir merece tener se mención, es un marco de automatización escrito en Python. Este parece tomar el rol de Ansible pero específicamente alrededor de la Automatización de Redes. Echa un vistazo a la [Documentación de Nornir](https://nornir.readthedocs.io/en/latest/)
|
||||
|
||||
Analyse APIs - Postman is a great tool for analysing RESTful APIs. Helps to build, test and modify APIs.
|
||||
**Analizar APIs** - Postman es una gran herramienta para analizar APIs RESTful. Ayuda a construir, probar y modificar APIs.
|
||||
|
||||
- POST >>> To create resources objects.
|
||||
- GET >>> To retrieve a resources.
|
||||
- PUT >>> To create or replace the resources.
|
||||
- PATCH >>> To create or update the resources object.
|
||||
- Delete >>> To delete a resources
|
||||
- POST >>> Para crear objetos de recursos.
|
||||
- GET >>> Para recuperar un recurso.
|
||||
- PUT >>> Para crear o reemplazar los recursos.
|
||||
- PATCH >>> Para crear o actualizar un objeto de recurso.
|
||||
- Delete >>> Para borrar un recurso
|
||||
|
||||
[Postman tool Download](https://www.postman.com/downloads/)
|
||||
[Descarga de herramientas Postman](https://www.postman.com/downloads/)
|
||||
|
||||
### Other tools to mention
|
||||
### Otras herramientas a mencionar
|
||||
|
||||
[Cisco NSO (Network Services Orchestrator)](https://www.cisco.com/c/en/us/products/cloud-systems-management/network-services-orchestrator/index.html)
|
||||
- [Cisco NSO (Network Services Orchestrator - Orquestador de servicios de red)](https://www.cisco.com/c/en/us/products/cloud-systems-management/network-services-orchestrator/index.html)
|
||||
- [NetYCE - Simplificar la Automatización de Redes](https://netyce.com/)
|
||||
- [Automatización de pruebas de red](https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/#/)
|
||||
|
||||
[NetYCE - Simplify Network Automation](https://netyce.com/)
|
||||
Durante los próximos 3 días nos pondremos manos a la obra con algunas de teorías que hemos cubierto sobre la red, así podremos trabajar un poco en torno a Python y automatización de red.
|
||||
|
||||
[Network Test Automation](https://pubhub.devnetcloud.com/media/genie-feature-browser/docs/#/)
|
||||
No hemos cubierto todos los temas de redes, tan solo se ha repasado la teoría lo justo y necesario como para tener una pequeña base de conceptos. Es aconsejable ampliar los conocimientos con los recursos que se agregan a continuación.
|
||||
|
||||
Over the next 3 days, I am planning to get more hands-on with some of the things we have covered and put some work in around Python and Network automation.
|
||||
|
||||
We have nowhere near covered all of the networking topics so far but wanted to make this broad enough to follow along and still keep learning from the resources I am adding below.
|
||||
|
||||
## Resources
|
||||
## Recursos
|
||||
|
||||
- [3 Necessary Skills for Network Automation](https://www.youtube.com/watch?v=KhiJ7Fu9kKA&list=WL&index=122&t=89s)
|
||||
- [Computer Networking full course](https://www.youtube.com/watch?v=IPvYjXCsTg8)
|
||||
- [Practical Networking](http://www.practicalnetworking.net/)
|
||||
- [Python Network Automation](https://www.youtube.com/watch?v=xKPzLplPECU&list=WL&index=126)
|
||||
|
||||
See you on [Day 25](day25.md)
|
||||
Nos vemos el [Día 25](day25.md).
|
||||
|
@ -1,159 +1,153 @@
|
||||
## Python for Network Automation
|
||||
## Python para la Automatización de Redes
|
||||
|
||||
Python is the standard language used for automated network operations.
|
||||
Python es el lenguaje estándar utilizado para las operaciones de red automatizadas.
|
||||
|
||||
Whilst it is not only for network automation it seems to be everywhere when you are looking for resources and as previously mentioned if it's not Python then it's generally Ansible which is written also in Python.
|
||||
Si bien no es sólo para la automatización de la red, realmente parece estar en todas partes cuando buscas recursos y, como se mencionó anteriormente, si no es Python generalmente es Ansible, el cuál también en Python.
|
||||
|
||||
I think I have mentioned this already but during the "Learn a programming language" section I chose Golang over Python for reasons around my company is developing in Go so that was a good reason for me to learn but if that was not the case then Python would have taken that time.
|
||||
- Legibilidad y facilidad de uso - Parece que Python simplemente tiene sentido. No parece haber requisitos en torno a `{}` en el código para iniciar y finalizar bloques. Si unimos esto a un IDE potente como [VS Code](https://code.visualstudio.com/), tendremos un comienzo bastante fácil cuando queramos ejecutar código python.
|
||||
|
||||
- Readability and ease of use - It seems that Python seems just makes sense. There don't seem to be the requirements around `{}` in the code to start and end blocks. Couple this with a strong IDE like VS Code you have a pretty easy start when wanting to run some python code.
|
||||
[Pycharm](https://www.jetbrains.com/pycharm/) podría ser otro IDE digno de mención aquí.
|
||||
|
||||
Pycharm might be another IDE worth mentioning here.
|
||||
- Librerías - La extensibilidad de Python es la verdadera mina de oro aquí, como se ha comentado no es sólo para Automatización de Redes pero de hecho, hay librerías de sobra para todo tipo de dispositivos y configuraciones. Puedes ver la gran cantidad aquí [PyPi](https://pypi.python.org/pypi)
|
||||
|
||||
- Libraries - The extensibility of Python is the real gold mine here, I mentioned before that this is not just for Network Automation but in fact, there are libraries plenty for all sorts of devices and configurations. You can see the vast amount here [PyPi](https://pypi.python.org/pypi)
|
||||
Cuando quieres descargar la librería a tu workstation, entonces usas una herramienta llamada `pip` para conectarte a PyPI y descargarla localmente. Vendedores de redes como Cisco, Juniper y Arista desarrollaron librerías para facilitar el acceso a sus dispositivos.
|
||||
|
||||
When you want to download the library to your workstation, then you use a tool called `pip` to connect to PyPI and download it locally. Network vendors such as Cisco, Juniper, and Arista developed libraries to facilitate access to their devices.
|
||||
|
||||
- Powerful & Efficient - Remember during the Go days I went through the "Hello World" scenario and we went through I think 6 lines of code? In Python it is
|
||||
- Potente y Eficiente - ¿Recuerdas que durante los días de Go pasé por el escenario "Hola Mundo" y recorrimos creo que 6 líneas de código? En Python es
|
||||
|
||||
```
|
||||
print('hello world')
|
||||
```
|
||||
|
||||
Put all of the above points together and it should be easy to see why Python is generally mentioned as the de-facto tool when working on automating.
|
||||
Ponga todos los puntos anteriores juntos y debería ser fácil ver por qué Python se menciona generalmente como la herramienta de-facto cuando se trabaja en la automatización.
|
||||
|
||||
I think it's important to note that it's possible that several years back there were scripts that might have interacted with your network devices to maybe automate the backup of configuration or to gather logs and other insights into your devices. The automation we are talking about here is a little different and that's because the overall networking landscape has also changed to suit this way of thinking better and enabled more automation.
|
||||
Creo que es importante tener en cuenta que es posible que hace varios años había scripts que podrían haber interactuado con sus dispositivos de red para tal vez automatizar la copia de seguridad de la configuración o para recopilar registros y otras ideas en sus dispositivos. La automatización de la que estamos hablando aquí es un poco diferente y eso se debe a que el panorama general de las redes también ha cambiado para adaptarse mejor a esta forma de pensar y ha permitido una mayor automatización.
|
||||
|
||||
- Software-Defined Network - SDN Controllers take the responsibility of delivering the control plane configuration to all devices on the network, meaning just a single point of contact for any network changes, no longer having to telnet or SSH into every device and also relying on humans to do this which has a repeatable chance of failure or misconfiguration.
|
||||
- Red definida por software: los controladores SDN asumen la responsabilidad de proporcionar la configuración del plano de control a todos los dispositivos de la red, lo que significa un único punto de contacto para cualquier cambio en la red, ya no es necesario conectarse por telnet o SSH a cada dispositivo y depender de humanos para hacerlo, lo que tiene una probabilidad repetible de fallos o errores de configuración.
|
||||
|
||||
- High-Level Orchestration - Go up a level from those SDN controllers and this allows for orchestration of service levels then there is the integration of this orchestration layer into your platforms of choice, VMware, Kubernetes, Public Clouds etc.
|
||||
- Orquestación de alto nivel: suba un nivel desde los controladores SDN y esto permite la orquestación de los niveles de servicio, luego está la integración de esta capa de orquestación en sus plataformas de elección, VMware, Kubernetes, nubes públicas, etc.
|
||||
|
||||
- Policy-based management - What do you want to have? What is the desired state? You describe this and the system has all the details on how to figure it out to become the desired state.
|
||||
- Gestión basada en políticas: ¿Qué desea tener? ¿Cuál es el estado deseado? Usted describe esto y el sistema tiene todos los detalles sobre cómo resolverlo para convertirse en el estado deseado.
|
||||
|
||||
## Setting up the lab environment
|
||||
## Configuración del entorno de laboratorio
|
||||
|
||||
Not everyone has access to physical routers, switches and other networking devices.
|
||||
No todo el mundo tiene acceso a routers físicos, switches y otros dispositivos de red.
|
||||
|
||||
I wanted to make it possible for us to look at some of the tooling pre-mentioned but also get hands-on and learn how to automate the configuration of our networks.
|
||||
|
||||
When it comes to options there are a few that we can choose from.
|
||||
Algunas herramientas pueden ayudar para aprender a automatizar la configuración de nuestras redes. Algunas de ellas son:
|
||||
|
||||
- [GNS3 VM](https://www.gns3.com/software/download-vm)
|
||||
- [Eve-ng](https://www.eve-ng.net/)
|
||||
- [Unimus](https://unimus.net/) Not a lab environment but an interesting concept.
|
||||
- [Unimus](https://unimus.net/) No es un entorno de laboratorio pero es un concepto interesante.
|
||||
|
||||
We will build our lab out using [Eve-ng](https://www.eve-ng.net/) as mentioned before you can use a physical device but to be honest a virtual environment means that we can have a sandbox environment to test many different scenarios. Plus being able to play with different devices and topologies might be of interest.
|
||||
Vamos a construir nuestro laboratorio utilizando [Eve-ng](https://www.eve-ng.net/) pero también se puede utilizar un dispositivo físico. Una ventaja de utilizar un entorno virtual es que podemos tener un entorno de sandbox para probar muchos escenarios diferentes. Además de ser capaz de jugar con diferentes dispositivos y topologías que podrían resultar de interés.
|
||||
|
||||
We are going to do everything on EVE-NG with the community edition.
|
||||
Vamos a hacer todo en EVE-NG con la edición de la comunidad.
|
||||
|
||||
### Getting started
|
||||
### Introducción
|
||||
|
||||
The community edition comes in ISO and OVF formats for [download](https://www.eve-ng.net/index.php/download/)
|
||||
La edición de la comunidad viene en formatos ISO y OVF para [descargar](https://www.eve-ng.net/index.php/download/).
|
||||
|
||||
We will be using the OVF download but with the ISO there is the option to build out on a bare metal server without the need for a hypervisor.
|
||||
Vamos a utilizar la descarga OVF, pero con la ISO existe la opción de construir en un servidor bare metal sin necesidad de un hipervisor.
|
||||
|
||||

|
||||
|
||||
For our walkthrough, we will be using VMware Workstation as I have a license via my vExpert but you can equally use VMware Player or any of the other options mentioned in the [documentation](https://www.eve-ng.net/index.php/documentation/installation/system-requirement/)Unfortunately we cannot use our previously used Virtual box!
|
||||
Para este tutorial se utilizará un VMware Workstation, con una licencia a través de vExpert, pero también se puede utilizar VMware Player o cualquiera de las otras opciones mencionadas en la [documentación](https://www.eve-ng.net/index.php/documentation/installation/system-requirement/). Desafortunadamente, ¡no podemos utilizar el Virtualbox utilizado anteriormente!
|
||||
|
||||
This is also where I had an issue with GNS3 with Virtual Box even though supported.
|
||||
Aquí es también donde hubo un problema con GNS3 con Virtual Box a pesar de ser compatible.
|
||||
|
||||
[Download VMware Workstation Player - FREE](https://www.vmware.com/uk/products/workstation-player.html)
|
||||
[Descargar VMware Workstation Player - GRATIS](https://www.vmware.com/uk/products/workstation-player.html)
|
||||
|
||||
[VMware Workstation PRO](https://www.vmware.com/uk/products/workstation-pro.html) Also noted that there is an evaluation period for free!
|
||||
[VMware Workstation PRO](https://www.vmware.com/uk/products/workstation-pro.html) ¡También tiene un periodo de evaluación gratuito!
|
||||
|
||||
### Installation on VMware Workstation PRO
|
||||
### Instalación en VMware Workstation PRO
|
||||
|
||||
Now we have our hypervisor software downloaded and installed, and we have the EVE-NG OVF downloaded. If you are using VMware Player please let me know if this process is the same.
|
||||
Ahora tenemos el software de hipervisor descargado e instalado, y tenemos el OVF de EVE-NG descargado. Si estás usando VMware Player por favor hazme saber si este proceso es el mismo.
|
||||
|
||||
We are now ready to get things configured.
|
||||
|
||||
Open VMware Workstation and then select `file` and `open`
|
||||
Ahora estamos listos para configurar las cosas. Abre VMware Workstation y selecciona `file` y `open`.
|
||||
|
||||

|
||||
|
||||
When you download the EVE-NG OVF Image it is going to be within a compressed file. Extract the contents out into its folder so it looks like this.
|
||||
Cuando descargues la imagen OVF de EVE-NG estará dentro de un archivo comprimido. Extraiga el contenido en su carpeta para que se vea así.
|
||||
|
||||

|
||||
|
||||
Navigate to the location where you downloaded the EVE-NG OVF image and begin the import.
|
||||
Navegue hasta la ubicación donde descargaste la imagen OVF de EVE-NG y comience la importación.
|
||||
|
||||
Give it a recognisable name and store the virtual machine somewhere on your system.
|
||||
Dale un nombre reconocible y guarda la máquina virtual en algún lugar de tu sistema.
|
||||
|
||||

|
||||
|
||||
When the import is complete increase the number of processors to 4 and the memory allocated to 8 GB. (This should be the case after import with the latest version if not then edit VM settings)
|
||||
Cuando finalice la importación, aumente el número de procesadores a 4 y la memoria asignada a 8 GB. (Esto debería ser así después de la importación con la última versión, si no es así, edite la configuración de la máquina virtual).
|
||||
|
||||
Also, make sure the Virtualise Intel VT-x/EPT or AMD-V/RVI checkbox is enabled. This option instructs the VMware workstation to pass the virtualisation flags to the guest OS (nested virtualisation) This was the issue I was having with GNS3 with Virtual Box even though my CPU allows this.
|
||||
Además, asegúrese de que la casilla Virtualizar Intel VT-x/EPT o AMD-V/RVI está activada. Esta opción indica a VMware workstation que pase los flags de virtualización al sistema operativo invitado (virtualización anidada). Este era el problema que tenía con GNS3 con Virtual Box aunque el CPU lo permite.
|
||||
|
||||

|
||||
|
||||
### Power on & Access
|
||||
### Encendido y acceso
|
||||
|
||||
Sidenote & Rabbit hole: Remember I mentioned that this would not work with VirtualBox! Well yeah had the same issue with VMware Workstation and EVE-NG but it was not the fault of the virtualisation platform!
|
||||
Nota al margen y Rabbit hole: ¿Recuerdas que mencioné que esto no funcionaría con VirtualBox? Bueno, sí, tuve el mismo problema con VMware Workstation y EVE-NG, pero no fue culpa de la plataforma de virtualización.
|
||||
|
||||
I have WSL2 running on my Windows Machine and this seems to remove the capability of being able to run anything nested inside of your environment. I am confused as to why the Ubuntu VM does run as it seems to take out the Intel VT-d virtualisation aspect of the CPU when using WSL2.
|
||||
Con WSL2 ejecutándose en Windows y esto parece eliminar la capacidad de poder ejecutar cualquier cosa anidada dentro del entorno. Estoy confundido en cuanto a por qué el Ubuntu VM se ejecuta, ya que parece sacar el Intel VT-d aspecto de virtualización de la CPU cuando se utiliza WSL2.
|
||||
|
||||
To resolve this we can run the following command on our Windows machine and reboot the system, note that whilst this is off then you will not be able to use WSL2.
|
||||
Para resolver esto podemos ejecutar el siguiente comando en nuestra máquina Windows y reiniciar el sistema, tenga en cuenta que mientras esto está apagado no serás capaz de utilizar WSL2.
|
||||
|
||||
`bcdedit /set hypervisorlaunchtype off`
|
||||
|
||||
When you want to go back and use WSL2 then you will need to run this command and reboot.
|
||||
Cuando quieras volver a utilizar WSL2 tendrás que ejecutar este comando y reiniciar.
|
||||
|
||||
`bcdedit /set hypervisorlaunchtype auto`
|
||||
|
||||
Both of these commands should be run as administrator!
|
||||
Ambos comandos deben ejecutarse como administrador.
|
||||
|
||||
Ok back to the show, You should now have a powered-on machine in VMware Workstation and you should have a prompt looking similar to this.
|
||||
Ahora deberías tener una máquina encendida en VMware Workstation y un prompt similar a este.
|
||||
|
||||

|
||||
|
||||
On the prompt above you can use:
|
||||
En el prompt de arriba puedes usar:
|
||||
|
||||
username = root
|
||||
password = eve
|
||||
|
||||
You will then be asked to provide the root password again, this will be used to SSH into the host later on.
|
||||
A continuación, se le pedirá que proporcione la contraseña de root de nuevo, que se utilizará para SSH en el host más adelante.
|
||||
|
||||
We then can change the hostname.
|
||||
A continuación, podemos cambiar el nombre de host.
|
||||
|
||||

|
||||
|
||||
Next, we define a DNS Domain Name, I have used the one below but I am not sure if this will need to be changed later on.
|
||||
A continuación, definimos un Nombre de Dominio DNS, he utilizado el de abajo, pero no estoy seguro de si esto tendrá que ser cambiado más adelante.
|
||||
|
||||

|
||||
|
||||
We then configure networking, I am selecting static so that the IP address given will be persistent after reboots.
|
||||
Luego configuramos la red, selecciono estática para que la dirección IP sea persistente después de reiniciar.
|
||||
|
||||

|
||||
|
||||
The final step, provide a static IP address from a network that is reachable from your workstation.
|
||||
El paso final, proporcionar una dirección IP estática de una red que sea alcanzable desde su estación de trabajo.
|
||||
|
||||

|
||||
|
||||
There are some additional steps here where you will have to provide a subnet mask for your network, default gateway and DNS.
|
||||
Hay algunos pasos adicionales aquí donde tendrá que proporcionar una máscara de subred para su red, puerta de enlace predeterminada y DNS.
|
||||
|
||||
Once finished it will reboot, when it is back up you can take your static IP address and put this into your browser.
|
||||
Una vez terminado se reiniciará, cuando vuelva a funcionar puedes tomar tu dirección IP estática y ponerla en tu navegador.
|
||||
|
||||

|
||||
|
||||
The default username for the GUI is `admin` and the password is `eve` while the default username for SSH is `root` and the password is `eve` but this would have been changed if you changed during the setup.
|
||||
El nombre de usuario por defecto para la GUI es `admin` y la contraseña es `eve` mientras que el nombre de usuario por defecto para SSH es `root` y la contraseña es `eve` pero esto se puede haber cambiado durante la configuración.
|
||||
|
||||

|
||||
|
||||
I chose HTML5 for the console vs native as this will open a new tab in your browser when you are navigating through different consoles.
|
||||
Elegí HTML5 para la consola vs nativa ya que esto abrirá una nueva pestaña en tu navegador cuando estés navegando a través de diferentes consolas.
|
||||
|
||||
Next up we are going to:
|
||||
A continuación vamos a:
|
||||
|
||||
- Install the EVE-NG client pack
|
||||
- Load some network images into EVE-NG
|
||||
- Build a Network Topology
|
||||
- Adding Nodes
|
||||
- Connecting Nodes
|
||||
- Start building Python Scripts
|
||||
- Look at telnetlib, Netmiko, Paramiko and Pexpect
|
||||
- Instalar el paquete cliente de EVE-NG
|
||||
- Cargar algunas imágenes de red en EVE-NG
|
||||
- Construir una topología de red
|
||||
- Añadir Nodos
|
||||
- Conectar Nodos
|
||||
- Empezar a construir Scripts Python
|
||||
- Mira telnetlib, Netmiko, Paramiko y Pexpect
|
||||
|
||||
## Resources
|
||||
## Recursos
|
||||
|
||||
- [Free Course: Introduction to EVE-NG](https://www.youtube.com/watch?v=g6B0f_E0NMg)
|
||||
- [EVE-NG - Creating your first lab](https://www.youtube.com/watch?v=9dPWARirtK8)
|
||||
@ -162,4 +156,4 @@ Next up we are going to:
|
||||
- [Practical Networking](http://www.practicalnetworking.net/)
|
||||
- [Python Network Automation](https://www.youtube.com/watch?v=xKPzLplPECU&list=WL&index=126)
|
||||
|
||||
See you on [Day 26](day26.md)
|
||||
Nos vemos el [Día 26](day26.md).
|
||||
|
@ -1,38 +1,38 @@
|
||||
## Building our Lab
|
||||
## Construyendo nuestro Laboratorio
|
||||
|
||||
We are going to continue our setup of our emulated network using EVE-NG and then hopefully get some devices deployed and start thinking about how we can automate the configuration of these devices. On [Day 25](day25.md) we covered the installation of EVE-NG onto our machine using VMware Workstation.
|
||||
Vamos a continuar con la configuración de nuestra red emulada utilizando EVE-NG y luego esperamos tener algunos dispositivos desplegados y empezar a pensar en cómo podemos automatizar la configuración de estos dispositivos. En el [Día 25](day25.md) vimos la instalación de EVE-NG en nuestra máquina utilizando VMware Workstation.
|
||||
|
||||
### Installing EVE-NG Client
|
||||
### Instalación del cliente de EVE-NG
|
||||
|
||||
There is also a client pack that allows us to choose which application is used when we SSH to the devices. It will also set up Wireshark for packet captures between links. You can grab the client pack for your OS (Windows, macOS, Linux).
|
||||
También hay un paquete de cliente que nos permite elegir qué aplicación se utiliza en la conexiones SSH a los dispositivos. También configurará Wireshark para capturas de paquetes entre enlaces. Puedes hacerte con el pack de cliente para tu SO (Windows, macOS, Linux).
|
||||
|
||||
[EVE-NG Client Download](https://www.eve-ng.net/index.php/download/)
|
||||
[Descarga del cliente EVE-NG](https://www.eve-ng.net/index.php/download/)
|
||||
|
||||

|
||||
|
||||
Quick Tip: If you are using Linux as your client then there is this [client pack](https://github.com/SmartFinn/eve-ng-integration).
|
||||
Sugerencia rápida: Si utilizas Linux como cliente, existe este [paquete de cliente](https://github.com/SmartFinn/eve-ng-integration).
|
||||
|
||||
The install is straightforward next, next and I would suggest leaving the defaults.
|
||||
La instalación es directa y como sugerencia, en un principio, es mejor dejar los valores predeterminados.
|
||||
|
||||
### Obtaining network images
|
||||
### Obtención de imágenes de red
|
||||
|
||||
This step has been a challenge, I have followed some videos that I will link at the end that links to some resources and downloads for our router and switch images whilst telling us how and where to upload them.
|
||||
Este paso ha sido todo un reto, he seguido algunos videos que están enlazados al final en el apartado de recursos y descargas para las imágenes de nuestro router y switch a la vez que nos indican cómo y dónde subirlas.
|
||||
|
||||
It is important to note that I using everything for education purposes. I would suggest downloading official images from network vendors.
|
||||
Es importante tener en cuenta que yo uso todo con fines educativos. Yo sugeriría descargar imágenes oficiales de los proveedores de red.
|
||||
|
||||
[Blog & Links to YouTube videos](https://loopedback.com/2019/11/15/setting-up-eve-ng-for-ccna-ccnp-ccie-level-studies-includes-multiple-vendor-node-support-an-absolutely-amazing-study-tool-to-check-out-asap/)
|
||||
[Blog y enlaces a vídeos de YouTube](https://loopedback.com/2019/11/15/setting-up-eve-ng-for-ccna-ccnp-ccie-level-studies-includes-multiple-vendor-node-support-an-absolutely-amazing-study-tool-to-check-out-asap/)
|
||||
|
||||
[How To Add Cisco VIRL vIOS image to Eve-ng](https://networkhunt.com/how-to-add-cisco-virl-vios-image-to-eve-ng/)
|
||||
[Cómo añadir la imagen Cisco VIRL vIOS a Eve-ng](https://networkhunt.com/how-to-add-cisco-virl-vios-image-to-eve-ng/)
|
||||
|
||||
Overall the steps here are a little complicated and could be much easier but the above blogs and videos walk through the process of adding the images to your EVE-NG box.
|
||||
En general, los pasos aquí son un poco complicados y podrían ser mucho más fáciles, pero los blogs y videos anteriores guían a través del proceso de añadir las imágenes a su caja EVE-NG.
|
||||
|
||||
I used FileZilla to transfer the qcow2 to the VM over SFTP.
|
||||
Se ha utilizado FileZilla para transferir el qcow2 a la máquina virtual a través de SFTP.
|
||||
|
||||
For our lab, we need Cisco vIOS L2 (switches) and Cisco vIOS (router)
|
||||
Para nuestro laboratorio, necesitamos Cisco vIOS L2 (switches) y Cisco vIOS (router)
|
||||
|
||||
### Create a Lab
|
||||
### Crear un Laboratorio
|
||||
|
||||
Inside the EVE-NG web interface, we are going to create our new network topology. We will have four switches and one router that will act as our gateway to outside networks.
|
||||
Dentro de la interfaz web de EVE-NG, vamos a crear nuestra nueva topología de red. Tendremos cuatro switches y un router que actuará como nuestra puerta de enlace a redes externas.
|
||||
|
||||
| Node | IP Address |
|
||||
| ------- | ------------ |
|
||||
@ -42,50 +42,50 @@ Inside the EVE-NG web interface, we are going to create our new network topology
|
||||
| Switch3 | 10.10.88.113 |
|
||||
| Switch4 | 10.10.88.114 |
|
||||
|
||||
#### Adding our Nodes to EVE-NG
|
||||
#### Añadir nodos a EVE-NG
|
||||
|
||||
When you first log in to EVE-NG you will see a screen like the below, we want to start by creating our first lab.
|
||||
La primera vez que inicies sesión en EVE-NG verás una pantalla como la siguiente, queremos empezar por crear nuestro primer laboratorio.
|
||||
|
||||

|
||||
|
||||
Give your lab a name and the other fields are optional.
|
||||
Dale un nombre a tu laboratorio y los otros campos son opcionales.
|
||||
|
||||

|
||||
|
||||
You will be then greeted with a blank canvas to start creating your network. Right-click on your canvas and choose add node.
|
||||
Te aparecerá un lienzo en blanco para crear tu red. Haz clic con el botón derecho del ratón sobre el lienzo y selecciona añadir nodo.
|
||||
|
||||
From here you will have a long list of node options, If you have followed along above you will have the two in blue shown below and the others are going to be grey and unselectable.
|
||||
A partir de aquí tendrás una larga lista de opciones de nodos, si has seguido lo anterior tendrás los dos en azul que se muestran a continuación y los otros van a ser de color gris y no seleccionables.
|
||||
|
||||

|
||||
|
||||
We want to add the following to our lab:
|
||||
Queremos añadir lo siguiente a nuestro laboratorio:
|
||||
|
||||
- 1 x Cisco vIOS Router
|
||||
- 4 x Cisco vIOS Switch
|
||||
|
||||
Run through the simple wizard to add them to your lab and it should look something like this.
|
||||
Ejecuta el sencillo asistente para añadirlos a tu laboratorio y deberías tener este aspecto.
|
||||
|
||||

|
||||
|
||||
#### Connecting our nodes
|
||||
#### Conectando nuestros nodos
|
||||
|
||||
We now need to add our connectivity between our routers and switches. We can do this quite easily by hovering over the device and seeing the connection icon as per below and then connecting that to the device we wish to connect to.
|
||||
Ahora necesitamos añadir nuestra conectividad entre nuestros routers y switches. Podemos hacerlo fácilmente pasando el ratón por encima del dispositivo y viendo el icono de conexión como se muestra a continuación y conectándolo al dispositivo al que deseamos conectarnos.
|
||||
|
||||

|
||||
|
||||
When you have finished connecting your environment you may also want to add some way to define physical boundaries or locations using boxes or circles which can also be found in the right-click menu. You can also add text which is useful when we want to define our naming or IP addresses in our labs.
|
||||
Cuando hayas terminado de conectar tu entorno, es posible que también desees añadir alguna forma de definir los límites físicos o ubicaciones utilizando cajas o círculos que también se pueden encontrar en el menú del botón derecho. También puedes añadir texto, lo cual es útil cuando queremos definir nuestros nombres o direcciones IP en nuestros laboratorios.
|
||||
|
||||
I went ahead and made my lab look like the below.
|
||||
Seguí adelante e hice mi laboratorio como el siguiente.
|
||||
|
||||

|
||||
|
||||
You will also notice that the lab above is all powered off, we can start our lab by selecting everything and right-clicking and selecting start selected.
|
||||
También te darás cuenta de que el laboratorio de arriba está todo apagado, podemos iniciar nuestro laboratorio seleccionando todo y haciendo clic derecho y seleccionando iniciar seleccionado.
|
||||
|
||||

|
||||
|
||||
Once we have our lab up and running you will be able to console into each device and you will notice at this stage they are pretty dumb with no configuration. We can add some configuration to each node by copying or creating your own in each terminal.
|
||||
Una vez que tengamos nuestro laboratorio en marcha, podremos acceder a la consola de cada dispositivo y nos daremos cuenta de que en esta etapa son bastante tontos, sin ninguna configuración. Podemos añadir alguna configuración a cada nodo copiando o creando la tuya propia en cada terminal.
|
||||
|
||||
I will leave my configuration in the Networking folder of the repository for reference.
|
||||
Dejaré mi configuración en la carpeta Networking del repositorio como referencia.
|
||||
|
||||
| Node | Configuration |
|
||||
| ------- | --------------------- |
|
||||
@ -95,7 +95,7 @@ I will leave my configuration in the Networking folder of the repository for ref
|
||||
| Switch3 | [SW3](Networking/SW3) |
|
||||
| Switch4 | [SW4](Networking/SW4) |
|
||||
|
||||
## Resources
|
||||
## ResRecursosources
|
||||
|
||||
- [Free Course: Introduction to EVE-NG](https://www.youtube.com/watch?v=g6B0f_E0NMg)
|
||||
- [EVE-NG - Creating your first lab](https://www.youtube.com/watch?v=9dPWARirtK8)
|
||||
@ -104,8 +104,8 @@ I will leave my configuration in the Networking folder of the repository for ref
|
||||
- [Practical Networking](http://www.practicalnetworking.net/)
|
||||
- [Python Network Automation](https://www.youtube.com/watch?v=xKPzLplPECU&list=WL&index=126)
|
||||
|
||||
Most of the examples I am using here as I am not a Network Engineer have come from this extensive book which is not free but I am using some of the scenarios to help understand Network Automation.
|
||||
La mayoría de los ejemplos utilizados provienen de este extenso libro que no es gratuito, pero estoy utilizando algunos de los escenarios para ayudar a entender la Automatización de Redes.
|
||||
|
||||
- [Hands-On Enterprise Automation with Python (Book)](https://www.packtpub.com/product/hands-on-enterprise-automation-with-python/9781788998512)
|
||||
|
||||
See you on [Day 27](day27.md)
|
||||
Nos vemos el [Día 27](day27.md).
|
||||
|
@ -1,14 +1,38 @@
|
||||
# 90DaysOfDevOps
|
||||
|
||||
<p align="center">
|
||||
<img src="../logo.png?raw=true" alt="90DaysOfDevOps Logo" width="50%" height="50%" />
|
||||
<img src="logo.png?raw=true" alt="90DaysOfDevOps Logo" width="50%" height="50%" />
|
||||
</p>
|
||||
|
||||
Versión en Castellano | [English Version](../README.md) | [中文版本](zh_cn/README.md) | [繁體中文版本](zh_tw/README.md)| [日本語版](ja/README.md) | [Wersja Polska](pl/README.md) | [Tiếng Việt](vi/README.md)
|
||||
Versión en Castellano | [English Version](../README.md) | [中文版本](../zh_cn/README.md) | [繁體中文版本](../zh_tw/README.md)| [日本語版](../ja/README.md) | [Wersja Polska](../pl/README.md) | [Tiếng Việt](../vi/README.md)
|
||||
|
||||
Este repositorio es un viaje para conseguir conocer los conceptos básicos de la filosofía "DevOps". La idea es hacer un viaje de 90 días, por ejemplo, si comienzas un 1 de enero podrías terminar el recorrido el 31 de marzo. 🚀
|
||||
Índice
|
||||
- [90DaysOfDevOps](#90daysofdevops)
|
||||
- [Descripción](#descripción)
|
||||
- [Documentación del viaje de 90DaysOfDevOps](#documentación-del-viaje-de-90daysofdevops)
|
||||
- [¿Qué es y por qué usamos DevOps?](#qué-es-y-por-qué-usamos-devops)
|
||||
- [Aprender un lenguaje de programación](#aprender-un-lenguaje-de-programación)
|
||||
- [Conociendo lo básico de Linux](#conociendo-lo-básico-de-linux)
|
||||
- [Entender Networking](#entender-networking)
|
||||
- [Quédate con solo un Cloud Provider](#quédate-con-solo-un-cloud-provider)
|
||||
- [Usa Git de forma efectiva](#usa-git-de-forma-efectiva)
|
||||
- [Contenedores](#contenedores)
|
||||
- [Kubernetes](#kubernetes)
|
||||
- [Aprender la infraestructura como código (IaC)](#aprender-la-infraestructura-como-código-iac)
|
||||
- [Automatizar la gestión de la configuración](#automatizar-la-gestión-de-la-configuración)
|
||||
- [Crear CI/CD Pipelines](#crear-cicd-pipelines)
|
||||
- [Monitorización, gestión de logs y visualización de datos.](#monitorización-gestión-de-logs-y-visualización-de-datos)
|
||||
- [Almacenar y proteger tus datos](#almacenar-y-proteger-tus-datos)
|
||||
- [Licencia](#licencia)
|
||||
- [Star History](#star-history)
|
||||
|
||||
|
||||
## Descripción
|
||||
|
||||
Este repositorio es la documentación de un viaje para conseguir conocer los conceptos básicos de la filosofía "DevOps". Comenzó el 1 de enero de 2022 y la idea es hacer un viaje de 90 días, por ejemplo, si comienzas un 1 de enero podrías terminar el recorrido el 31 de marzo. 🚀
|
||||
|
||||
[Phileas Fogg](https://es.wikipedia.org/wiki/Phileas_Fogg) tardó menos en dar la vuelta al mundo.
|
||||
|
||||

|
||||
|
||||
La razón de documentar cada práctica es para que otros puedan aprovecharla mejorando sus conocimientos y recursos.
|
||||
@ -25,18 +49,18 @@ La forma más rápida para ponerse en contacto con el autor es a través de su T
|
||||
|
||||
Y también puedes aportar, darle a fav o abrir incidencias en el [repo original](https://github.com/MichaelCade/90DaysOfDevOps).
|
||||
|
||||
Por otra parte, también puedes agradecer a [Manu](https://github.com/manuelver), la traducción al castellano con bitcoins:
|
||||
El [documento original](https://github.com/MichaelCade/90DaysOfDevOps) es en inglés y la traducción se realizo a finales del año del 2022. También puedes agradecer a [Manu](https://github.com/manuelver) la traducción al castellano con bitcoins:
|
||||
```bitcoin
|
||||
1QESjZDPxWtZ9sj3v5tvgfFn3ks13AxWVZ
|
||||
```
|
||||
|
||||

|
||||
|
||||
Le encantan las mariscadas.
|
||||
A él le encantan las mariscadas.
|
||||
|
||||
Empecemos con lo que vas a poder ver en estos 90 días.
|
||||
|
||||
## Progreso
|
||||
## Documentación del viaje de 90DaysOfDevOps
|
||||
|
||||
- [✔️] ♾️ 1 > [Introducción](Days/day01.md)
|
||||
|
||||
|
BIN
2022/es/logo.png
Normal file
BIN
2022/es/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 659 KiB |
Loading…
Reference in New Issue
Block a user