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

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

3,429 Views
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.

Labels (4)
0 Kudos
5 Replies

1,480 Views
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 Kudos

1,480 Views
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 Kudos

1,480 Views
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 Kudos

1,480 Views
Yuri
NXP Employee
NXP Employee

What is log ?

0 Kudos

1,480 Views
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 Kudos