if your computer has multiple nics connected to multiple dhcp-servers you might get multiple “default” gateways… and your system might choose the “wrong one” that is not connected to the internet (LAN (iface eth0)) instead of the one that is (iface wlan0).

you might also need to delete the automatically added default gateway and add your custom/manual one:


# what routes are defined
root@Microknoppix:/home/knoppix# route
Kernel-IP-Routentabelle
Ziel Router Genmask Flags Metric Ref Use Iface
default 192.168.178.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.178.0 * 255.255.255.0 U 0 0 0 eth0

# delete the cable bound default gateway
route del default gw 192.168.178.1 eth0;

# add the correct wireless connected default gateway
route add default gw 192.168.0.1

try metrics priorty:


# instal ifmetric;
apt-get install ifmetric;
# asign highest priority to wlan0
vim /etc/network/interfaces;

iface wlan0 inet dhcp
metric 0
pre-up ifconfig wlan0 up
pre-up pidof wpa_supplicant >/dev/null 2>&1 || wpa_supplicant -u -B
pre-up iwconfig wlan0 essid ""
pre-up iwconfig wlan0 key "off"

# restart networking
/etc/init.d/networking restart;

# ping yahoo.de to see if we can reach the online world while beeing connected to two networks at the same time
ping yahoo.de;

 

 

5.6.2. Das ifmetric-Paket

Das ifmetric-Paket ermöglicht es uns, die Metrik von Routen sogar für DHCP zu manipulieren.

Mit folgendem Vorgehen setzen Sie die eth0-Schnittstelle als bevorzugt gegenüber der wlan0-Schnittstelle:

  1. Installieren Sie das Paket ifmetric.
  2. Fügen Sie eine Zeile mit “metric 0” direkt unterhalb von “iface eth0 inet dhcp” in “/etc/network/interfaces” ein.
  3. Fügen Sie eine Zeile mit “metric 1” direkt unterhalb von “iface wlan0 inet dhcp” in “/etc/network/interfaces” ein.

Das “metric 0” steht für die Route mit der höchsten Priorität und ist der Standardwert. Der größere metric-Wert steht für Routen mit niedrigeren Prioritäten. Die IP-Adresse der aktivierten Schnittstelle mit dem niedrigsten metric-Wert wird die bevorzugte Adresse. Details finden Sie unter ifmetric(8).

sources: https://www.debian.org/doc/manuals/debian-reference/ch05.de.html

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin