Network Configuration
Network Interface Management
Viewing Network Interfaces
## List all network interfaces
ip link show
## Detailed network interface information
ifconfig -a
Static IP Configuration
Configuring Network Interfaces
graph TD
A[Network Configuration] --> B[Static IP]
A --> C[Dynamic IP]
B --> D[Manual Configuration]
C --> E[DHCP]
Editing Network Configuration Files
## Edit network configuration file
sudo nano /etc/netplan/01-netcfg.yaml
Example Netplan Configuration:
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
addresses: [192.168.1.100/24]
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
Applying Network Configuration
## Apply network configuration
sudo netplan apply
DNS Configuration
Modifying DNS Settings
## View current DNS configuration
cat /etc/resolv.conf
DNS Configuration Method |
Description |
Static DNS |
Manually set DNS servers |
DHCP |
Automatically receive DNS from router |
Multiple DNS |
Configure multiple DNS servers |
Network Interface Control
Enabling/Disabling Interfaces
## Bring up a network interface
sudo ip link set enp0s3 up
## Bring down a network interface
sudo ip link set enp0s3 down
Advanced Network Configuration
Bonding and Bridging
graph TD
A[Advanced Network Config] --> B[Network Bonding]
A --> C[Network Bridging]
B --> D[Fault Tolerance]
B --> E[Load Balancing]
Wireless Network Configuration
## Scan available wireless networks
nmcli dev wifi list
## Connect to a wireless network
nmcli dev wifi connect "NetworkName" password "YourPassword"
LabEx Networking Insights
At LabEx, we provide comprehensive networking configuration tutorials to help learners master Linux network management skills.
Best Practices
- Always backup configuration files before modifications
- Use version control for network configurations
- Test configurations in staging environments
- Understand network topology before making changes
Conclusion
Effective network configuration is crucial for maintaining robust and secure Linux systems.