You can perform some network optimizations using the terminal on Linux to potentially improve your internet connection speed. Here are some commands and steps you can try:
- Flush DNS Cache:
bash
sudo systemd-resolve --flush-caches - Change DNS Server (example: Google DNS):
bash
sudo nano /etc/resolv.conf
Edit the file to include the following lines:
nameserver 8.8.8.8
nameserver 8.8.4.4
Save and exit the file. Restart the network service:
bash
sudo systemctl restart NetworkManager - TCP Window Scaling: Edit the sysctl.conf file:
bash
sudo nano /etc/sysctl.conf
Add the following lines:
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_timestamps = 1
Save and apply the changes:
bash
sudo sysctl -p - TCP Congestion Control (example: BBR):
bash
sudo nano /etc/sysctl.conf
Add the following line:
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr
Save and apply the changes:
bash
sudo sysctl -p - Limit Resolving IPv6 Addresses: Edit the sysctl.conf file:
bash
sudo nano /etc/sysctl.conf
Add the following line:
arduino
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1
Save and apply the changes:
bash
sudo sysctl -p - Use iperf to Test Network Speed: Install iperf if not already installed:
bash
sudo apt-get install iperf
Run iperf as a server on one machine:
bash
iperf -s
Test the network speed from another machine:
bash
iperf -c <server_ip>