Update docs/tech_docs/linux/KVM-virtualization-setup.md

This commit is contained in:
2024-04-16 15:13:57 +00:00
parent ebad9b16cc
commit 8af2b5ae04

View File

@@ -1,3 +1,79 @@
Sure, here's a condensed version with two sections: a step-by-step guide and a list of helpful commands.
**Step-by-Step Guide**
1. **Create the first bridge network (br-my-lan0) for Kubernetes DEV**
```
sudo ip link add name br-my-lan0 type bridge
sudo ip addr add 10.154.2.1/24 dev br-my-lan0
sudo ip link set dev br-my-lan0 up
```
2. **Create the second bridge network (br-my-lan1) for Docker DEV**
```
sudo ip link add name br-my-lan1 type bridge
sudo ip addr add 172.50.50.1/24 dev br-my-lan1
sudo ip link set dev br-my-lan1 up
```
3. **Persist the connections**
```
sudo vi /etc/sysconfig/network-scripts/ifcfg-br-my-lan0
```
Add the following:
```
DEVICE=br-my-lan0
TYPE=Bridge
BOOTPROTO=static
IPADDR=10.154.2.1
NETMASK=255.255.255.0
ONBOOT=yes
```
```
sudo vi /etc/sysconfig/network-scripts/ifcfg-br-my-lan1
```
Add the following:
```
DEVICE=br-my-lan1
TYPE=Bridge
BOOTPROTO=static
IPADDR=172.50.50.1
NETMASK=255.255.255.0
ONBOOT=yes
```
4. **Restart NetworkManager**
```
sudo systemctl restart NetworkManager
```
**Helpful Commands**
**Network Verification Commands**
- `ip a` - Show IP addresses and network interfaces
- `ping <IP_address>` - Test connectivity to a specific IP address
- `traceroute <IP_address>` - Trace the route to a specific IP address
- `mtr <IP_address>` - Combine traceroute and ping functionalities
**Common Network Commands**
- `ifconfig` - View and configure network interfaces
- `netstat` - Display network connections, routing tables, and more
- `route` - Manage routing tables
- `iptables` - Configure firewall rules
- `nmap` - Network exploration and security auditing
**Advanced Network Commands**
- `tcpdump` - Network packet capture and analysis
- `wireshark` - Graphical network protocol analyzer
- `ncat` - Versatile network debugging and data transfer tool
- `iperf` - Network performance measurement tool
- `lsof` - List open files, including network connections
These commands can help you verify network configurations, troubleshoot issues, and perform advanced network analysis and debugging tasks.
---
### 1. Folder Structure Best Practices
For a well-organized virtualization environment, consider the following directory structure: