Files
it-knowledge/src/solutions/networking.md
T

159 lines
4.6 KiB
Markdown
Raw Normal View History

2025-03-02 09:26:39 -06:00
# Network Solutions [🌐]
2025-02-23 12:01:29 -06:00
This section documents my solutions to networking scenarios, including network configuration, troubleshooting, and security.
2025-03-02 09:26:39 -06:00
## Scenario Tags
| Tag | Description |
|-----|-------------|
| [v1-S7] | Network Configuration - Practice Scenarios v1 |
| [v2-S7] | Network and Storage Troubleshooting - Practice Scenarios v2 |
| [v3-S7] | Network Services Configuration - Practice Scenarios v3 |
## Scenario: [v1-S7] Network Interface Configuration
2025-02-23 12:01:29 -06:00
### Original Problem
2025-03-02 09:26:39 -06:00
From Practice Scenarios v1, Scenario 7:
1. Configure static IPv4 address: 192.168.1.100/24
2. Configure static IPv6 address: 2001:db8:1234:5678::100/64
3. Set hostname to 'rhcsa.example.com'
4. Configure DNS resolution using /etc/resolv.conf
5. Implement network access restrictions using firewalld zones
2025-02-23 12:01:29 -06:00
### Environment
- OS Version: RHEL/Rocky Linux 8.x
- Initial State: DHCP-configured network interface
- Required Outcome: Properly configured static network settings with hostname and firewall zones
2025-02-23 12:01:29 -06:00
### Solution Steps
1. Check Current Network Configuration
```bash
# Check network interfaces
ip addr show
# Check routing
ip route show
```
The first step is to identify the current network configuration to understand what needs to be changed.
2025-02-23 12:01:29 -06:00
2. Configure Static IPv4 and IPv6 Addresses
2025-02-23 12:01:29 -06:00
```bash
# Configure static IPv4 address
sudo nmcli connection modify eth0 ipv4.addresses 192.168.1.100/24 ipv4.method manual
# Configure static IPv6 address
sudo nmcli connection modify eth0 ipv6.addresses 2001:db8:1234:5678::100/64 ipv6.method manual
# Set default gateways
sudo nmcli connection modify eth0 ipv4.gateway 192.168.1.1
sudo nmcli connection modify eth0 ipv6.gateway 2001:db8:1234:5678::1
2025-02-23 12:01:29 -06:00
```
This configures the static IP addresses on the network interface.
2025-02-23 12:01:29 -06:00
3. Set Hostname
2025-02-23 12:01:29 -06:00
```bash
# Set hostname
sudo hostnamectl set-hostname rhcsa.example.com
# Update /etc/hosts
sudo echo "127.0.0.1 rhcsa.example.com rhcsa" >> /etc/hosts
```
This sets the system hostname and updates the hosts file.
4. Configure DNS Resolution
```bash
# Configure DNS servers
sudo nmcli connection modify eth0 ipv4.dns "8.8.8.8 8.8.4.4"
2025-02-23 12:01:29 -06:00
# Apply changes
sudo nmcli connection up eth0
2025-02-23 12:01:29 -06:00
```
This configures the DNS servers and applies all the network configuration changes.
5. Configure Firewall Zones
```bash
# Create a new zone for restricted access
sudo firewall-cmd --permanent --new-zone=restricted
# Add services to the zone
sudo firewall-cmd --permanent --zone=restricted --add-service=ssh
sudo firewall-cmd --permanent --zone=restricted --add-service=http
# Add source network to the zone
sudo firewall-cmd --permanent --zone=restricted --add-source=192.168.1.0/24
# Reload firewall
sudo firewall-cmd --reload
```
This sets up a new firewall zone that restricts access to only SSH and HTTP from the local network.
2025-02-23 12:01:29 -06:00
### Verification
```bash
# Verify IP configuration
ip addr show
# Verify hostname
hostname
# Verify DNS resolution
dig google.com
# Verify firewall zones
sudo firewall-cmd --list-all-zones
2025-02-23 12:01:29 -06:00
```
### Key Learnings
- Network configuration with NetworkManager
- IPv4 and IPv6
- Firewall zone management
- DNS configuration
2025-02-23 12:01:29 -06:00
## Skills Demonstrated
- Network Configuration
- DNS Management
- Network Troubleshooting
- Network Security
2025-03-02 09:26:39 -06:00
## Scenario: [v2-S7] Network and Storage Troubleshooting
### Original Problem
From Practice Scenarios v2, Scenario 7:
1. Diagnose and repair failed NFS mounts
2. Recover from a failed LVM configuration
3. Fix network connectivity issues
4. Restore correct SELinux contexts after file restoration
5. Configure autofs for user home directories
6. Set up network teaming for redundancy
### Environment
- OS Version: RHEL/Rocky Linux 8.x
- Initial State: System with various network and storage issues
- Required Outcome: Fully functional system with resolved issues and properly configured network
2025-03-02 09:26:39 -06:00
### Solution Steps
[To be filled when I complete this exercise]
2025-03-02 09:26:39 -06:00
## Scenario: [v3-S7] Network Services Configuration
### Original Problem
From Practice Scenarios v3, Scenario 7:
1. Configure network with:
- Bonded interface with active-backup
- VLAN configuration
- Static routes
2. Set up DNS resolution with:
- Multiple DNS servers
- Search domains
- Local host entries
3. Implement network security with:
- TCP Wrappers
- IPtables rules
- Fail2ban configuration
### Environment
- OS Version: RHEL/Rocky Linux 8.x
- Initial State: Basic network configuration with single interface
- Required Outcome: Advanced network configuration with bonding, VLANs, and security features
2025-03-02 09:26:39 -06:00
### Solution Steps
[To be filled when I complete this exercise]