zynq linux 設置靜態ip地址


新板子剛到手,迫不及待連上看看,可惜不能上網,原來ip配置有問題。


獲取系統系統版本:

#cat  /etc/issue

welcome to myir board

不是通用的內核版本,開版本自己搞的


內核版本:

uname -r

3.15.0-xilinx

內核版本是3.15.0,有點老啊,現在內核已經更新到4.9了


修改網絡配置文件

/etc/network/interfaces


內容如下:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.0.36 #根據實際路由配置
netmask 255.255.255.0
gateway 192.168.0.1 #根據實際路由配置


保存編輯結果,並重啓網絡服務

/etc/init.d/S40network restart

S40network 跟平常網上的不一樣,網上看到是"/etc/init.d/networking restart" ,估計內核版本不同導致的吧。


執行 ifconfig ,可以看到IP地址已經跟新。

在客戶端ping192.168.0.36, 可以ping通,

okay....



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章