1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| # A ServerID is required by RFC2131.
require dhcp_server_identifier
# Generate Stable Private IPv6 Addresses instead of hardware based ones
slaac private
# Example static IP configuration:
interface eth0
static ip_address=192.168.1.35/24
static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=192.168.1.1
static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1
# It is possible to fall back to a static IP if DHCP fails:
#define static profile
#profile static_eth0
Mon ifconfig
pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether b8:27:eb:1d:e7:c5 txqueuelen 1000 (Ethernet)
RX packets 432 bytes 91873 (89.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 58 bytes 7168 (7.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 29 bytes 1940 (1.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 29 bytes 1940 (1.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.21 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::22c:50ba:4c3e:28f4 prefixlen 64 scopeid 0x20<link>
inet6 2a01:cb00:862d:5300:1542:1ac5:90dc:5c4c prefixlen 64 scopeid 0x0<global>
mon etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8# Please note that this file i$
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
# Include files from /etc/network/interfaces.d:
#source-directory /etc/network/interfaces.d |
Partager