Ethernet

參考 http://yehnan.blogspot.tw/2016/05/raspberry-piipdhcpcd.html

釋放IP,透過DHCP重新取得IP

DHCP拿IP / 釋放IP

$ sudo dhclient eth0
$ sudo dhclient -r eth0

開關eth0網路介面

$ sudo ifconfig eth0 up
$ sudo ifconfig eth0 down

DNS

編輯 /etc/resolv.con 這支檔案,格式相當簡單,手動把google dns寫入(系統重啟後,設定就不見了)

pi@raspberrypi:~/solarpi/dev $ cat /etc/resolv.conf 
# Generated by resolvconf
nameserver 8.8.8.8

要讓重開機後仍維持設定做法:寫入 /etc/dhcpcd.conf

# Handy modify
interface eth0
static ip_address=192.168.43.112/24
static routers=192.168.43.1
static domain_name_servers=8.8.8.8

測試DNS反查

pi@raspberrypi:~ $ host www.google.com
www.google.com has address 172.217.27.132
www.google.com has IPv6 address 2404:6800:4008:803::2004

results matching ""

    No results matching ""