wlado's website

Raspberry Pi 3 - Statická IP

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=10.101.0.12/17
static routers=10.101.1.2
static domain_name_servers=10.101.1.10

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 for dhcpcd.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d dhcpcd defaults ve verzi 2018-11-13 se toto hlášení neukazuje
Executing /usr/sbin/update-rc.d dhcpcd enable


Aktualizace: Ve verzi 2018-11-13 se to projeví takto:
$ 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 for networking.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d networking defaults
Executing /usr/sbin/update-rc.d networking enable


Aktualizace: Ve verzi 2018-11-13 se to projeví takto:
$ 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
$


celkový restart


$ sudo reboot

kontrola pres ifconfig


Další informace například: https://youtu.be/RCw3oIlxozA