How to set the Gateway and Netmask of Ethernet in Android 4.4.3

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How to set the Gateway and Netmask of Ethernet in Android 4.4.3

3,434 次查看
erickang
Contributor II

Hi All,

I want to set the Gateway and Netmask of Ethernet in Android 4.4.3.

Could you tell me how to set those?

Our development environment is like below,

- AP/Board : i.MX6DL-SabreSDP

- OS : Android 4.4.3 (Linux 3.10.53)

I could confirm the method how to apply IP and DNS from Ethernet App in packages/apps/fsl_imx_demo,

But I couldn't find how to set the Gateway and Netmask of Ethernet.

Best Regards,

Eric.

标签 (4)
0 项奖励
5 回复数

1,485 次查看
Yuri
NXP Employee
NXP Employee

Hello, Eric !

Android networking is property based and is available through getprop / setprop commands.

Also standard Linux utilities ifconfig and route are still available.

Have You tried it ?

$ ifconfig eth0 192.168.1.151 255.255.255.0

$ route add default gw 192.168.1.1 dev eth0

$ setprop net.eth0.dns1 8.8.8.8

Have a great day,
Yuri

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励

1,485 次查看
erickang
Contributor II

Hi Yuri,

Thanks for your response.

I used the below command to set the Ethernet Configuration.

  ~$ ipconfig eth0 xxx.xxx.xxx.xxx netmask 255.255.255.0

  ~$ route add default gw yyy.yyy.yyy.yyy dev eth0

But I couldn't find the ethernet.apk to set those.

Best Regards,

Eric.

0 项奖励

1,485 次查看
johnnyjhao
Contributor I

Hi Yuri,

I found a ethernet.apk in freescale website,  but the app can't set gateway

https://community.freescale.com/servlet/JiveServlet/download/93626-9-264786/ethernet.apk.zip

0 项奖励

1,485 次查看
Yuri
NXP Employee
NXP Employee

What is log ?

0 项奖励

1,485 次查看
Yuri
NXP Employee
NXP Employee

  We do not provide .apk, sorry.

Nevertheless, You may look at How to Add Ethernet UI Support in ICS 

Regards,

Yuri.

0 项奖励