====== ネットワーク設定 ======
IP関連設定
=====DHCPで設定=====
# vi /etc/dhcp/dhclient.conf
----
send dhcp-client-identifier = hardware; (こちらは必須・・・、かと思ったらなくても動いていそう)
# vi /etc/dhcpcd.conf
----
send dhcp-client-identifier = hardware; (こちらは必須ではないみたい)
interface eth0
interface wlan0
# vi /etc/network/interfaces
----
iface eth0 inet manual
# iface eth0 inet dhcp (この行をmanualにしないとDHCPでアドレスが設定できない?)
allow-hotplug wlan0
iface wlan0 inet manual
# iface wlan0 inet dhcp
# sudo service dhcpcd reload
(参考) iface等の意味について説明あり
https://www.debian.org/doc/manuals/debian-reference/ch05.ja.html#_the_basic_syntax_of_etc_network_interfaces
===== 固定アドレスで設定 =====
アドレスを固定にする場合
# vi /etc/network/interfaces
----
iface wlan0 inet manual
iface eth1 inet manual
固定アドレスはdhcpcd.confで設定する。
(/etc/network/interfacesではできなくなった)
# vi /etc/dhcpcd.conf
----
send dhcp-client-identifier = hardware; (こちらは必須ではないみたい)
interface eth0
static ip_address=192.168.1.152/24
static routers=192.168.1.30
static domain_name_servers=192.168.1.1
interface wlan0
static ip_address=192.168.1.162/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
# sudo service dhcpcd reload
(参考) https://hirooka.pro/?p=8526
-----------------------------------------------------------------------
===== 無線LAN =====
====パスフレーズ等の設定====
# cd /etc/wpa_supplicant
# iwlist wlan0 scan|grep ESSID
# wpa_passphrase SSID password
# sudo vi wpa_supplicant.conf
network={
ssid="SSID"
psk=xxxxxxxxxxx....................xxxxx
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
# chmod 600 wpa_supplicant.conf
====interfaces設定====
# vi /etc/network/interfaces
allow-hotplug wlan0
iface wlan0 inet manual
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
# ifconfig wlan0 down
# ifconfig wlan0 up
# ifconfig wlan0
省電力設定の例
# vi /etc/modprobe.d/8192cu.conf
----
# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1
===== DNSサーバ指定 =====
# vi /etc/resolv.conf
----
nameserver 8.8.8.8 (DNSサーバのIPアドレス)
# sudo /etc/init.d/networking reload (設定反映)