I think the /etc/network/interfaces file is supported if you are using the busybox udhcpc client but if your configuration uses systemd-networkd or connman, there is a different mechanism. Without more details on your Yocto configuration it is not possible to give a definitive answer. Do you have access to the local.conf and build setup that was used to produce this image?
Drew > On May 13, 2017, at 1:59 PM, gmail.com <[email protected]> wrote: > >> after you manually configure with ifconfig, can you actually connect to >> external devices on the network? > > Yes, I can connect - network works fine with external devices... > > > BTW usually I do changes of "interfaces" file at /etc/network to switch > between DHCP or static IP. > >>> auto lo >>> iface lo inet loopback >>> >>> auto eth0 >>> iface eth0 inet dhcp >> >>> > > after reset eth0 is not up and I do always > >>> ifconfig eth0 10.171.88.8 netmask 255.0.0.0 up > > > So for now I can set static IP and network works fine but I want to have DHCP > and have that configuration permanent. > > > ------ Original Message ------ > From: "Drew Moseley" <[email protected] <mailto:[email protected]>> > To: "Peter Balazovic" <[email protected] > <mailto:[email protected]>> > Cc: "Yocto list discussion" <[email protected] > <mailto:[email protected]>> > Sent: 5/13/2017 7:27:03 PM > Subject: Re: [yocto] dhcp eth0 network > >> Hi Peter, >> >> First question, after you manually configure with ifconfig, can you actually >> connect to external devices on the network? If so that implies that your >> driver is functioning properly and that you really only need to figure out >> how to configure DHCP and automatic configuration. If no connections are >> possible after the manual configuration then the you likely have a driver >> issue. >> >> I played with both sysvinit and systemd based configurations and it seems >> the automatic DHCP addressing is handled slightly differently in these >> environments. >> >> In the case of sysvinit, busybox-udhcpc client is installed and _should_ be >> bringing your interface up automatically. This worked out-of-the-box for me >> with no extra config changes needed. >> >> In the case of systemd, there didn’t seem to be a DHCP client configured in >> the default configuration (for my Beaglebone and Raspberry Pi builds >> anyway). I manually included the connman package in my build and the >> interface was automatically configured. It looks like using the networkd >> PACKAGECONFIG option for the systemd package may be another solution but I >> had mixed results with that; it may require extra config files in >> /etc/systemd/networkd or some such but since connman worked for me I stopped >> investigating. >> >> I’m not sure that’s the best answer and I’d love to hear if there is a >> cleaner solution for getting a DHCP client in a systemd-based configuration >> but it may work to at least get you up and running. Of course this solution >> requires a rebuild of your target image. If your image truly does not have >> a DHCP client installed then you may have to rebuild. >> >> HTH, >> >> Drew >> >>> On May 13, 2017, at 5:25 AM, Peter Balazovic <[email protected] >>> <mailto:[email protected]>> wrote: >>> >>> Hello, >>> >>> Unfortunately I have no knowledge about that how image is built :( I got >>> just that image downloaded which is already built. >>> >>> BUT after applying ifconfig I got network working and connection >>> established... Now I wanna do it permanetly and dhcp instead of static IP. >>> >>> root@imx6qpsabreauto:~# ifconfig eth0 10.171.88.8 netmask 255.0.0.0 up >>> root@imx6qpsabreauto:~# ifconfig >>> eth0 Link encap:Ethernet HWaddr ee:d2:50:0d:f3:33 >>> inet addr:10.171.88.8 Bcast:10.255.255.255 Mask:255.0.0.0 >>> inet6 addr: fe80::ecd2:50ff:fe0d:f333/64 Scope:Link >>> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 >>> RX packets:4447 errors:0 dropped:951 overruns:0 frame:0 >>> TX packets:254 errors:0 dropped:0 overruns:0 carrier:0 >>> collisions:0 txqueuelen:1000 >>> RX bytes:640741 (625.7 KiB) TX bytes:37067 (36.1 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:2000 errors:0 dropped:0 overruns:0 frame:0 >>> TX packets:2000 errors:0 dropped:0 overruns:0 carrier:0 >>> collisions:0 txqueuelen:0 >>> RX bytes:152000 (148.4 KiB) TX bytes:152000 (148.4 KiB) >>> >>> root@imx6qpsabreauto:~# >>> >>> within /etc/network directory >>> >>> root@imx6qpsabreauto:/etc/network# ls >>> if-down.d if-post-down.d if-pre-up.d if-up.d interfaces >>> root@imx6qpsabreauto:/etc/network# vi interfaces >>> >>> auto lo >>> iface lo inet loopback >>> >>> auto eth0 >>> iface eth0 inet dhcp >>> ~ >>> ~ >>> ~ >>> >>> >>> >>> After reset I need to set network again and static ... >>> >>> cheers, >>> Peter >>> >>> >>> >>> On Fri, May 12, 2017 at 9:55 PM, Trevor Woerner <[email protected] >>> <mailto:[email protected]>> wrote: >>> Hi Peter, >>> >>> There isn't enough information here for me to help you. >>> >>> Could you please list the commands and steps you used to build the image? >>> - what repositories are you using? >>> - what branches of those repositories? >>> - if you changed any config files, what did you change? >>> - what command did you run to build your image? >>> - what did bitbake print as your build configuration? >>> >>> Which i.mx <http://i.mx/> board are you using? There are dozens of them. >>> >>> Best regards, >>> Trevor >>> >>> >>> On Fri, May 12, 2017 at 3:34 PM, [email protected] <mailto:[email protected]> >>> <[email protected] <mailto:[email protected]>> wrote: >>> > I build on i.mx <http://i.mx/> (NXP) machine, I want to get configured as >>> > dhcp (no >>> > static)... >>> > >>> > >>> > ------ Original Message ------ >>> > From: "Trevor Woerner" <[email protected] <mailto:[email protected]>> >>> > To: "Peter Balazovic" <[email protected] >>> > <mailto:[email protected]>> >>> > Cc: "Yocto list discussion" <[email protected] >>> > <mailto:[email protected]>> >>> > Sent: 5/12/2017 9:32:17 PM >>> > Subject: Re: [yocto] dhcp eth0 network >>> > >>> >> Hi Peter, >>> >> >>> >> For what MACHINE are you building? What's your target hardware? Can >>> >> you summarize the steps you took to build your image? >>> >> >>> >> What do you want eth0 to do? dhcp or static ip? >>> >> >>> >> Best regards, >>> >> Trevor >>> >> >>> >> >>> >> On Fri, May 12, 2017 at 12:01 PM, Peter Balazovic >>> >> <[email protected] <mailto:[email protected]>> wrote: >>> >>> >>> >>> Dears, >>> >>> >>> >>> I got Yocto image and unfortunatelly network is not somehow enabled & >>> >>> proprely configured. After "ifconfig" no eth0 configured. >>> >>> >>> >>> >>> >>>> ifconfig >>> >>> >>> >>> lo Link encap:Local Loopback >>> >>> inet addr:127.0.0.1 Mask:255.0.0.0 >>> >>> .... >>> >>> >>> >>> >>> >>> >>> >>>> /etc/network >>> >>>> ls >>> >>> >>> >>> if-down.d if-post-down.d if-pre-up.d if-up.d >>> >>> >>> >>> >>> >>> How should I setup "eth0" to get network working properly? >>> >>> >>> >>> Thanks. >>> >>> >>> >>> >>> >>> >>> >>> -- >>> >>> _______________________________________________ >>> >>> yocto mailing list >>> >>> [email protected] <mailto:[email protected]> >>> >>> https://lists.yoctoproject.org/listinfo/yocto >>> >>> <https://lists.yoctoproject.org/listinfo/yocto> >>> >>> >>> > >>> >>> -- >>> _______________________________________________ >>> yocto mailing list >>> [email protected] <mailto:[email protected]> >>> https://lists.yoctoproject.org/listinfo/yocto >>> <https://lists.yoctoproject.org/listinfo/yocto> >>
-- _______________________________________________ yocto mailing list [email protected] https://lists.yoctoproject.org/listinfo/yocto
