樹莓派網絡配置查詢


查本機網絡信息

ifconfig

查詢本機dns

cat /etc/resolv.conf

啟動/關閉  網卡

ifup eth0

ifdown eth0

網卡靜態ip動態ip配置

vim /etc/network/interface

# 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
auto eth0
iface eth0 inet dhcp
iface eth0 inet6 dhcp
#iface eth0 inet static
#address 192.168.1.7
#netmask 255.255.255.0
#gateway 192.168.1.1
#dns-nameservers 192.168.1.6
#iface eth0 inet6 static
#pre-up modprobe ipv6
#address 2001:620:40b:555::7
#netmask 64
#gateway 2001:620:40b:555::1
#dns-nameservers fe80::1e1b:dff:fecc:cff6

改完后記得

/etc/init.d/networking restart

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM