Skip to content

Commit

Permalink
commit 2
Browse files Browse the repository at this point in the history
Phong Ngo committed Sep 17, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 62110ad commit e78bbec
Showing 16 changed files with 111 additions and 113 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ jobs:
cp -R public/* ${GITHUB_WORKSPACE}/built-site/
cd ${GITHUB_WORKSPACE}/built-site
git add .
git config user.name 'dhij'
git config user.email 'davidhwang.ij@gmail.com'
git config user.name 'PhongNgoLam'
git config user.email 'ngophong010@gmail.com'
git commit -m 'Updated site'
git push
git push
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.hugo_build.lock
public/
resources/
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[submodule "themes/hugo-theme-learn"]
path = themes/hugo-theme-learn
url = https://github.com/matcornic/hugo-theme-learn.git

[submodule "public"]
path = public
url = https://github.com/ngophong010/Workshop001.git
10 changes: 5 additions & 5 deletions content/1-Introduce/_index.md
Original file line number Diff line number Diff line change
@@ -25,22 +25,22 @@ If you prefer this content in video form, check out these videos from Practical
- [Network Devices - Hub, Bridge, Switch, Router - Networking Fundamentals - Lesson 1b](https://www.youtube.com/watch?v=H7-NR3Q3BeI&list=PLIFyRwBY_4bRLmKfP1KnZA6rZbRHtxmXi&index=3)

**Host** are any devices which send or receive traffic.
![Host](/images/1.introduce/001-host.png)
![Host](/Workshop001/images/1.introduce/001-host.png)

**IP Address** the identity of each host.
![IP Address](/images/1.introduce/002-IPAddress.png)
![IP Address](/Workshop001/images/1.introduce/002-IPAddress.png)

**Network** is what transports traffic between hosts. If we did not have networks there would be a lot of manual movement of data!

A logical group of hosts which require similar connectivity.
![Network](/images/1.introduce/003-network.png)
![Network](/Workshop001/images/1.introduce/003-network.png)

**Switches** facilitate communication **within** a network. A switch forwards data packets between hosts. A switch sends packets directly to hosts.

- Network: A Grouping of hosts which require similar connectivity.
- Hosts on a Network share the same IP address space.

![Switch](/images/1.introduce/004-switches.png)
![Switch](/Workshop001/images/1.introduce/004-switches.png)

**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.

@@ -51,7 +51,7 @@ Routers learn which networks they are attached to. These are known as routes, a
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.

Routers also create the hierarchy in networks I mentioned earlier.
![Switch](/images/1.introduce/005-router.png)
![Switch](/Workshop001/images/1.introduce/005-router.png)

### Switches vs Routers
**Routing** is the process of moving data between networks.
10 changes: 5 additions & 5 deletions content/1-Introduce/_index.vi.md
Original file line number Diff line number Diff line change
@@ -26,24 +26,24 @@ Nếu bạn thích nội dung này dưới dạng video, hãy xem các video t

**Host** là bất kỳ thiết bị nào gửi hoặc nhận lưu lượng.

![Host](/images/1.introduce/001-host.png)
![Host](/Workshop001/images/1.introduce/001-host.png)

**Địa chỉ IP** là danh tính của mỗi host.

![Địa chỉ IP](/images/1.introduce/002-IPAddress.png)
![Địa chỉ IP](/Workshop001/images/1.introduce/002-IPAddress.png)

**Mạng** là cái gì đó vận chuyển lưu lượng giữa các host. Nếu không có mạng, sẽ có rất nhiều chuyển động dữ liệu thủ công!

Một nhóm logic của các host cần có kết nối tương tự.

![Mạng](/images/1.introduce/003-network.png)
![Mạng](/Workshop001/images/1.introduce/003-network.png)

**Switch** tạo điều kiện cho việc giao tiếp **trong** một mạng. Một switch chuyển tiếp các gói dữ liệu giữa các host. Một switch gửi gói đến trực tiếp các host.

- Mạng: Một nhóm các host cần có kết nối tương tự.
- Các host trên một mạng chia sẻ cùng một không gian địa chỉ IP.

![Switch](/images/1.introduce/004-switches.png)
![Switch](/Workshop001/images/1.introduce/004-switches.png)

**Router** tạo điều kiện cho việc giao tiếp giữa các mạng. Như chúng ta đã nói trước đó, một switch quản lý giao tiếp trong một mạng, trong khi router cho phép chúng ta kết nối các mạng này với nhau hoặc ít nhất là cho phép chúng truy cập lẫn nhau nếu được phép.

@@ -55,7 +55,7 @@ Một router có một địa chỉ IP trong các mạng mà nó được kết

Router cũng tạo ra sự phân cấp trong các mạng mà tôi đã đề cập trước đó.

![Router](/images/1.introduce/005-router.png)
![Router](/Workshop001/images/1.introduce/005-router.png)

### Switch so với Router
**Định tuyến** là quá trình di chuyển dữ liệu giữa các mạng.
16 changes: 8 additions & 8 deletions content/2-OSIModel/_index.md
Original file line number Diff line number Diff line change
@@ -20,21 +20,21 @@ The rules for networking are divided into seven different layers and those layer

#### Introduction to the OSI Model
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.**
![the OSI Model](/images/2.OSIModel/001-theOSIModel.png)
![the OSI Model](/Workshop001/images/2.OSIModel/001-theOSIModel.png)

#### Physical
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.
![Physical Layer](/images/2.OSIModel/002-physical.png)
![Physical Layer](/Workshop001/images/2.OSIModel/002-physical.png)

#### Data Link
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.
![Data Link Layer](/images/2.OSIModel/003-dataLink.png)
![Data Link Layer](/Workshop001/images/2.OSIModel/003-dataLink.png)

#### Network
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.

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.
![Network Layer](/images/2.OSIModel/004-network.png)
![Network Layer](/Workshop001/images/2.OSIModel/004-network.png)

So why do we need addressing schemes on both Layers 2 and 3? (MAC Addresses vs IP Addresses)

@@ -50,7 +50,7 @@ Now there is a network protocol that we will get into but not today called ARP(A

#### Transport
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.
![Transport Layer](/images/2.OSIModel/005-transport.png)
![Transport Layer](/Workshop001/images/2.OSIModel/005-transport.png)

#### Session, Presentation, Application
The distinction between Layers 5,6,7 is or had become somewhat vague.
@@ -70,10 +70,10 @@ This segment is going to be passed down the OSI stack to layer 3, the network la
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.
![OSI Model - Application](/images/2.OSIModel/006-application.png)
![OSI Model - Application](/Workshop001/images/2.OSIModel/006-application.png)

I did mention above the naming for each layer of header plus data but decided to draw this out as well.
![OSI Model - Data](/images/2.OSIModel/007-application.png)
![OSI Model - Data](/Workshop001/images/2.OSIModel/007-application.png)

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.
![OSI Model - Application](/images/2.OSIModel/008-application.png)
![OSI Model - Application](/Workshop001/images/2.OSIModel/008-application.png)
16 changes: 8 additions & 8 deletions content/2-OSIModel/_index.vi.md
Original file line number Diff line number Diff line change
@@ -23,19 +23,19 @@ Các quy tắc cho mạng được chia thành bảy lớp khác nhau và các l
#### Giới Thiệu Về Mô Hình OSI
Mô Hình OSI (Mô Hình Kết Nối Hệ Mở) là một khung công tác được sử dụng để mô tả các chức năng của một hệ thống mạng. Mô hình OSI phân loại các chức năng máy tính thành một tập hợp các quy tắc và yêu cầu chung để hỗ trợ khả năng tương tác giữa các sản phẩm và phần mềm khác nhau. Trong mô hình tham chiếu OSI, các giao tiếp giữa một hệ thống máy tính được chia thành bảy lớp trừu tượng khác nhau: **Vật lý, Liên kết Dữ liệu, Mạng, Vận chuyển, Phiên, Trình bày, và Ứng dụng.**

![Mô Hình OSI](/images/2.OSIModel/001-theOSIModel.png)
![Mô Hình OSI](/Workshop001/images/2.OSIModel/001-theOSIModel.png)

#### Lớp Vật Lý
Lớp 1 trong mô hình OSI được gọi là vật lý, đề cập đến việc truyền dữ liệu từ một máy chủ này sang máy chủ khác thông qua một phương tiện, có thể là cáp vật lý hoặc Wi-Fi. Chúng ta cũng có thể thấy một số phần cứng cũ như hub và repeater để vận chuyển dữ liệu từ một máy chủ này sang máy chủ khác.
![Lớp Vật Lý](/images/2.OSIModel/002-physical.png)
![Lớp Vật Lý](/Workshop001/images/2.OSIModel/002-physical.png)

#### Lớp Liên Kết Dữ Liệu
Lớp 2, lớp liên kết dữ liệu cho phép chuyển giao dữ liệu từ nút này sang nút khác, nơi dữ liệu được đóng gói thành các khung. Cũng có một mức độ sửa lỗi có thể xảy ra tại lớp vật lý. Đây cũng là nơi chúng ta lần đầu tiên thấy địa chỉ MAC.
![Lớp Liên Kết Dữ Liệu](/images/2.OSIModel/003-dataLink.png)
![Lớp Liên Kết Dữ Liệu](/Workshop001/images/2.OSIModel/003-dataLink.png)

#### Lớp Mạng
Có lẽ bạn đã nghe thuật ngữ switch lớp 3 hoặc switch lớp 2. Trong mô hình OSI, Lớp 3, Mạng, có mục tiêu là cung cấp dịch vụ từ đầu đến cuối, đây là nơi chúng ta thấy địa chỉ IP được đề cập.
![Lớp Mạng](/images/2.OSIModel/004-network.png)
![Lớp Mạng](/Workshop001/images/2.OSIModel/004-network.png)

Vậy tại sao chúng ta cần các sơ đồ địa chỉ ở cả Lớp 2 và Lớp 3? (Địa chỉ MAC so với Địa chỉ IP)

@@ -49,7 +49,7 @@ Khi chúng ta nghĩ về việc đưa dữ liệu từ một máy chủ này san

#### Lớp Vận Chuyển
Dịch vụ giao hàng giữa các dịch vụ, Lớp 4 được thiết kế để phân biệt các luồng dữ liệu. Tương tự như cách mà Lớp 3 và Lớp 2 có các sơ đồ địa chỉ của riêng chúng, ở Lớp 4 chúng ta có các cổng.
![Lớp Vận Chuyển](/images/2.OSIModel/005-transport.png)
![Lớp Vận Chuyển](/Workshop001/images/2.OSIModel/005-transport.png)

#### Lớp Phiên, Trình Bày, Ứng Dụng
Sự phân biệt giữa các Lớp 5, 6, 7 đã trở nên khá mơ hồ.
@@ -67,10 +67,10 @@ Lớp 4 sẽ thêm một tiêu đề vào dữ liệu để thực hiện mục
Segment này sẽ được chuyển xuống ngăn xếp OSI đến lớp 3, lớp mạng, và lớp mạng sẽ thêm một tiêu đề khác vào dữ liệu này. Tiêu đề này sẽ thực hiện mục tiêu của lớp 3 là dịch vụ từ đầu đến cuối, nghĩa là trong tiêu đề này bạn sẽ có địa chỉ IP nguồn và địa chỉ IP đích, tiêu đề cộng với dữ liệu cũng có thể được gọi là một gói.

Lớp 3 sẽ lấy gói đó và chuyển nó cho lớp 2, lớp 2 sẽ lại thêm một tiêu đề khác vào dữ liệu đó để hoàn thành mục tiêu của lớp 2 là giao hàng từng bước nhảy, nghĩa là tiêu đề này sẽ bao gồm địa chỉ MAC nguồn và địa chỉ MAC đích. Điều này được gọi là một khung khi bạn có tiêu đề lớp 2 và dữ liệu.
![Mô Hình OSI - Ứng Dụng](/images/2.OSIModel/006-application.png)
![Mô Hình OSI - Ứng Dụng](/Workshop001/images/2.OSIModel/006-application.png)

Tôi đã đề cập ở trên về cái tên cho mỗi lớp của tiêu đề cộng với dữ liệu nhưng đã quyết định vẽ nó ra như sau.
![Mô Hình OSI - Dữ Liệu](/images/2.OSIModel/007-application.png)
![Mô Hình OSI - Dữ Liệu](/Workshop001/images/2.OSIModel/007-application.png)

Dữ liệu đến từ một ứng dụng đang được gửi đi, vì vậy việc nhận dữ liệu sẽ diễn ra ngược lại để đưa nó lên ngăn xếp và vào máy chủ nhận.
![Mô Hình OSI - Ứng Dụng](/images/2.OSIModel/008-application.png)
![Mô Hình OSI - Ứng Dụng](/Workshop001/images/2.OSIModel/008-application.png)
18 changes: 9 additions & 9 deletions content/3-NetworkProtocols/_index.md
Original file line number Diff line number Diff line change
@@ -13,32 +13,32 @@ A set of rules and messages that form a standard. An Internet Standard.
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)

Connects IP addresses to fixed physical machine addresses, also known as MAC addresses across a layer 2 network.
![Network Protocols](/images/3.NetworkProtocols/001-networkProtocols.png)
![Network Protocols](/Workshop001/images/3.NetworkProtocols/001-networkProtocols.png)

- FTP - File Transfer Protocol

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.
![Network Protocols - FTP](/images/3.NetworkProtocols/002-ftp.png)
![Network Protocols - FTP](/Workshop001/images/3.NetworkProtocols/002-ftp.png)

- SMTP - Simple Mail Transfer Protocol

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.
![Network Protocols - SMTP](/images/3.NetworkProtocols/003-smtp.png)
![Network Protocols - SMTP](/Workshop001/images/3.NetworkProtocols/003-smtp.png)

- HTTP - Hyper Text Transfer Protocol

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.
![Network Protocols - HTTP](/images/3.NetworkProtocols/004-http.png)
![Network Protocols - HTTP](/Workshop001/images/3.NetworkProtocols/004-http.png)

- SSL - Secure Sockets Layer | TLS - Transport Layer Security

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.
![Network Protocols - TLS/SSL](/images/3.NetworkProtocols/005-tlsssl.png)
![Network Protocols - TLS/SSL](/Workshop001/images/3.NetworkProtocols/005-tlsssl.png)

- HTTPS - HTTP secured with 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.
![Network Protocols - HTTPS](/images/3.NetworkProtocols/006-https.png)
![Network Protocols - HTTPS](/Workshop001/images/3.NetworkProtocols/006-https.png)

- DNS - Domain Name System

@@ -47,7 +47,7 @@ The DNS is used to map human-friendly domain names for example we all know [goog
This is where DNS comes in, it ensures that hosts, services and other resources are reachable.

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.
![Network Protocols - DNS](/images/3.NetworkProtocols/007-dns.png)
![Network Protocols - DNS](/Workshop001/images/3.NetworkProtocols/007-dns.png)

- DHCP - Dynamic Host Configuration Protocol

@@ -71,7 +71,7 @@ Then we have DNS as we just covered to help us convert complicated public IP add
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.

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.
![Network Protocols - DHCP](/images/3.NetworkProtocols/008-dhcp.png)
![Network Protocols - DHCP](/Workshop001/images/3.NetworkProtocols/008-dhcp.png)

#### Subnetting
A subnet is a logical subdivision of an IP network.
@@ -89,4 +89,4 @@ An organisation is responsible for determining the number and size of the subnet
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.
![Network Protocols - Subnets](/images/3.NetworkProtocols/009-subnets.png)
![Network Protocols - Subnets](/Workshop001/images/3.NetworkProtocols/009-subnets.png)
18 changes: 9 additions & 9 deletions content/3-NetworkProtocols/_index.vi.md
Original file line number Diff line number Diff line change
@@ -13,32 +13,32 @@ Một tập hợp các quy tắc và thông điệp tạo thành một tiêu chu
Nếu bạn muốn tìm hiểu sâu về ARP, bạn có thể đọc Tiêu chuẩn Internet tại đây. [RFC 826](https://datatracker.ietf.org/doc/html/rfc826)

Kết nối địa chỉ IP với các địa chỉ máy cố định, còn được gọi là địa chỉ MAC trên một mạng lớp 2.
![Giao thức Mạng](/images/3.NetworkProtocols/001-networkProtocols.png)
![Giao thức Mạng](/Workshop001/images/3.NetworkProtocols/001-networkProtocols.png)

- FTP - Giao thức Chuyển File

Cho phép chuyển file từ nguồn đến đích. Quá trình này thường được xác thực nhưng có khả năng sử dụng truy cập ẩn danh nếu được cấu hình. Hiện nay, bạn sẽ thấy FTPS nhiều hơn, cung cấp kết nối SSL/TLS đến các máy chủ FTP từ phía khách hàng để tăng cường bảo mật. Giao thức này sẽ được tìm thấy trong lớp Ứng dụng của Mô hình OSI.
![Giao thức Mạng - FTP](/images/3.NetworkProtocols/002-ftp.png)
![Giao thức Mạng - FTP](/Workshop001/images/3.NetworkProtocols/002-ftp.png)

- SMTP - Giao thức Chuyển Giao Thư Đơn

Được sử dụng để truyền tải email, các máy chủ mail sử dụng SMTP để gửi và nhận tin nhắn thư. Ngay cả với Microsoft 365, giao thức SMTP vẫn được sử dụng cho cùng mục đích.
![Giao thức Mạng - SMTP](/images/3.NetworkProtocols/003-smtp.png)
![Giao thức Mạng - SMTP](/Workshop001/images/3.NetworkProtocols/003-smtp.png)

- HTTP - Giao thức Truyền Tải Siêu Văn Bản

HTTP là nền tảng của internet và việc duyệt nội dung. Cho phép chúng ta dễ dàng truy cập vào các trang web yêu thích. HTTP vẫn được sử dụng nhiều nhưng HTTPS hiện nay được sử dụng nhiều hơn hoặc nên được sử dụng trên hầu hết các trang web yêu thích của bạn.
![Giao thức Mạng - HTTP](/images/3.NetworkProtocols/004-http.png)
![Giao thức Mạng - HTTP](/Workshop001/images/3.NetworkProtocols/004-http.png)

- SSL - Lớp Sockets Bảo mật | TLS - Bảo mật Giao vận

TLS đã thay thế SSL, TLS là một **Giao thức Mã hóa** cung cấp các giao tiếp an toàn qua một mạng. Nó có thể và sẽ được tìm thấy trong mail, nhắn tin nhanh và các ứng dụng khác, nhưng phổ biến nhất là được sử dụng để bảo mật HTTPS.
![Giao thức Mạng - TLS/SSL](/images/3.NetworkProtocols/005-tlsssl.png)
![Giao thức Mạng - TLS/SSL](/Workshop001/images/3.NetworkProtocols/005-tlsssl.png)

- HTTPS - HTTP được bảo mật bằng SSL/TLS

Là một phần mở rộng của HTTP, được sử dụng cho các giao tiếp an toàn qua một mạng, HTTPS được mã hóa bằng TLS như đã đề cập ở trên. Mục tiêu ở đây là cung cấp xác thực, quyền riêng tư và toàn vẹn trong khi dữ liệu được trao đổi giữa các máy chủ.
![Giao thức Mạng - HTTPS](/images/3.NetworkProtocols/006-https.png)
![Giao thức Mạng - HTTPS](/Workshop001/images/3.NetworkProtocols/006-https.png)

- DNS - Hệ thống Tên Miền

@@ -47,7 +47,7 @@ DNS được sử dụng để ánh xạ các tên miền thân thiện với co
Đây là nơi DNS xuất hiện, đảm bảo rằng các máy chủ, dịch vụ và tài nguyên khác đều có thể tiếp cận được.

Trên tất cả các máy chủ, nếu họ cần kết nối internet thì họ phải có DNS để có thể phân giải các tên miền. DNS là một lĩnh vực mà bạn có thể dành cả Ngày và Năm để học hỏi. Tôi cũng sẽ nói từ kinh nghiệm rằng DNS thường là nguyên nhân chính của tất cả các lỗi khi nói đến Mạng. Không biết liệu một kỹ sư mạng có đồng ý với điều đó không.
![Giao thức Mạng - DNS](/images/3.NetworkProtocols/007-dns.png)
![Giao thức Mạng - DNS](/Workshop001/images/3.NetworkProtocols/007-dns.png)

- DHCP - Giao thức Cấp phát Địa chỉ Động

@@ -71,7 +71,7 @@ Sau đó, chúng ta có DNS như đã đề cập để giúp chúng ta chuyển
Như tôi đã nói, mỗi máy chủ cần 4 thứ này, nếu bạn có 1000 hoặc 10.000 máy chủ thì điều đó sẽ mất rất nhiều thời gian để xác định từng cái một. Đây là nơi DHCP xuất hiện và cho phép bạn xác định một phạm vi cho mạng của bạn và sau đó giao thức này sẽ phân phối cho tất cả các máy chủ có sẵn trong mạng của bạn.

Một ví dụ khác là bạn vào một quán cà phê, lấy một tách cà phê và ngồi xuống với máy tính xách tay hoặc điện thoại của bạn, hãy gọi đó là máy chủ của bạn. Bạn kết nối máy chủ của mình với WiFi quán cà phê và bạn có quyền truy cập vào internet, tin nhắn và thư bắt đầu ping qua và bạn có thể duyệt các trang web và mạng xã hội. Khi bạn kết nối với WiFi quán cà phê, máy của bạn sẽ nhận được một địa chỉ DHCP từ một máy chủ DHCP chuyên dụng hoặc có thể là từ bộ định tuyến cũng xử lý DHCP.
![Giao thức Mạng - DHCP](/images/3.NetworkProtocols/008-dhcp.png)
![Giao thức Mạng - DHCP](/Workshop001/images/3.NetworkProtocols/008-dhcp.png)

#### Phân đoạn Mạng
Một subnet là một phân vùng logic của một mạng IP.
@@ -89,4 +89,4 @@ Một tổ chức có trách nhiệm xác định số lượng và kích thư
Giữa các lợi ích khác, việc phân đoạn các mạng lớn thành các subnet cho phép tái phân bổ địa chỉ IP và giảm tắc nghẽn mạng, tối ưu hóa giao tiếp và hiệu suất mạng.

Các subnet cũng có thể cải thiện bảo mật mạng. Nếu một phần của mạng bị xâm nhập, nó có thể được cách ly, làm cho kẻ xấu khó khăn trong việc di chuyển xung quanh mạng lớn hơn.
![Giao thức Mạng - Subnets](/images/3.NetworkProtocols/009-subnets.png)
![Giao thức Mạng - Subnets](/Workshop001/images/3.NetworkProtocols/009-subnets.png)
24 changes: 12 additions & 12 deletions content/5-PythonForNetworkAutomation/_index.md
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ We are going to do everything on EVE-NG with the community edition.
The community edition comes in ISO and OVF formats for [download](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.
![Download Eve](/images/5.PythonForNetworkAutomation/001-downloadEve.png)
![Download Eve](/Workshop001/images/5.PythonForNetworkAutomation/001-downloadEve.png)

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!

@@ -69,21 +69,21 @@ Now we have our hypervisor software downloaded and installed, and we have the EV
We are now ready to get things configured.

Open VMware Workstation and then select `file` and `open`
![VMware Setup](/images/5.PythonForNetworkAutomation/002-vMware.png)
![VMware Setup](/Workshop001/images/5.PythonForNetworkAutomation/002-vMware.png)

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.
![VMware Setup](/images/5.PythonForNetworkAutomation/003-vMware.png)
![VMware Setup](/Workshop001/images/5.PythonForNetworkAutomation/003-vMware.png)

Navigate to the location where you downloaded the EVE-NG OVF image and begin the import.

Give it a recognisable name and store the virtual machine somewhere on your system.
![VMware Setup](/images/5.PythonForNetworkAutomation/004-vMware.png)
![VMware Setup](/Workshop001/images/5.PythonForNetworkAutomation/004-vMware.png)

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)

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.

![VMware Setup](/images/5.PythonForNetworkAutomation/005-vMware.png)
![VMware Setup](/Workshop001/images/5.PythonForNetworkAutomation/005-vMware.png)

### Power on & Access
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!
@@ -101,7 +101,7 @@ When you want to go back and use WSL2 then you will need to run this command and
Both of these commands should be run as administrator!

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.
![Eve-NG - Setup](/images/5.PythonForNetworkAutomation/006-eVE-ng.png)
![Eve-NG - Setup](/Workshop001/images/5.PythonForNetworkAutomation/006-eVE-ng.png)

On the prompt above you can use:

@@ -110,23 +110,23 @@ 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.

We then can change the hostname.
![Eve-NG - Setup](/images/5.PythonForNetworkAutomation/007-eVE-ng.png)
![Eve-NG - Setup](/Workshop001/images/5.PythonForNetworkAutomation/007-eVE-ng.png)

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.
![Eve-NG - Setup](/images/5.PythonForNetworkAutomation/008-eVE-ng.png)
![Eve-NG - Setup](/Workshop001/images/5.PythonForNetworkAutomation/008-eVE-ng.png)

We then configure networking, I am selecting static so that the IP address given will be persistent after reboots.
![Eve-NG - Setup](/images/5.PythonForNetworkAutomation/009-eVE-ng.png)
![Eve-NG - Setup](/Workshop001/images/5.PythonForNetworkAutomation/009-eVE-ng.png)

The final step, provide a static IP address from a network that is reachable from your workstation.
![Eve-NG - Setup](/images/5.PythonForNetworkAutomation/010-eVE-ng.png)
![Eve-NG - Setup](/Workshop001/images/5.PythonForNetworkAutomation/010-eVE-ng.png)

There are some additional steps here where you will have to provide a subnet mask for your network, default gateway and DNS.

Once finished it will reboot, when it is back up you can take your static IP address and put this into your browser.
![EVE Login Console](/images/5.PythonForNetworkAutomation/011-eVE-ng.png)
![EVE Login Console](/Workshop001/images/5.PythonForNetworkAutomation/011-eVE-ng.png)

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.
![EVE Login Console](/images/5.PythonForNetworkAutomation/012-eVE-ng.png)
![EVE Login Console](/Workshop001/images/5.PythonForNetworkAutomation/012-eVE-ng.png)

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.
24 changes: 12 additions & 12 deletions content/5-PythonForNetworkAutomation/_index.vi.md
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ Chúng ta sẽ làm mọi thứ trên EVE-NG với phiên bản cộng đồng.
Phiên bản cộng đồng có sẵn dưới dạng ISO và OVF để [tải xuống](https://www.eve-ng.net/index.php/download/)

Chúng ta sẽ sử dụng bản tải xuống OVF nhưng với ISO, có tùy chọn xây dựng trên máy chủ bare metal mà không cần hypervisor.
![Tải xuống Eve](/images/5.PythonForNetworkAutomation/001-downloadEve.png)
![Tải xuống Eve](/Workshop001/images/5.PythonForNetworkAutomation/001-downloadEve.png)

Đối với hướng dẫn của chúng ta, chúng ta sẽ sử dụng VMware Workstation vì tôi có giấy phép thông qua vExpert của mình nhưng bạn cũng có thể sử dụng VMware Player hoặc bất kỳ tùy chọn nào khác được đề cập trong [tài liệu](https://www.eve-ng.net/index.php/documentation/installation/system-requirement/). Rất tiếc, chúng ta không thể sử dụng Virtual box mà chúng ta đã sử dụng trước đó!

@@ -69,21 +69,21 @@ Bây giờ chúng ta đã tải xuống và cài đặt phần mềm hypervisor
Bây giờ chúng ta đã sẵn sàng để cấu hình mọi thứ.

Mở VMware Workstation và sau đó chọn `file``open`
![Thiết lập VMware](/images/5.PythonForNetworkAutomation/002-vMware.png)
![Thiết lập VMware](/Workshop001/images/5.PythonForNetworkAutomation/002-vMware.png)

Khi bạn tải xuống EVE-NG OVF Image, nó sẽ nằm trong một file nén. Giải nén nội dung ra thành một thư mục riêng để nó trông giống như thế này.
![Thiết lập VMware](/images/5.PythonForNetworkAutomation/003-vMware.png)
![Thiết lập VMware](/Workshop001/images/5.PythonForNetworkAutomation/003-vMware.png)

Điều hướng đến vị trí nơi bạn đã tải xuống EVE-NG OVF image và bắt đầu nhập.

Đặt cho nó một tên dễ nhận biết và lưu trữ máy ảo ở đâu đó trên hệ thống của bạn.
![Thiết lập VMware](/images/5.PythonForNetworkAutomation/004-vMware.png)
![Thiết lập VMware](/Workshop001/images/5.PythonForNetworkAutomation/004-vMware.png)

Khi quá trình nhập hoàn tất, hãy tăng số lượng bộ xử lý lên 4 và bộ nhớ được phân bổ lên 8 GB. (Điều này sẽ được thực hiện sau khi nhập với phiên bản mới nhất, nếu không thì hãy chỉnh sửa cài đặt VM)

Ngoài ra, hãy đảm bảo rằng hộp kiểm Virtualise Intel VT-x/EPT hoặc AMD-V/RVI được bật. Tùy chọn này hướng dẫn VMware workstation chuyển các cờ ảo hóa sang hệ điều hành khách (ảo hóa lồng nhau) Đây là vấn đề tôi đang gặp phải với GNS3 với Virtual Box mặc dù CPU của tôi cho phép điều này.

![Thiết lập VMware](/images/5.PythonForNetworkAutomation/005-vMware.png)
![Thiết lập VMware](/Workshop001/images/5.PythonForNetworkAutomation/005-vMware.png)

### Bật nguồn & Truy cập
Lưu ý & Đường vòng: Nhớ rằng tôi đã đề cập rằng điều này sẽ không hoạt động với VirtualBox! Vâng, tôi đã gặp vấn đề tương tự với VMware Workstation và EVE-NG nhưng không phải do lỗi của nền tảng ảo hóa!
@@ -101,7 +101,7 @@ Khi bạn muốn quay lại và sử dụng WSL2, bạn sẽ cần chạy lệnh
Cả hai lệnh này đều phải được chạy với quyền quản trị!

Ok quay lại chương trình, Bây giờ bạn nên có một máy đã được bật trong VMware Workstation và bạn nên có một lời nhắc trông giống như thế này.
![Eve-NG - Thiết lập](/images/5.PythonForNetworkAutomation/006-eVE-ng.png)
![Eve-NG - Thiết lập](/Workshop001/images/5.PythonForNetworkAutomation/006-eVE-ng.png)

Trên lời nhắc trên bạn có thể sử dụng:

@@ -110,23 +110,23 @@ tên người dùng = root mật khẩu = eve
Sau đó bạn sẽ được yêu cầu cung cấp lại mật khẩu root, điều này sẽ được sử dụng để SSH vào máy chủ sau này.

Sau đó chúng ta có thể thay đổi tên máy chủ.
![Eve-NG - Thiết lập](/images/5.PythonForNetworkAutomation/007-eVE-ng.png)
![Eve-NG - Thiết lập](/Workshop001/images/5.PythonForNetworkAutomation/007-eVE-ng.png)

Tiếp theo, chúng ta xác định Tên miền DNS, tôi đã sử dụng tên dưới đây nhưng tôi không chắc liệu điều này có cần thay đổi sau này hay không.
![Eve-NG - Thiết lập](/images/5.PythonForNetworkAutomation/008-eVE-ng.png)
![Eve-NG - Thiết lập](/Workshop001/images/5.PythonForNetworkAutomation/008-eVE-ng.png)

Sau đó chúng ta cấu hình mạng, tôi chọn static để địa chỉ IP được cấp sẽ được giữ nguyên sau khi khởi động lại.
![Eve-NG - Thiết lập](/images/5.PythonForNetworkAutomation/009-eVE-ng.png)
![Eve-NG - Thiết lập](/Workshop001/images/5.PythonForNetworkAutomation/009-eVE-ng.png)

Bước cuối cùng, cung cấp địa chỉ IP tĩnh từ mạng có thể truy cập được từ máy trạm của bạn.
![Eve-NG - Thiết lập](/images/5.PythonForNetworkAutomation/010-eVE-ng.png)
![Eve-NG - Thiết lập](/Workshop001/images/5.PythonForNetworkAutomation/010-eVE-ng.png)

Có một số bước bổ sung ở đây nơi bạn sẽ phải cung cấp mặt nạ mạng con cho mạng của mình, cổng mặc định và DNS.

Khi hoàn tất, nó sẽ khởi động lại, khi nó hoạt động trở lại, bạn có thể lấy địa chỉ IP tĩnh của mình và đặt nó vào trình duyệt của bạn.
![Bảng điều khiển đăng nhập EVE](/images/5.PythonForNetworkAutomation/011-eVE-ng.png)
![Bảng điều khiển đăng nhập EVE](/Workshop001/images/5.PythonForNetworkAutomation/011-eVE-ng.png)

Tên người dùng mặc định cho GUI là `admin` và mật khẩu là `eve` trong khi tên người dùng mặc định cho SSH là `root` và mật khẩu là `eve` nhưng điều này đã được thay đổi nếu bạn đã thay đổi trong quá trình thiết lập.
![Bảng điều khiển đăng nhập EVE](/images/5.PythonForNetworkAutomation/012-eVE-ng.png)
![Bảng điều khiển đăng nhập EVE](/Workshop001/images/5.PythonForNetworkAutomation/012-eVE-ng.png)

Tôi đã chọn HTML5 cho bảng điều khiển thay vì native vì điều này sẽ mở một tab mới trong trình duyệt của bạn khi bạn đang điều hướng qua các bảng điều khiển khác nhau.
18 changes: 9 additions & 9 deletions content/6-BuildingOurLab/_index.md
Original file line number Diff line number Diff line change
@@ -7,13 +7,13 @@ pre = "<b>6. </b>"
+++

### Building our Lab
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 [Python for Network Automation](5-Portfwd/) we covered the installation of EVE-NG onto our machine using VMware Workstation.
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 [Python for Network Automation](5-PythonForNetworkAutomation/) we covered the installation of EVE-NG onto our machine using VMware Workstation.

#### Installing EVE-NG Client
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).

[EVE-NG Client Download](https://www.eve-ng.net/index.php/download/)
![EVE-NG Client Download](/images/6.BuildingLab/001-eVE-NGClientDownload.png)
![EVE-NG Client Download](/Workshop001/images/6.BuildingLab/001-eVE-NGClientDownload.png)

Quick Tip: If you are using Linux as your client then there is this [client pack](https://github.com/SmartFinn/eve-ng-integration).

@@ -47,34 +47,34 @@ Inside the EVE-NG web interface, we are going to create our new network topology

#### Adding our Nodes to 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.
![Building our Lab](/images/6.BuildingLab/002-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/002-lab.png)

Give your lab a name and the other fields are optional.
![Building our Lab](/images/6.BuildingLab/003-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/003-lab.png)

You will be then greeted with a blank canvas to start creating your network. Right-click on your canvas and choose add node.

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.
![Building our Lab](/images/6.BuildingLab/004-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/004-lab.png)

We want to add the following to our lab:

- 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.
![Building our Lab](/images/6.BuildingLab/005-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/005-lab.png)

#### Connecting our nodes
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.
![Building our Lab](/images/6.BuildingLab/006-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/006-lab.png)

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.

I went ahead and made my lab look like the below.
![Building our Lab](/images/6.BuildingLab/007-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/007-lab.png)

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.
![Building our Lab](/images/6.BuildingLab/008-lab.png)
![Building our Lab](/Workshop001/images/6.BuildingLab/008-lab.png)

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.

16 changes: 8 additions & 8 deletions content/6-BuildingOurLab/_index.vi.md
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ Chúng ta sẽ tiếp tục thiết lập mạng mô phỏng của mình bằng
Cũng có một gói khách cho phép chúng ta lựa chọn ứng dụng nào sẽ được sử dụng khi SSH vào các thiết bị. Nó cũng sẽ thiết lập Wireshark để bắt gói giữa các liên kết. Bạn có thể tải gói khách cho hệ điều hành của mình (Windows, macOS, Linux).

[Tải EVE-NG Client](https://www.eve-ng.net/index.php/download/)
![Tải EVE-NG Client](/images/6.BuildingLab/001-eVE-NGClientDownload.png)
![Tải EVE-NG Client](/Workshop001/images/6.BuildingLab/001-eVE-NGClientDownload.png)

Mẹo Nhanh: Nếu bạn đang sử dụng Linux làm máy khách, thì có gói [khách này](https://github.com/SmartFinn/eve-ng-integration).

@@ -47,35 +47,35 @@ Trong giao diện web EVE-NG, chúng ta sẽ tạo ra một topo mạng mới. C

#### Thêm Các Node vào EVE-NG
Khi bạn lần đầu đăng nhập vào EVE-NG, bạn sẽ thấy một màn hình như bên dưới, chúng ta muốn bắt đầu bằng cách tạo phòng thí nghiệm đầu tiên.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/002-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/002-lab.png)

Đặt tên cho phòng thí nghiệm của bạn và các trường khác là tùy chọn.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/003-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/003-lab.png)

Bạn sẽ thấy một bức tranh trống để bắt đầu tạo mạng của mình. Nhấp chuột phải vào canvas của bạn và chọn thêm node.

Từ đây, bạn sẽ có một danh sách dài các tùy chọn node. Nếu bạn đã theo dõi các bước trên, bạn sẽ thấy hai node màu xanh như hình dưới và các node khác sẽ màu xám và không thể chọn.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/004-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/004-lab.png)

Chúng ta muốn thêm các node sau vào phòng thí nghiệm:

- 1 x Cisco vIOS Router
- 4 x Cisco vIOS Switch

Chạy qua wizard đơn giản để thêm chúng vào phòng thí nghiệm và nó sẽ trông giống như hình bên dưới.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/005-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/005-lab.png)

#### Kết Nối Các Node
Chúng ta cần thêm kết nối giữa các router và switch. Chúng ta có thể làm điều này khá dễ dàng bằng cách di chuột qua thiết bị và nhìn thấy biểu tượng kết nối như dưới đây và sau đó kết nối nó với thiết bị mà chúng ta muốn kết nối.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/006-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/006-lab.png)

Khi bạn đã hoàn thành việc kết nối môi trường của mình, bạn cũng có thể muốn thêm một cách nào đó để định nghĩa các ranh giới hoặc vị trí vật lý bằng cách sử dụng hộp hoặc vòng tròn, có thể tìm thấy trong menu nhấp chuột phải. Bạn cũng có thể thêm văn bản, điều này rất hữu ích khi chúng ta muốn định nghĩa tên hoặc địa chỉ IP trong các phòng thí nghiệm của mình.

Tôi đã làm cho phòng thí nghiệm của mình trông như hình bên dưới.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/007-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/007-lab.png)

Bạn cũng sẽ nhận thấy rằng phòng thí nghiệm trên đều tắt nguồn, chúng ta có thể khởi động phòng thí nghiệm của mình bằng cách chọn tất cả và nhấp chuột phải chọn khởi động đã chọn.
![Xây Dựng Phòng Thí Nghiệm](/images/6.BuildingLab/008-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/6.BuildingLab/008-lab.png)

Khi chúng ta đã có phòng thí nghiệm lên và chạy, bạn sẽ có thể console vào từng thiết bị và bạn sẽ nhận thấy rằng vào giai đoạn này chúng đều khá "đần độn" với không có cấu hình. Chúng ta có thể thêm một số cấu hình cho mỗi node bằng cách sao chép hoặc tự tạo trong mỗi terminal.

20 changes: 10 additions & 10 deletions content/7-hands-On/_index.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@ We will be using an SSH tunnel to connect to our devices from our client vs teln

### Access our virtual emulated environment
For us to interact with our switches we either need a workstation inside the EVE-NG network or you can deploy a Linux box there with Python installed to perform your automation ([Resource for setting up Linux inside EVE-NG](https://www.youtube.com/watch?v=3Qstk3zngrY)) or you can do something like me and define a cloud for access from your workstation.
![Building our Lab](/images/7.hands-On/001-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/001-lab.png)

To do this, we have right-clicked on our canvas and we have selected network and then selected "Management(Cloud0)" this will bridge out to our home network.
![Building our Lab](/images/7.hands-On/002-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/002-lab.png)

However, we do not have anything inside this network so we need to add connections from the new network to each of our devices. (My networking knowledge needs more attention and I feel that you could just do this next step to the top router and then have connectivity to the rest of the network through this one cable?)

@@ -46,42 +46,42 @@ The final step gives us the DHCP address from our home network. My device networ
With the above in place, we can now connect to our devices on our home network using our workstation. I am using Putty but also have access to other terminals such as git bash that give me the ability to SSH to our devices.

Below you can see we have an SSH connection to our router device. (R1)
![Building our Lab](/images/7.hands-On/003-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/003-lab.png)

#### Using Python to gather information from our devices
The first example of how we can leverage Python is to gather information from all of our devices and in particular, I want to be able to connect to each one and run a simple command to provide me with interface configuration and settings. I have stored this script here [netmiko_con_multi.py](/Scripts/netmiko_con_multi.py)

Now when I run this I can see each port configuration over all of my devices.
![Building our Lab](/images/7.hands-On/004-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/004-lab.png)

This could be handy if you have a lot of different devices, create this one script so that you can centrally control and understand quickly all of the configurations in one place.

#### Using Python to configure our devices
The above is useful but what about using Python to configure our devices, in our scenario we have a trunked port between `SW1` and `SW2` again imagine if this was to be done across many of the same switches we want to automate that and not have to manually connect to each switch to make the configuration change.

We can use [netmiko_sendchange.py](/Scripts/netmiko_sendchange.py) to achieve this. This will connect over SSH and perform that change on our `SW1` which will also change to `SW2`.
![Building our Lab](/images/7.hands-On/005-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/005-lab.png)

Now for those that look at the code, you will see the message appears and tells us sending configuration to device but there is no confirmation that this has happened we could add additional code to our script to perform that check and validation on our switch or we could modify our script before to show us this. [netmiko_con_multi_vlan.py](/Scripts/netmiko_con_multi_vlan.py)
![Building our Lab](/images/7.hands-On/006-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/006-lab.png)

#### Backing up your device configurations
Another use case would be to capture our network configurations and make sure we have those backed up, but again we don't want to be connecting to every device we have on our network so we can also automate this using [backup.py](/Scripts/backup.py). You will also need to populate the [backup.txt](/Scripts/backup.txt) with the IP addresses you want to backup.

Run your script and you should see something like the below.
![Building our Lab](/images/7.hands-On/007-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/007-lab.png)

That could be me just writing a simple print script in python so I should show you the backup files as well.
![Building our Lab](/images/7.hands-On/008-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/008-lab.png)

#### Paramiko
A widely used Python module for SSH. You can find out more at the official GitHub link [here](https://github.com/paramiko/paramiko)

We can install this module using the `pip install paramiko` command.
![Building our Lab](/images/7.hands-On/009-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/009-lab.png)

We can verify the installation by entering the Python shell and importing the paramiko module.
![Building our Lab](/images/7.hands-On/010-lab.png)
![Building our Lab](/Workshop001/images/7.hands-On/010-lab.png)

#### Netmiko
The netmiko module targets network devices specifically whereas paramiko is a broader tool for handling SSH connections overall.
20 changes: 10 additions & 10 deletions content/7-hands-On/_index.vi.md
Original file line number Diff line number Diff line change
@@ -13,10 +13,10 @@ Chúng ta sẽ sử dụng một đường hầm SSH để kết nối với cá

### Truy cập môi trường giả lập ảo của chúng ta
Để tương tác với các switch, chúng ta cần một máy trạm bên trong mạng EVE-NG hoặc bạn có thể triển khai một máy Linux ở đó với Python đã được cài đặt để thực hiện tự động hóa ([Tài nguyên để thiết lập Linux trong EVE-NG](https://www.youtube.com/watch?v=3Qstk3zngrY)) hoặc bạn có thể làm như tôi và định nghĩa một cloud để truy cập từ máy trạm của mình.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/001-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/001-lab.png)

Để thực hiện điều này, chúng ta đã nhấp chuột phải vào canvas và chọn mạng, sau đó chọn "Management(Cloud0)" để kết nối với mạng gia đình của chúng ta.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/002-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/002-lab.png)

Tuy nhiên, chúng ta chưa có gì trong mạng này, vì vậy chúng ta cần thêm kết nối từ mạng mới đến từng thiết bị. (Kiến thức mạng của tôi cần được cải thiện và tôi cảm thấy rằng bạn có thể chỉ cần thực hiện bước tiếp theo này đến router chính và sau đó có kết nối đến phần còn lại của mạng thông qua một cáp này?)

@@ -46,42 +46,42 @@ Bước cuối cùng cho chúng ta địa chỉ DHCP từ mạng gia đình. Dan
Với thiết lập trên, chúng ta có thể kết nối đến các thiết bị trên mạng gia đình bằng máy trạm của mình. Tôi đang sử dụng Putty nhưng cũng có thể sử dụng các terminal khác như git bash để SSH đến các thiết bị.

Dưới đây bạn có thể thấy chúng ta có một kết nối SSH tới thiết bị router (R1).
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/003-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/003-lab.png)

#### Sử dụng Python để thu thập thông tin từ các thiết bị
Ví dụ đầu tiên về cách chúng ta có thể tận dụng Python là để thu thập thông tin từ tất cả các thiết bị của mình. Tôi đã lưu kịch bản này tại [netmiko_con_multi.py](/Scripts/netmiko_con_multi.py).

Khi tôi chạy kịch bản này, tôi có thể thấy cấu hình từng cổng trên tất cả các thiết bị của mình.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/004-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/004-lab.png)

Điều này có thể hữu ích nếu bạn có nhiều thiết bị khác nhau, tạo ra kịch bản này để bạn có thể kiểm soát trung tâm và hiểu nhanh tất cả các cấu hình ở một nơi.

#### Sử dụng Python để cấu hình các thiết bị
Điều này hữu ích nhưng còn gì về việc sử dụng Python để cấu hình các thiết bị của chúng ta? Trong kịch bản của chúng ta, chúng ta có một cổng trunked giữa `SW1``SW2`. Hãy tưởng tượng nếu điều này được thực hiện trên nhiều switch giống nhau, chúng ta muốn tự động hóa điều đó và không phải kết nối thủ công đến từng switch để thực hiện thay đổi cấu hình.

Chúng ta có thể sử dụng [netmiko_sendchange.py](/Scripts/netmiko_sendchange.py) để đạt được điều này. Kịch bản này sẽ kết nối qua SSH và thực hiện thay đổi trên `SW1`, điều này cũng sẽ thay đổi trên `SW2`.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/005-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/005-lab.png)

Với những ai xem mã, bạn sẽ thấy thông điệp xuất hiện và cho chúng ta biết đang gửi cấu hình đến thiết bị nhưng không có xác nhận rằng điều này đã xảy ra. Chúng ta có thể thêm mã bổ sung vào kịch bản của mình để thực hiện kiểm tra và xác nhận trên switch của chúng ta hoặc có thể chỉnh sửa kịch bản trước đó để cho thấy điều này. [netmiko_con_multi_vlan.py](/Scripts/netmiko_con_multi_vlan.py)
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/006-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/006-lab.png)

#### Sao lưu cấu hình thiết bị của bạn
Một trường hợp sử dụng khác là để ghi lại các cấu hình mạng của chúng ta và đảm bảo rằng chúng ta đã sao lưu những cấu hình đó. Nhưng một lần nữa, chúng ta không muốn kết nối đến từng thiết bị mà chúng ta có trên mạng, vì vậy chúng ta cũng có thể tự động hóa điều này bằng cách sử dụng [backup.py](/Scripts/backup.py). Bạn cũng sẽ cần điền vào [backup.txt](/Scripts/backup.txt) với các địa chỉ IP mà bạn muốn sao lưu.

Chạy kịch bản của bạn và bạn sẽ thấy một cái gì đó như dưới đây.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/007-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/007-lab.png)

Đó có thể chỉ là một kịch bản print đơn giản trong Python, vì vậy tôi cũng nên cho bạn thấy các tệp sao lưu.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/008-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/008-lab.png)

#### Paramiko
Một mô-đun Python được sử dụng rộng rãi cho SSH. Bạn có thể tìm hiểu thêm tại liên kết GitHub chính thức [tại đây](https://github.com/paramiko/paramiko).

Chúng ta có thể cài đặt mô-đun này bằng lệnh `pip install paramiko`.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/009-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/009-lab.png)

Chúng ta có thể xác nhận cài đặt bằng cách nhập shell Python và nhập mô-đun paramiko.
![Xây Dựng Phòng Thí Nghiệm](/images/7.hands-On/010-lab.png)
![Xây Dựng Phòng Thí Nghiệm](/Workshop001/images/7.hands-On/010-lab.png)

#### Netmiko
Mô-đun netmiko nhắm đến các thiết bị mạng cụ thể trong khi paramiko là một công cụ rộng hơn để xử lý các kết nối SSH tổng thể.
1 change: 0 additions & 1 deletion public
Submodule public deleted from 22f263

0 comments on commit e78bbec

Please sign in to comment.