when imx8 started , we can see it's route and ifconfig configuration is :
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 br0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
root@imx8qxpmek:~# ifconfig
br0 Link encap:Ethernet HWaddr 1e:a3:e1:e8:c8:cd
inet addr:192.168.1.18 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::d45f:9fff:fe62:de10/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:23 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13012 (12.7 KiB) TX bytes:1334 (1.3 KiB)
eth0 Link encap:Ethernet HWaddr be:dc:ce:a6:21:3f
inet6 addr: fe80::bcdc:ceff:fea6:213f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:150 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:18518 (18.0 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:119 errors:0 dropped:0 overruns:0 frame:0
TX packets:119 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:11444 (11.1 KiB) TX bytes:11444 (11.1 KiB)
usb0 Link encap:Ethernet HWaddr 1e:a3:e1:e8:c8:cd
inet6 addr: fe80::1ca3:e1ff:fee8:c8cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:128 errors:0 dropped:4 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13339 (13.0 KiB) TX bytes:268 (268.0 B)
but after few seconds (0 to 30 second),it will change to follow status:
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 br0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
root@imx8qxpmek:~# ifconfig
br0 Link encap:Ethernet HWaddr 1e:a3:e1:e8:c8:cd
inet addr:192.168.1.18 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::d45f:9fff:fe62:de10/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:123 errors:0 dropped:0 overruns:0 frame:0
TX packets:67 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13012 (12.7 KiB) TX bytes:3238 (3.1 KiB)
eth0 Link encap:Ethernet HWaddr be:dc:ce:a6:21:3f
inet addr:169.254.97.105 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::bcdc:ceff:fea6:213f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST DYNAMIC MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:203 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:21952 (21.4 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:225 errors:0 dropped:0 overruns:0 frame:0
TX packets:225 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:21078 (20.5 KiB) TX bytes:21078 (20.5 KiB)
usb0 Link encap:Ethernet HWaddr 1e:a3:e1:e8:c8:cd
inet6 addr: fe80::1ca3:e1ff:fee8:c8cd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:128 errors:0 dropped:4 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13339 (13.0 KiB) TX bytes:268 (268.0 B)
the follow route have bad influence to our product
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
i try to delete the route , but the first one can not be delelted;
how to stop route allocation for eth0 ?
You may set a fix IP to it
from the follow link on nxp community
disable imx8mq default eth0 dhcp
use " systemctl disable connman " can make eth0 dhcp stop
but the first bringup of the board will have issue;
it seems we must delete connman.service when compile ;
i cannot sure whether it have other influence;
thanks
Have you try to set the IP in u-boot bootargs?
e.g. (https://community.nxp.com/message/866455?commentID=866455#comment-866455 )
setenv bootargs ${bootargs} ip=${ipaddr}:${serverip}:${gateway}:${netmask}::eth0
i add fix ip to it , but it's still have new ip route :
root@imx8qxpmek:/# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
0.0.0.0 0.0.0.0 0.0.0.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
we use follow service to control net configuration :