1. 程式人生 > >zynq linux 設定靜態ip地址

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....