クイック診断
# Check network interface status
ip link show
# Check IP addresses
ip addr show
# Test network connectivity
ping -c 4 8.8.8.8
# Test DNS resolution
ping -c 4 www.google.com
# Check NetworkManager status
nmcli general statusネットワークカードが認識されない
# Check Ethernet devices
lspci | grep -i ethernet
ip link show | grep -E "^[0-9]"
# If the network card is not shown, check the driver
sudo dmesg | grep -i eth
sudo dmesg | grep -i r8169 # Common Realtek driver# Have NetworkManager re-request an address (dhclient is no longer shipped)
sudo nmcli device reapply enp0s3
# On systemd-networkd systems use instead:
sudo networkctl renew enp0s3
# Or reconnect the interface
sudo nmcli device connect enp0s3
# Manually configure a static IP
sudo nmcli con mod "Wired connection 1" \
ipv4.addresses 192.168.1.100/24 \
ipv4.gateway 192.168.1.1 \
ipv4.dns "8.8.8.8,1.1.1.1" \
ipv4.method manual
sudo nmcli con up "Wired connection 1"Wi-Fiアダプターが検出されない
# Check wireless devices (iwconfig is deprecated; use iw)
iw dev
nmcli device wifi list
# Check if disabled by RF switch
rfkill list all
sudo rfkill unblock wifi# Scan for available networks
nmcli device wifi rescan
nmcli device wifi list
# Connect to Wi-Fi
nmcli device wifi connect "SSID_NAME" password "PASSWORD"
# View saved connections
nmcli connection show
# Delete a problematic connection and re-add
nmcli connection delete "CONNECTION_NAME"頻繁に切断される
# Check if power management turned off Wi-Fi
iw dev wlan0 get power_save
# Disable Wi-Fi power management
sudo iw dev wlan0 set power_save off
# Make it permanent
echo 'options iwlwifi power_save=0' | sudo tee /etc/modprobe.d/iwlwifi-powersave.confDNS の問題
症状: IP には ping できるが、ドメイン名は解決できない
# Test DNS
nslookup www.google.com
dig www.google.com
# Check current DNS configuration
resolvectl status
# Check systemd-resolved status
systemctl status systemd-resolvedDNS サーバーの変更
# Temporary change (lost after reboot)
sudo resolvectl dns enp0s3 8.8.8.8 1.1.1.1
# Permanent change through NetworkManager
sudo nmcli con mod "CONNECTION_NAME" ipv4.dns "8.8.8.8 1.1.1.1"
sudo nmcli con mod "CONNECTION_NAME" ipv4.ignore-auto-dns yes
sudo nmcli con up "CONNECTION_NAME"推奨されるパブリック DNS サーバー
| プロバイダー | プライマリ DNS | セカンダリ DNS |
|---|---|---|
| グーグル | ||
| クラウドフレア | 1.0.0.1 | |
| クアッド9 | ||
| OpenDNS | 208.67.220.220 |
ファイアウォールの問題
# Check UFW status
sudo ufw status verbose
# Temporarily disable firewall for testing
sudo ufw disable
# Allow specific ports
sudo ufw allow 80/tcp
sudo ufw allow 443/tcpシステムプロキシ
# Set environment variables
export http_proxy="http://127.0.0.1:7890"
export https_proxy="http://127.0.0.1:7890"
export no_proxy="localhost,127.0.0.1"
# Write to ~/.bashrc for permanenceAPT プロキシ
sudo nano /etc/apt/apt.conf.d/proxy.confAcquire::http::Proxy "http://127.0.0.1:7890";
Acquire::https::Proxy "http://127.0.0.1:7890";ネットワーク構成をリセットする
# Restart NetworkManager
sudo systemctl restart NetworkManager
# Completely reset network configuration
sudo rm /etc/NetworkManager/system-connections/*
sudo systemctl restart NetworkManager