Hello,
I have built NXP's Yocto (4.9.88 rocko) following the Yocto Project User's Guide.
My board is based on iMX6ULL EVK and it has Ethernet interface, but in /etc/network/ there is no "interfaces" file so i can't set up static IP and wifi.
How can I enable networking in yocto environment?
Thank you very much.
Andrea
Solved! Go to Solution.
Hi Andrea Compagni,
One can follow these steps to assign Static IP. Follow below commands in your Board's Console.
Create file named wireless.network in path "/etc/systemd/network/" with below data.
[match]
Name=eth0
[Network]
Address=<ip address/mask>
Gateway=<gateway address>
Let us know if you still do not get static ip after following above steps.
Regards,
Radhika Somaiya.
Hi Andrea Compagni,
One can follow these steps to assign Static IP. Follow below commands in your Board's Console.
Create file named wireless.network in path "/etc/systemd/network/" with below data.
[match]
Name=eth0
[Network]
Address=<ip address/mask>
Gateway=<gateway address>
Let us know if you still do not get static ip after following above steps.
Regards,
Radhika Somaiya.
Is it possible to do the same for usb configured as cdc? what changes should be made in that .network file?
Hello,
thank you for your answer.
I've checked, I have installed only ifupdown.
I have also included in /mylayer/recipes-core/init-ifupdown/init-ifupdown-1.0.bbappend which should modify interfaces file through /mylayer/recipes-core/init-ifupdown/init-ifupdown-1.0/interfaces, but nothing happens.
Still no /etc/network/interfaces file
If I install NetworkManager packet and I follow your suggestion this is what I get:
nmcli device show
GENERAL.DEVICE: eth1
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 6E:6F:A6:5B:07:8C
GENERAL.MTU: 1500
GENERAL.STATE: 20 (unavailable)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
WIRED-PROPERTIES.CARRIER: off
GENERAL.DEVICE: can0
GENERAL.TYPE: can
GENERAL.HWADDR:
GENERAL.MTU: 16
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.GATEWAY:
IP6.GATEWAY:
GENERAL.DEVICE: can1
GENERAL.TYPE: can
GENERAL.HWADDR:
GENERAL.MTU: 16
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.GATEWAY:
IP6.GATEWAY:
GENERAL.DEVICE: eth0
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 92:02:94:A6:2C:43
GENERAL.MTU: 1500
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
WIRED-PROPERTIES.CARRIER: off
IP4.GATEWAY:
IP6.GATEWAY:
GENERAL.DEVICE: sit0
GENERAL.TYPE: iptunnel
GENERAL.HWADDR: (unknown)
GENERAL.MTU: 1480
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.GATEWAY:
IP6.GATEWAY:
GENERAL.DEVICE: lo
GENERAL.TYPE: loopback
GENERAL.HWADDR: 00:00:00:00:00:00
GENERAL.MTU: 65536
GENERAL.STATE: 10 (unmanaged)
GENERAL.CONNECTION: --
GENERAL.CON-PATH: --
IP4.ADDRESS[1]: 127.0.0.1/8
IP4.GATEWAY:
IP6.ADDRESS[1]: ::1/128
I really can't understand...
Thank you
Andrea
That is weird. Does your network interface work when you assign ip address using ifconfig? For example:
ifconfig eth0 up
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
You could also try manually copying the interfaces file in the following link under /etc/network/ and see if it works: https://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-core/init-ifupdown/init-ifupdown-1.0/i...
You may have NetworkManager or connman installed instead of ifupdown. In that case you can use nmcli/nmtui or connmanctl to configure network interfaces.