Mehrere Wifi-Verbindungen konfigurieren (Raspbian): Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
== /etc/wpa_supplicant/wpa_supplicant.conf == | |||
In der Datei | |||
<pre> | |||
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf | |||
</pre> | |||
für jede Wifi-Verbindung einen <code>network</code>-Eintrag hinzufügen: | |||
<pre> | |||
country=AT | |||
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev | |||
ap_scan=1 | |||
update_config=1 | |||
network={ | |||
ssid="SSID-ROUTER-1" | |||
psk="password1" | |||
} | |||
network={ | |||
ssid="SSID-ROUTER-2" | |||
psk="password2" | |||
} | |||
</pre> | |||
== /etc/dhcpcd.conf == | |||
In der Datei | |||
<pre> | |||
sudo vi /etc/dhcpcd.conf | |||
</pre> | |||
nach folgenden Muster statische IP-Adressen konfigurieren: | |||
<pre> | |||
interface <Network> | |||
arping <IP_Router1> | |||
arping <IP_Router2>profile <IP_Router1> | |||
static ip_address=<IP_Pi1>/24 | |||
static routers=<IP_Router1> | |||
static domain_name_servers=<Name_Server1>profile <IP_Router2> | |||
static ip_address=<IP_Pi2>/24 | |||
static routers=<IP_Router2> | |||
static domain_name_servers=<Name_Server2> | |||
</pre> | |||
Beispiel-Konfiguration: | |||
<pre> | |||
interface wlan0 | |||
arping 10.0.0.1 | |||
arping 10.3.0.1 | |||
profile 10.0.0.1 | |||
static ip_address=10.0.0.180/24 | |||
static routers=10.0.0.1 | |||
static domain_name_servers=8.8.8.8 8.8.4.4 | |||
profile 10.3.0.1 | |||
static ip_address=10.3.0.180/24 | |||
static routers=10.3.0.1 | |||
static domain_name_servers=8.8.8.8 8.8.4.4 | |||
</pre> | |||
== Links == | == Links == | ||
[https:// | [https://medium.com/swlh/raspberry-pi-3-connect-to-multiple-wifis-set-multiple-static-ips-52f8a80d2ee1 https://medium.com/swlh/raspberry-pi-3-connect-to-multiple-wifis-set-multiple-static-ips-52f8a80d2ee1] | ||
[https://wiki.ubuntuusers.de/WLAN/wpa_supplicant/#Roaming https://wiki.ubuntuusers.de/WLAN/wpa_supplicant/#Roaming] | |||
Zurück zu [[Netzwerk Wireless (Raspbian)#2 Wifi-Verbindungen konfigurieren|Netzwerk Wireless]] | Zurück zu [[Netzwerk Wireless (Raspbian)#2 Wifi-Verbindungen konfigurieren|Netzwerk Wireless]] |
Aktuelle Version vom 28. April 2023, 13:52 Uhr
/etc/wpa_supplicant/wpa_supplicant.conf
In der Datei
sudo vi /etc/wpa_supplicant/wpa_supplicant.conf
für jede Wifi-Verbindung einen network
-Eintrag hinzufügen:
country=AT ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev ap_scan=1 update_config=1 network={ ssid="SSID-ROUTER-1" psk="password1" } network={ ssid="SSID-ROUTER-2" psk="password2" }
/etc/dhcpcd.conf
In der Datei
sudo vi /etc/dhcpcd.conf
nach folgenden Muster statische IP-Adressen konfigurieren:
interface <Network> arping <IP_Router1> arping <IP_Router2>profile <IP_Router1> static ip_address=<IP_Pi1>/24 static routers=<IP_Router1> static domain_name_servers=<Name_Server1>profile <IP_Router2> static ip_address=<IP_Pi2>/24 static routers=<IP_Router2> static domain_name_servers=<Name_Server2>
Beispiel-Konfiguration:
interface wlan0 arping 10.0.0.1 arping 10.3.0.1 profile 10.0.0.1 static ip_address=10.0.0.180/24 static routers=10.0.0.1 static domain_name_servers=8.8.8.8 8.8.4.4 profile 10.3.0.1 static ip_address=10.3.0.180/24 static routers=10.3.0.1 static domain_name_servers=8.8.8.8 8.8.4.4
Links
https://wiki.ubuntuusers.de/WLAN/wpa_supplicant/#Roaming
Zurück zu Netzwerk Wireless