0

In my root file system, I can see that I have a directory /sys/class/net/eth0/.

However, I want to create another interface /sys/class/net/eth1 and /sys/class/net/eth2.

How can I do so?

I am using Embedded system - Yocto kernel version 4.12?

$ ls /etc/network/
if-down.d       if-post-down.d  if-pre-up.d


$ sudo ifconfig eth1 0.0.0.0 up
Password: 
SIOCSIFADDR: No such device
eth1: ERROR while getting interface flags: No such device
eth1: ERROR while getting interface flags: No such device
Bart
  • 2,221
  • 2
    ifconfig doesn't create a device, it configures a device that already exists - i.e. the hardware is installed and the driver is loaded and has detected the HW (note: some network devices, such as dummy, tun, tap, bridge have & require drivers but don't need or aren't tied to specific HW) – cas Aug 08 '19 at 01:34
  • does it mean that if I don't see /sys/class/net/eth2 then it is probably due to the device driver missing? – kurramkurram D Aug 08 '19 at 01:38
  • 1
    possibly. or it might mean that if a 2nd NIC has been found, it has been given a different name - like ens1 or enp3s0. you can find the names of known NICs with ls -l /sys/class/net/ or cat /proc/net/dev – cas Aug 08 '19 at 01:42
  • The cat /proc/net/dev just shows lo and eth0. Also, the -ls -l /sys/class/net shows etho and lo. I am expecting them to show eth0, eth1 and eth2 – kurramkurram D Aug 08 '19 at 01:48
  • What hardware are the missing devices, and how are they connected? – Timothy Baldwin Aug 08 '19 at 02:03
  • I can see that the respective drivers are there. – kurramkurram D Aug 08 '19 at 05:32
  • 1
    How exactly can you see that the respective drivers are there? Please edit your question with that information. Also include information about the brand, model, kind (PCI? USB?) of hardware you are missing. What does dmesg say after boot about picking up and initializing the hardware? Any errors? – dirkt Aug 08 '19 at 07:31
  • May be this post will help you https://unix.stackexchange.com/questions/152331/how-can-i-create-a-virtual-ethernet-interface-on-a-machine-without-a-physical-ad – camp0 Aug 08 '19 at 08:05

0 Answers0