eclipse-leda / leda-distro

Eclipse Leda provides a Yocto-based build setup for SDV.EDGE components
https://eclipse-leda.github.io/leda/
Apache License 2.0
14 stars 8 forks source link

enp0s2 IP address is not assigned #55

Closed razr closed 1 year ago

razr commented 1 year ago

Describe the bug an IP address for the enp0s2 is not assigned. Well I'm not even sure why it is enp0s2? It should be eth0

To Reproduce Steps to reproduce the behavior:

  1. ./run-leda.sh
  2. ifconfig enp0s2
    root@qemux86-64:~# ifconfig enp0s2
    enp0s2    Link encap:Ethernet  HWaddr 52:54:00:12:34:02
          inet6 addr: fe80::5054:ff:fe12:3402/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3884 (3.7 KiB)  TX bytes:2418 (2.3 KiB)

Expected behaviour eth0 shall be assigned automatically

Screenshots / Logfiles no

Leda Version (please complete the following information):

Additional context

$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.2 LTS"
mikehaller commented 1 year ago

Thank you for reporting this bug.

We have switched the default Leda network setup to a DHCP-based setup for the ethernet interface, but the run-leda.sh script for qemu has not been updated properly yet.

As a workaround, until this is fixed, you may run a DHCP-daemon on your host, binding to the "tap0" interface (which is the one for qemu) - or manually configure the IP address once the system is booted.

If you are using user-level networking for qemu ("slirp"), qemu would provide the DHCP server already.

The network interface names, whether it is eth0 or enp0s2, is controlled by a kernel parameter. I'll have a look why this is different, but it should not make any difference. The problem is the missing DHCP server on the network or that Leda does not have a local fallback-IP configured in case that there is no DHCP server available.

razr commented 1 year ago

Thanks @mikehaller, I don't want to deal with a local DHCP server, it is not appreciated by any company's IT :) I did the following, and it fixes my problem

root@qemux86-64:~# ifconfig enp0s2 192.168.7.2
root@qemux86-64:~# ip route add default via 192.168.7.2

root@qemux86-64:~# ping 8.8.8.8
64 bytes from 8.8.8.8: seq=0 ttl=115 time=2.322 ms
64 bytes from 8.8.8.8: seq=0 ttl=115 time=2.322 ms
mikehaller commented 1 year ago

Understandable that you don't want to run a DHCP server on the company network. One option may be to bind it only to the tap0 interface, so it wouldn't interfere with the corporate network.

Anyway, setting up static IP is easy enough. We'll see if we can provide the static IP address as a fallback in our quickstart distro, if DHCP is not available.

mikehaller commented 1 year ago

This should be fixed now, as the new runner script will just always use the QEMU SLIRP networking, which includes built-in DHCP.