This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: Static IP for both Ethernet ports

Part Number: AM5728


Tool/software: Linux

My board is AM5728 EVM and kernel version is 4.9.105-ti-rt-r113.

am57xx-cl-som-am57x.dts has dual_emac mode. ( mac, cpsw_emac0, cpsw_emac1)

I want to give each of static IP to them. 

I was edit /etc/network/interfaces file like below.

auto eth0
iface eth0 inet static
address 192.168.0.94
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

auto eth1
iface eth1 inet static
address 192.168.0.97
netmask 255.255.255.0
broadcast 192.168.0.255
gateway 192.168.0.1

I was referenced "https://e2e.ti.com/support/arm/automotive_processors/f/1020/p/556130/2035119"

When the board boots, the error log came out as below.

[FAILED] Failed to start Raise network interfaces.
See 'systemctl status networking.service' for details.

● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor prese
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: failed (Result: exit-code) since Thu 2016-02-11 16:28:01 UTC; 2 years
Docs: man:interfaces(5)
Process: 272 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1
Process: 264 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [
Main PID: 272 (code=exited, status=1/FAILURE)

Feb 11 16:28:01 arm systemd[1]: Starting Raise network interfaces...
Feb 11 16:28:01 arm sh[264]: /etc/network/interfaces:4: misplaced option
Feb 11 16:28:01 arm sh[264]: ifquery: couldn't read interfaces file "/etc/networ
Feb 11 16:28:01 arm ifup[272]: /etc/network/interfaces:4: misplaced option
Feb 11 16:28:01 arm ifup[272]: /sbin/ifup: couldn't read interfaces file "/etc/n
Feb 11 16:28:01 arm systemd[1]: networking.service: Main process exited, code=ex
Feb 11 16:28:01 arm systemd[1]: Failed to start Raise network interfaces.
Feb 11 16:28:01 arm systemd[1]: networking.service: Unit entered failed state.
Feb 11 16:28:01 arm systemd[1]: networking.service: Failed with result 'exit-code

My Question.

1. How do i give each of static IP to them?

2. How do I do that Lan automatically get a static IP when Lan reattach physically?

  • Hi,

    SystemD requires additional setup, please review this link and let me know if this solution works for you.

    e2e.ti.com/.../630604

    The link you posted looks like the thread was deleted, I was not able to review it.

    Best Regards,
    Schuyler
  • It doesn't work.
    Lan port doesn't connect with Ethernet.
    I push wrong button "this resolved my issue"  in an accident

  • Hi,
    I tried my suggestion and I was able to get eth0 assigned with a static ip, I only did the single interface though. I used an SD card that was created using the SD card create script that comes with the SDK. The only modification I made was to file system was to the file I mentioned in the earlier post. I would recommend making a new SD card with the create script for debug purposes and try the file method mentioned earlier.

    I also noticed something in the original post concerning ip addresses:

    auto eth0
    iface eth0 inet static
    address 192.168.0.94

    auto eth1
    iface eth1 inet static
    address 192.168.0.97 --> Error, this needs to have a different subnet. Perhaps 192.168.1.97, something other than 0.

    Both interfaces are on the same subnet of 0. Each interface has to have a unique subnet. I would recommend just trying to bring up one interface and prove the static ip assignment on one port with the file method I suggested. Then bring up the other interface but on a different subnet.

    Best Regards,
    Schuyler