Debian 12 Initialization Guide: Network Configuration and BBR Optimization
#linux#debian#server#maintenance
Debian is the first choice for many server administrators due to its extremely high stability and low resource consumption. This article will introduce the standard initialization process after a fresh installation of Debian 12 (Bookworm), focusing on network configuration and network performance optimization.
Before performing any configuration, first ensure that the system software is up to date.
# Update package list and upgrade the systemapt update &&apt upgrade -y# Install common network and system tools# curl/wget: Download tools# vim/nano: Editors# git: Version control# net-tools: Contains old tools like ifconfig (optional)# dnsutils: Contains DNS tools like dig/nslookupaptinstall-ycurlwgetvimgit net-tools dnsutils
Debian uses the /etc/network/interfaces file to manage network configurations by default. Although Netplan is popular in Ubuntu, Debian still recommends using the traditional ifupdown method.
cp /etc/network/interfaces /etc/network/interfaces.bak
vim /etc/network/interfaces
Change the content to the following format (please modify the IP according to your actual network environment):
# Local loopback interfaceauto lo
iface lo inet loopback
# Main network interface (assuming the card name is eth0)allow-hotplug eth0
iface eth0 inet static
address 192.168.1.100/24 # IP address and subnet mask (CIDR format) gateway 192.168.1.1 # Gateway address# dns-nameservers 8.8.8.8 1.1.1.1 # Optional: specify DNS directly here
After modification, restart the network service:
systemctl restart networking
# Or restart the systemreboot
If DNS is not specified in /etc/network/interfaces, the system will use the configuration in /etc/resolv.conf.
Edit the file:
vim /etc/resolv.conf
Add recommended public DNS servers:
# Google DNSnameserver 8.8.8.8
nameserver 8.8.4.4
# Cloudflare DNSnameserver 1.1.1.1
Note: Some VPS providers will automatically reset this file after a reboot. If this happens, you can install the resolvconf service to persist the configuration, or set dns-nameservers in the network card configuration file.
BBR (Bottleneck Bandwidth and Round-trip propagation time) is a TCP congestion control algorithm developed by Google that can significantly improve network throughput and reduce latency, especially in network environments with some packet loss.