linux 網絡配置 以太網配置IP、網關


RK3399  RK3568  

/etc/network/interfaces

 

自動分配IP

auto eth0 
iface eth0 inet dhcp

靜態IP

auto eth0
iface eth0 inet static
address 192.168.0.232
gateway 192.168.0.1
netmask 255.255.255.0

命令

設置IP 地址
ifconfig eth0 192.168.1.120

修改mac 地址
ifconfig eth0 hw ether 08:90:90:90:90:90

設置子網掩碼
ifconfig eth0 netmask 255.255.255.0

設置廣播地址
ifconfig eth0 broadcast 192.168.1.120

添加默認網關
route add default gw 192.168.1.1

刪除默認網關
route del default gw 192.168.1.1

 

————————————————
版權聲明:本文為CSDN博主「橫山郡守」的原創文章,遵循CC 4.0 BY-SA版權協議,轉載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/scottmvp/article/details/117294606


免責聲明!

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



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