Raspberry Pi 3 - Statická IP
22.03.2017 14:07 Filed in/Kategorie: Computers
Metoda dhcpcd
1. Kontrola
$ sudo nano /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
2. Konfigurace
$ sudo nano /etc/dhcpcd.conf
na konec přidat konfiguraci (je tam example co vsechno nastavit)
interface eth0
static ip_address=1.0.0.12/24
static routers=1.0.0.2
static domain_name_servers=1.0.0.2
interface wlan0
static ip_address=192.168.0.200/24
static routers=192.168.0.1
static domain_name_servers=192.168.0.1
3. Spuštění DHCP
$ sudo systemctl enable dhcpcd
Synchronizing state of dhcpcd.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable dhcpcd
$
4. Spuštění sítě
$ sudo systemctl enable networking
Synchronizing state of networking.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable networking
$
5. Celkový restart
$ sudo reboot
6. Kontrola pres ifconfig
Další informace například: https://youtu.be/RCw3oIlxozA