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.

TMDSICE3359: Lost network config when cable is disconnected

Part Number: TMDSICE3359

Hello,

I have a problem. I use linux for develop and last sdk.

When in set a ip adress with ifconfig eth0 for example (ifconfig eth0 192.168.1.12) and I disconnect ethernet cable the ip adress is lost.

I must set again.

I test with static adress in /etc/network/interface but Don't work better. With static adress I have to force ifdown and ifup for re-activate ip.

For my appli i need than network config stay set.

When I set prp or hsr I Don't have the problem. ifconfig prp0 for example stay set after cable disconnect.  

  • Hello Mehdi,

    Do you need a known IP address? (e.g., set a static IP address?) Or does your use case require getting your address from somewhere else, like a DHCP server?

    Regards,

    Nick

  • Hi Nick,

    I don't use server DHCP. I use static address. DHCP is disable, on my network each equipment is setted manually.

    When I set IP address with for example ifconfig  eth0 192.168.1.2

    eth0      Link encap:Ethernet  HWaddr C4:F3:12:F8:AD:83

              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::c6f3:12ff:fef8:ad83/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:46 errors:0 dropped:43 overruns:0 frame:0
              TX packets:56 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:2769 (2.7 KiB)  TX bytes:10578 (10.3 KiB)

    I disconnect and connect ethernet cable. ifconfig eth0 give :

    eth0      Link encap:Ethernet  HWaddr C4:F3:12:F8:AD:83
              inet6 addr: fe80::c6f3:12ff:fef8:ad83/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:160 errors:0 dropped:149 overruns:0 frame:0
              TX packets:128 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:9633 (9.4 KiB)  TX bytes:22453 (21.9 KiB)

    I lost ip address.

    Regards,

    Mehdi       

  • Hello Mehdi,

    There are several ways to set a static IP address. The first options that come to mind:

    using systemD: 

    See Schuyler's answer in post Static IP address configuration.

    In uboot command line: 

    I use the following commands to set the static IP address on my EVM's NFS setup. You could probably do something like this to set your static IP (look specifically at ip_method and ipaddr):

    setenv serverip 192.168.1.100
    setenv rootpath /nfs/linkName
    setenv bootfile zImage
    setenv ip_method manual
    setenv ipaddr 192.168.1.140 (whatever you want the board's static IP address to be)
    setenv nfs_bootfile 'nfs ${loadaddr} ${serverip}:${rootpath}${bootdir}/${bootfile}'
    setenv nfs_fdtfile 'nfs ${fdtaddr} ${serverip}:${rootpath}${bootdir}/${fdtfile}'
    setenv netargs 'setenv bootargs console=${console} ${optargs} root=/dev/nfs nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=${ipaddr}:::::eth0'
    setenv nfsopts 'nolock,nfsvers=3'
    setenv bootcmd 'setenv autoload no; run nfs_bootfile; run findfdt; run nfs_fdtfile; run netargs; bootz ${loadaddr} - ${fdtaddr}'
    note: removed dhcp from default bootcmd
    
    then saveenv

    Regards,

    Nick

  • I Nick,

    I have no problem for set static ip address.

    My problem is when I disconnect ethernet cable the config network is lost and i must set again.

    Regards,

    Mehdi 

  • Mehdi,

    Both of the methods I mentioned should give you a persistent static IP address. (i.e., the IP address will remain even if you lose network connectivity). Please give one of them a try.

    Regards,

    Nick

  • I Nick,

    I don't work.

    I test with U-BOOT, I modified this env var :

    static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off

    I have modified for :

    set static_ip ${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::on

    set ipaddr 192.168.1.10

    saveenv 

    When I reboot, the ip adresse is Always not configured (eth0 and eth1).

    I test with systemd but i don't understand if i must modified :

    /lib/systemd/system/systemd-networkd.service  (comment #ExecStart=/lib/systemd/systemd-networkd and add ExecStart= ExecStart=/sbin/ifup eth1)    or

    /etc/systemd/network/01-eth-static.network. or

    /etc/network/interface or all

    Thanks for help

  • Hello mehdi,

    UBOOT

    I am not going to have time to run experiments on this for a while, so you will need to try out different combinations yourself. One obvious issue is that you are not setting ip_method like in my example. Please take another look at my template and run some more experiments.

    SYSTEMD 

    Please try to follow Schuyler's steps exactly and see if they work. e.g., modify /etc/systemd/network/01-eth-static.network

    Regards,

    Nick

  • Hello Nick,
    I have an issu.
    UBOOT :
    Now all is ok.
    setenv ip_method manual
    setenv ipaddr 192.168.1.10
    saveenv
    When I disconnect and connect the Ethernet câble the IP address of eth0 stay set.
    SYSTEMD (without ip_method and ipaddr in UBOOT) 
     
    In my case, i modifie the file : /etc/systemd/network/10-eth-static.network
    [Match]
    Name=eth0
    KernelCommandLine=!root=/dev/nfs
    [Network]
    Address=192.168.1.10
    Broadcast=192.168.1.255
    Netmask=255.255.255.0
    Gateway=192.168.1.1
    After i have reload the file with systemd.
    systemctl restart systemd-networkd 
    When I disconnect and connect the Ethernet câble the IP address of eth0 stay set.
    Thanks for your help.
    Regards,
    Mehdi