Skip to content

Debian WiFi + Ethernet Setup Fix

Problem

  • Ethernet connected locally (192.168.1.x)
  • WiFi has internet but not routing properly
  • DNS not working or packet loss

Quick Diagnostic

ip addr          # Check interfaces have IPs
ip route         # Check default gateway
ping 8.8.8.8     # Test internet
ping google.com  # Test DNS

Fix DNS (if 8.8.8.8 works but google.com doesn't)

echo "nameserver 8.8.8.8" > /etc/resolv.conf
echo "nameserver 1.1.1.1" >> /etc/resolv.conf
ping google.com  # Should work now

Fix Default Route (if no internet at all)

Check which interface should have default route:

ip route

Should show something like:

default via 192.168.x.x dev wlp3s0b1  # WiFi gateway
192.168.1.0/24 dev enp4s0f0           # Local ethernet

If default is missing or wrong:

# Remove bad default (if exists)
ip route del default via 192.168.1.1

# Add correct default via WiFi gateway (adjust IP as needed)
ip route add default via 192.168.x.x dev wlp3s0b1

Reconnect WiFi (if disconnected)

With NetworkManager (if installed)

nmcli device wifi list
nmcli device wifi connect "NetworkName" password "YourPassword"

Without NetworkManager (manual)

# Bring interface up
ip link set wlp3s0b1 up

# Create config
wpa_passphrase "NetworkName" "YourPassword" > /etc/wpa_supplicant.conf

# Connect
wpa_supplicant -B -i wlp3s0b1 -c /etc/wpa_supplicant.conf
dhclient wlp3s0b1

Make DNS Permanent

If using NetworkManager

nmcli connection modify "WiFi-connection-name" ipv4.dns "8.8.8.8 1.1.1.1"
nmcli connection down "WiFi-connection-name"
nmcli connection up "WiFi-connection-name"

If using /etc/network/interfaces

Edit:

nano /etc/network/interfaces

Add under WiFi interface:

dns-nameservers 8.8.8.8 1.1.1.1

Network Info

  • Ethernet interface: enp4s0f0 (local network only, 192.168.1.x)
  • WiFi interface: wlp3s0b1 (internet connection)
  • WiFi SSID: [Your network name]
  • Local ethernet IP: 192.168.1.12

Notes

  • WiFi must be default route for internet
  • Ethernet is for local device communication only
  • Router is not accessible via ethernet (building restriction)

Fix APT IPv6 Issues

If apt fails with "Network is unreachable" on IPv6 addresses:

echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
apt update

This forces apt to use IPv4 only.