Start of the Main Content
Every encounter is a fate, follow ⭐ to not miss out – sharing practical tutorials and tips every day.
1. Network Interface Management: The Foundation of Network Connectivity
1.1 Analysis of Modern Network Toolchains
In contemporary Linux systems, the <span>iproute2</span>
suite has completely replaced the traditional <span>net-tools</span>
, with advantages including:
Recommended Command Combinations:
ip -c addr show | grep "inet " # Display valid IPs in color
ip -br link show # Show interface status in brief mode
ethtool ens33 | grep Speed # Check negotiated speed of the network card
Classic Comparison Cases:
# Traditional Method (Not Recommended)
ifconfig ens33 down && ifconfig ens33 up
# Modern Method (Recommended)
ip link set ens33 down && ip link set ens33 up
Core Differences:
- • Supports network namespace isolation
- • Integrates advanced features like VLAN/VXLAN
- • Precise control over ARP cache
- • Full support for IPv6
1.2 Advanced Control of Network Interface Status
In-Depth Operation Examples:
# Check hardware queue status
ethtool -l ens33
# Adjust MTU value (ensure device supports it)
ip link set mtu 9000 dev ens33
# Real-time monitoring of network card status changes
watch -n1 'ip -s link show ens33'
Error Troubleshooting Guide:
- 1. Check physical layer status:
<span>ip link</span>
shows<span>LOWER_UP</span>
indicator - 2. Verify driver loading:
<span>lsmod | grep e1000</span>
- 3. Diagnose DMA configuration:
<span>dmesg | grep DMA</span>
1.3 IP Address Configuration Practical Engineering
Dynamic/Static Configuration Comparison Matrix:
Parameter | DHCP Dynamic Acquisition | Static Configuration |
Applicable Scenarios | Development Testing Environment | Production Server |
Fault Recovery | Automatic Renewal | Manual Maintenance Required |
Address Conflict Risk | Higher | Controllable |
Management Complexity | Low | High |
Multi-IP Binding Practical Example:
# Add auxiliary IP
ip addr add 192.168.1.100/24 dev ens33 label ens33:1
# Persistent configuration
echo 'IPADDR1=192.168.1.100' >> /etc/sysconfig/network-scripts/ifcfg-ens33
echo 'PREFIX1=24' >> /etc/sysconfig/network-scripts/ifcfg-ens33
2. Port Management: Ensuring Service Accessibility
2.1 In-Depth Port Scanning Techniques
Comprehensive Scanning Solutions:
# Quick TCP Scan
nmap -T4 -p 1-65535 127.0.0.1
# UDP Service Discovery
nmap -sU -p 53,67,68,161 localhost
# Stealth Scanning Mode
nmap -sS -Pn -n --disable-arp-ping 192.168.1.10
Connection Status Analysis:
- • TIME_WAIT: Normal closure residue
- • CLOSE_WAIT: Application did not handle closure correctly
- • SYN_RECV: Potential SYN Flood attack
2.2 Firewall Policy Essentials
Advanced Firewalld Configuration:
# Create a custom zone
firewall-cmd --permanent --new-zone=app_zone
# Bind source address range
firewall-cmd --zone=app_zone --add-source=10.0.0.0/24
# Set port forwarding
firewall-cmd --add-forward-port=port=80:proto=tcp:toport=8080
iptables Rule Optimization:
# Connection state tracking optimization
iptables -A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
# Rate limiting protection
iptables -A INPUT -p tcp --dport 22 -m limit --limit 5/min -j ACCEPT
3. Routing Management: Building Intelligent Traffic Paths
3.1 In-Depth Analysis of Routing Tables
Policy Routing Practice:
# Create a custom routing table
echo "200 custom" >> /etc/iproute2/rt_tables
# Add policy rules
ip rule add from 192.168.2.0/24 lookup custom
# Configure multipath routing
ip route add default scope global \
nexthop via 192.168.1.1 weight 1 \
nexthop via 192.168.2.1 weight 2
Routing Cache Monitoring:
# Real-time view of routing cache
ip route show cached
# Clear specific routing cache
ip route flush cache 192.168.1.0/24
3.2 BGP Routing Integration
Quagga Configuration Example:
router bgp 65001
neighbor 192.168.100.1 remote-as 65002
network 10.0.0.0/8
!
address-family ipv6
network 2001:db8::/32
exit-address-family
4. Network Diagnostics: Full-Stack Troubleshooting Methodology
4.1 Layered Diagnostic Model
+-----------------------+
| Application Layer (HTTP) |
+-----------------------+
| Transport Layer (TCP/UDP) |
+-----------------------+
| Network Layer (IP/ICMP) |
+-----------------------+
| Data Link Layer (ARP/MAC) |
+-----------------------+
| Physical Layer (Cables) |
+-----------------------+
Layered Diagnostic Toolchain:
- • Physical Layer:
<span>ethtool</span>
,<span>mii-tool</span>
- • Data Link Layer:
<span>arping</span>
,<span>tcpdump</span>
- • Network Layer:
<span>mtr</span>
,<span>tracepath</span>
- • Transport Layer:
<span>tcptraceroute</span>
,<span>socat</span>
- • Application Layer:
<span>curl</span>
,<span>wget</span>
,<span>openssl s_client</span>
4.2 Advanced Diagnostic Techniques
TCP Stream Analysis:
# Capture HTTP traffic
tcpdump -i ens33 -nn -s0 -w http.pcap 'tcp port 80'
# Analyze TLS handshake process
openssl s_client -connect example.com:443 -msg
Performance Bottleneck Identification:
# Measure network throughput
iperf3 -c 192.168.1.100 -t 30
# Count TCP retransmission rate
nstat -az TcpRetransSegs
# Check buffer settings
sysctl net.ipv4.tcp_rmem
5. Network Optimization: Best Practices for Production Environments
5.1 Kernel Parameter Tuning
# Improve TIME-WAIT recycling speed
echo "net.ipv4.tcp_tw_recycle = 1" >> /etc/sysctl.conf
# Optimize TCP window size
echo "net.core.rmem_max = 16777216" >> /etc/sysctl.conf
echo "net.core.wmem_max = 16777216" >> /etc/sysctl.conf
# Accelerate ARP cache updates
echo "net.ipv4.neigh.default.gc_stale_time = 120" >> /etc/sysctl.conf
5.2 Traffic Shaping Solutions
# Create HTB queue
tc qdisc add dev ens33 root handle 1: htb default 30
# Set bandwidth limit
tc class add dev ens33 parent 1: classid 1:1 htb rate 100mbit
# Apply filters
tc filter add dev ens33 protocol ip parent 1:0 prio 1 u32 \
match ip dport 80 0xffff flowid 1:1
6. New Paradigms in Cloud-Native Networking
6.1 CNI Plugin Practices
Calico Network Configuration:
apiVersion: projectcalico.org/v3
kind: IPPool
metadata:
name: ippool-1
spec:
cidr: 192.168.0.0/16
ipipMode: Always
natOutgoing: true
6.2 eBPF Network Observability
# Trace TCP connection establishment
bpftrace -e 'tracepoint:tcp:tcp_retransmit_skb { @[args->saddr, args->daddr] = count(); }'
# Count network interrupts
bpftrace -e 'kprobe:__netif_receive_skb { @[kstack] = count(); }'
Previous Recommendations:【First Release】DeepSeek-R1 Local Deployment Complete Guide: From 1.5B to 671B, Configuring Three Systems in One Go!Exclusive Reveal! Zero Network Setup for Linux Servers with DeepSeek – R1+WEB Page (Multiple Methods), Quickly Build a Dedicated Offline Knowledge Base, Installation Package Acquisition Guide IncludedDeploying DeepSeek R1 Model Offline on Windows and Building a Dedicated AI Knowledge BaseDeepSeek is Exploding, How Ordinary People Can Train Their Large Models from Scratch in 7 HoursA Beginner’s Guide to Mastering DeepSeek in One Day: From Zero to Technical Practice
👍 Like, your recognition is my motivation for creation!
⭐️ Save, your favor is my direction of effort!
✏️ Comment, your opinions are my wealth for progress!
ENDReview of Previous ArticlesSome images and concepts in the text are sourced from the internet; if there is any infringement, please contact me for removal.
Welcome to follow our public account:Intelligent Operation and Maintenance Fleet, dedicated to sharing knowledge and experience in operation and maintenance in the fields of digital government and smart cities, focusing on the development of operational capabilities in automation, intelligence, and digitization, providing various technical support services.