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.

PSDKLA 3.00: eth1 static IP address config on Vayu ES 2.0 EVM

I've Vayu ES 2.0 Infotainment EVM running PSDKLA 3.0 and I need to set eth1 for static IP address. I modified /etc/network/interfaces as below

iface eth1 inet static
	address 192.168.1.80 
	netmask 255.255.255.0
	gateway 192.168.1.1

However, it still gets dhcp address after reboot. Am I missing something or is there any other file that I need to modify to make this static IP address?


Thanks,

Kaushal

  • Hi Kaushal,

    Check your u-boot arguments. Check for u-boot environment ipaddr. See also if the below wiki will be in help:

    processors.wiki.ti.com/.../TI81XX_PSP_UBOOT_User_Guide
    processors.wiki.ti.com/.../TI81XX_PSP_User_Guide

    Regards,
    Pavel
  • Hi Kaushal,

    In addition to Pavel's comment.

    If you run ifup eth1 linux will take your configurations from /etc/network/interfaces. Without running ifup eth1, the systemd will disregard the /etc/network/interfaces settings.  

    Latest processor SDKs use systemd. So from user space you need to change the network service configuration.

    I. You could:

     1. Stop the dhcp  from /lib/systemd/network/80-container-host0.network, i.e.:

         #  This file is part of systemd.                                                                                                                        

         #                                                                                                                                                        

         #  systemd is free software; you can redistribute it and/or modify it                                                                                    

         #  under the terms of the GNU Lesser General Public License as published by                                                                              

         #  the Free Software Foundation; either version 2.1 of the License, or                                                                                  

         #  (at your option) any later version.                                                                                                                  

         [Match]                                                                                                                                                  

         Virtualization=container                                                                                                                                

          Name=host0                                                                                                                                              

         [Network]                                                                                                                                                

         #DHCP=yes                               /*THE DEFAULT FILE has this set to YES, so comment this line*/                                                                                                                           

          LinkLocalAddressing=yes                                                                                                                                  

         #[DHCP]                                       /*THE DEFAULT FILE has this  setting, so COMMENT this line*/                                                                                                   #UseTimezone=yes                  /*THE DEFAULT FILE has this set to YES, so comment this line*/      

      2. Modify the /lib/systemd/system/systemd-networkd.service file:

    [Service]                                                                                                                                                

    Type=notify                                                                                                                                              

    Restart=on-failure                                                                                                                                      

    RestartSec=0                                                                                                                                                                                                                                                                    

    #ExecStart=/lib/systemd/systemd-networkd                                          /*The default configuration has this enabled. COMMENT IT*/                  

    ExecStart= ExecStart=/sbin/ifup eth1                                                    /*Add this line so that systemd runs ifup upon board boot*/                            

    CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_BROADCAST CAP_NET_RAW CAP_SETUID CAP_SETGID CAP_SETPCAP CAP_CHOWN CAP_DAC_OVERRIDE CAP_R

    ProtectSystem=full                                                                                                                                      

    ProtectHome=yes                                                                                                                                          

    WatchdogSec=3min                            

    This should setup your static IP and won't override it upon board reboot. 

    II. Another approach is to add another systemd service, which runs the /sbin/ifup command on startup. This way your OS will take your static IP settings. See this thread for details on how to write systemd service: 

     

    In similar manner add a custom .service file, which has: 
     ExecStart=/sbin/ifup eth1 

    and enable it with systemctl enable. 

    Best Regards, 
    Yordan