IMX6Q Android8.0 Ethernet Static IP Not work

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

IMX6Q Android8.0 Ethernet Static IP Not work

5,245件の閲覧回数
leavs
Contributor IV

Hi,

I have one imx6q device which run Android 8.0 system, I need to set Static IP, so I use com.fsl.ethernet to do that,

I can set the right IP, but I can't communication to other. I use follow command to test:

My Static IP:

```

IP: 192.168.6.99

Netmask: 255.255.255.0

DNS: 192.168.6.1

Gateway: 192.168.6.1

```

Error:

```

ping 192.168.6.1

Network is unreachable

ping www.google.com

Network is unkonw

```

I can get the prop is right:

```

sabresd_6dq:/ # getprop | grep dns
getprop | grep dns
[init.svc.mdnsd]: [running]
[net.dns1]: [192.168.6.1]
[net.eth0.dns1]: [192.168.6.1]
[net.eth0.dns2]: [0.0.0.0]
[ro.boottime.mdnsd]: [11647904667]

```

when I set the ethernet to dhcp, It work well.

can anyone know this problem?

ラベル(1)
11 返答(返信)

3,389件の閲覧回数
kwun9106
Contributor I

Someone solved this problem

Add some code in " /frameworks/opt/net/ethernet/java/com/android/server/ethernet/EthernetNetworkFactory.java "

https://www.jpand.me/2019/05/24/android-o-static-ip-trouble-shooting/ 

0 件の賞賛

3,389件の閲覧回数
carloorsi
Contributor II

Hi,

I have the same issue!

I'm spending a lot of time without success.

Uff...

0 件の賞賛

3,389件の閲覧回数
fensy
Contributor II

I tried to use network adb.

> ip route add default via 192.168.0.1

> setprop net.eth0.dns1 168.126.63.1
> setprop net.eth0.dns2 8.8.8.8

I could communicate with my pc, but I still could not access the internet.

0 件の賞賛

3,389件の閲覧回数
carloorsi
Contributor II

I tried to evaluate differences between DHCP settings and STATIC.

I investigated with iproute2 tool.

Only difference is with ip rule show:

the first one is with STATIC, the second one with DHCP...

pastedImage_2.png

In STATIC are not present the rules to support eth0.

I believe this is the issue but I don't know how to solve.

I tried to add manually without success with:

ip rule add oif eth0 uidrange 0-0 lookup eth0

unfortunately last eth0 is a non valid argument...

Not only, I don't find the file

/etc/iproute2/rt_tables 

where official documentation suggest to see the valid argument for lookup (table).

 

0 件の賞賛

3,389件の閲覧回数
carloorsi
Contributor II

Finally I solved!

You can set your favorite STATIC address and after to adjust configuration manually with ADB in root mode:

ip route add default via 192.168.1.1 dev eth0 table legacy_network

ndc resolver setnetdns eth0 . 8.8.8.8 8.8.4.4

Now the board can browse around Internet...

Modification is not permanent!!!

Next step will be to understand how to fix the bug in com.fsl.ethernet

Carlo

3,389件の閲覧回数
fensy
Contributor II

great!

I have used .sh in init.rc in the kitkat version.

ex)

init.rc

+service mysh /system/bin/sh /system/bin/network_init_eth0.sh
+   class late_start
+   oneshot

network_init_eth0.sh

+ifconfig eth0 192.6.94.200 netmask 255.255.255.0 up

+ip route add default gw 192.168.1.1 dev eth0

+ip route add default via 192.168.1.1 dev eth0 table legacy_network

+ndc resolver setnetdns eth0 . 8.8.8.8 8.8.4.4

+setprop net.eth0.dns1 168.126.63.1
+setprop net.eth0.dns2 8.8.8.8

In Android M version, need to add SELINUX policy.

0 件の賞賛

3,389件の閲覧回数
fensy
Contributor II

Hi, 

I haven't found a solution yet, but i found the difference between DHCP and STATIC.

 

DHCP

#ip rule

0: from all lookup local
10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system
13000: from all fwmark 0x10063/0x1ffff lookup local_network
15000: from all fwmark 0x0/0x10000 lookup legacy_system
16000: from all fwmark 0x0/0x10000 lookup legacy_network
17000: from all fwmark 0x0/0x10000 lookup local_network
23000: from all fwmark 0x0/0xffff uidrange 0-0 lookup main
32000: from all unreachable

13000: from all fwmark 0x10065/0x1ffff lookup eth0
19000: from all fwmark 0x65/0x1ffff lookup eth0
22000: from all fwmark 0x0/0xffff lookup eth0
14000: from all oif eth0 lookup eth0
10500: from all oif eth0 uidrange 0-0 lookup eth0

Static IP

0: from all lookup local
10000: from all fwmark 0xc0000/0xd0000 lookup legacy_system
13000: from all fwmark 0x10063/0x1ffff lookup local_network
15000: from all fwmark 0x0/0x10000 lookup legacy_system
16000: from all fwmark 0x0/0x10000 lookup legacy_network
17000: from all fwmark 0x0/0x10000 lookup local_network
23000: from all fwmark 0x0/0xffff uidrange 0-0 lookup main
32000: from all unreachable

If I know the difference, I think I can find a way.

0 件の賞賛

3,389件の閲覧回数
diegoadrian
NXP Employee
NXP Employee

Hello

I apologize for the delay.

Have you tried to set up the static ip as the below video?

How to Set Static IP Address on Android 4 (Ice-Cream) - YouTube 

Hope it can help you.

Best Regards,

Diego.

0 件の賞賛

3,389件の閲覧回数
leavs
Contributor IV

Hi Diego,

If there is one patch to fix this issue?

0 件の賞賛

3,389件の閲覧回数
leavs
Contributor IV

Hi,

Thanks for your reply.

I tested the static IP config of WIFI, It can work well.

But I need the ethernet to set static IP feature, I use the ethernet.apk from fsl, It can set static ip, but I can't comunication with ethernet.

The ethernet.apk run ok in android 6.0 from nxp.

Is there some bugs for ethernet.apk in Android8.0 ?

0 件の賞賛

3,389件の閲覧回数
leavs
Contributor IV

are there anyone know this problem?

0 件の賞賛