Discussion:
[yocto] dhcp eth0 network
Peter Balazovic
2017-05-12 16:01:33 UTC
Permalink
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.
Trevor Woerner
2017-05-12 19:32:17 UTC
Permalink
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto
--
peter@gmail.com
2017-05-12 19:34:31 UTC
Permalink
I build on i.mx (NXP) machine, I want to get configured as dhcp (no
static)...

------ Original Message ------
From: "Trevor Woerner" <***@gmail.com>
To: "Peter Balazovic" <***@gmail.com>
Cc: "Yocto list discussion" <***@yoctoproject.org>
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto
--
Trevor Woerner
2017-05-12 19:55:53 UTC
Permalink
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 board are you using? There are dozens of them.

Best regards,
Trevor
Post by ***@gmail.com
I build on i.mx (NXP) machine, I want to get configured as dhcp (no
static)...
------ Original Message ------
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto
--
Peter Balazovic
2017-05-13 09:25:57 UTC
Permalink
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.

***@imx6qpsabreauto:~# ifconfig eth0 10.171.88.8 netmask 255.0.0.0 up
***@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)

***@imx6qpsabreauto:~#

within /etc/network directory

***@imx6qpsabreauto:/etc/network# ls
if-down.d if-post-down.d if-pre-up.d if-up.d interfaces
***@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
Post by Trevor Woerner
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 board are you using? There are dozens of them.
Best regards,
Trevor
Post by ***@gmail.com
I build on i.mx (NXP) machine, I want to get configured as dhcp (no
static)...
------ Original Message ------
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto
Drew Moseley
2017-05-13 17:27:03 UTC
Permalink
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
Post by Peter Balazovic
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.
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)
within /etc/network directory
if-down.d if-post-down.d if-pre-up.d if-up.d 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
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
I build on i.mx <http://i.mx/> (NXP) machine, I want to get configured as dhcp (no
static)...
------ Original Message ------
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto <https://lists.yoctoproject.org/listinfo/yocto>
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
gmail.com
2017-05-13 17:59:24 UTC
Permalink
Post by Drew Moseley
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.
Post by Drew Moseley
Post by Peter Balazovic
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
after reset eth0 is not up and I do always
Post by Drew Moseley
Post by Peter Balazovic
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" <***@moseleynet.net>
To: "Peter Balazovic" <***@gmail.com>
Cc: "Yocto list discussion" <***@yoctoproject.org>
Sent: 5/13/2017 7:27:03 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Drew Moseley
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
Post by Peter Balazovic
On May 13, 2017, at 5:25 AM, Peter Balazovic
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.
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)
within /etc/network directory
if-down.d if-post-down.d if-pre-up.d if-up.d 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
Post by Trevor Woerner
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 board are you using? There are dozens of them.
Best regards,
Trevor
Post by ***@gmail.com
I build on i.mx (NXP) machine, I want to get configured as dhcp
(no
Post by ***@gmail.com
static)...
------ Original Message ------
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
Hi Peter,
For what MACHINE are you building? What's your target hardware?
Can
Post by ***@gmail.com
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow
enabled &
Post by ***@gmail.com
Post by Trevor Woerner
Post by Peter Balazovic
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto
<https://lists.yoctoproject.org/listinfo/yocto>
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto
Drew Moseley
2017-05-15 14:15:15 UTC
Permalink
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
Post by gmail.com
Post by Drew Moseley
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.
Post by Drew Moseley
Post by Peter Balazovic
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
after reset eth0 is not up and I do always
Post by Drew Moseley
Post by Peter Balazovic
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 ------
Sent: 5/13/2017 7:27:03 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Drew Moseley
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
Post by Peter Balazovic
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.
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)
within /etc/network directory
if-down.d if-post-down.d if-pre-up.d if-up.d 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
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
I build on i.mx <http://i.mx/> (NXP) machine, I want to get configured as dhcp (no
static)...
------ Original Message ------
Sent: 5/12/2017 9:32:17 PM
Subject: Re: [yocto] dhcp eth0 network
Post by Trevor Woerner
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
Post by Peter Balazovic
Dears,
I got Yocto image and unfortunatelly network is not somehow enabled &
proprely configured. After "ifconfig" no eth0 configured.
Post by Peter Balazovic
ifconfig
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
....
Post by Peter Balazovic
/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
https://lists.yoctoproject.org/listinfo/yocto <https://lists.yoctoproject.org/listinfo/yocto>
--
_______________________________________________
yocto mailing list
https://lists.yoctoproject.org/listinfo/yocto <https://lists.yoctoproject.org/listinfo/yocto>
Continue reading on narkive:
Loading...