Search

Technical Discussion Group Forum

This forum is provided for user discussion. While Beacon EmbeddedWorks support staff and engineers participate, Beacon EmbeddedWorks does not guarantee the accuracy of all information within in the Technical Discussion Group (TDG).

The "Articles" forums provide brief Articles written by Beacon EmbeddedWorks engineers that address the most frequently asked technical questions.

To receive email notifications when updates are posted for a Beacon EmbeddedWorks product download, please subscribe to the TDG Forum of interest.

TDG Forum

PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 25 Nov 2013 02:01 PM by  Servo R.
Booting with Static IP
 13 Replies
Sort:
You are not authorized to post a reply.
Author Messages
steven.eckhoff
Basic Member
Basic Member
Posts:192


--
11 Nov 2013 01:16 PM
    Q: How do I configure my system to boot with a static IP?

    A: Sections 4.5.1.2 and 4.5.1.3 cover this topic. In short this is how you can configure your system with a static IP

    setenv otherbootargs ${otherbootargs} ip=ip-address::gateway-address:netmask:::
    saveenv
    reset
    jduran.gm
    New Member
    New Member
    Posts:79


    --
    12 Nov 2013 02:50 AM
    If it could be of help,. I usually configure the fixed IP from BSP (./ltib -c):
    1 - Select 'Target System Configuration / Options'
    2 - Select 'Start netwroking'
    3 - Select 'Network setup'
    and then configure the parameters of the eth0 interface.

    Joaquim Duran
    steven.eckhoff
    Basic Member
    Basic Member
    Posts:192


    --
    12 Nov 2013 11:15 AM

    jduran,

    That is another way of doing it. 

    Thanks,

    steven.eckhoff
    Basic Member
    Basic Member
    Posts:192


    --
    12 Nov 2013 02:40 PM
    For the second method, using LTIB, you can also configure the net parameters from the Linux command line by doing the following:

    vi /etc/rc.d/rc.conf

    Now search for the following section in the rc.conf file and change each variable to the desired values

    # net interface 0
    export SYSCFG_IFACE0=y
    export INTERFACE0="eth0"
    export IPADDR0="192.168.120.166"
    export NETMASK0="255.255.255.0"
    export BROADCAST0="192.168.120.255"
    export GATEWAY0="192.168.120.1"
    export NAMESERVER0="192.168.120.1"
    steven.eckhoff
    Basic Member
    Basic Member
    Posts:192


    --
    15 Nov 2013 09:11 AM
    Q:

     
    We have tested the following script and it still does not work.
    
    vi /etc/rc.d/rc.conf
    
    # net interface 0
    export SYSCFG_IFACE0=y
    export INTERFACE0="eth0"
    export IPADDR0="192.168.2.3"
    export NETMASK0="255.255.255.0"
    export BROADCAST0="192.168.2.255"
    export GATEWAY0="192.168.2.1"
    export NAMESERVER0="192.168.2.1"
    


    A: Have you first tried to do the steps outlined by jduran? Also, are you using a ramdisk? This morning I verified that this works on my board. I am able to modify the values under "net interface 0 " and after rebooting the board the ip address is updated.
    Servo R.
    New Member
    New Member
    Posts:6


    --
    18 Nov 2013 02:16 PM
    Hi,

    I run through step outlined by jduran once again. Here is was I do:

    1) I configure static IP.... The filesystem type is: ext2.gz ramdisk.
    2) I copy to my SD card with "sudo cp -r --preserve=all rootfs/* /media/ROOTFS/"
    3) Boot board: ifconfig show "171.0.0.1".
    4) I read /etc/rc.d/rc.conf:
    # net interface 0
    export SYSCFG_IFACE0=y
    export INTERFACE0="eth0"
    export IPADDR0="192.168.2.5"
    export NETMASK0="255.255.255.0"
    export BROADCAST0="192.168.2.255"
    export GATEWAY0="192.168.2.1"
    export NAMESERVER0="192.168.2.1"
    Servo R.
    New Member
    New Member
    Posts:6


    --
    18 Nov 2013 02:34 PM

     Sorry my bad, boot address is 171.0.0.0

    jduran.gm
    New Member
    New Member
    Posts:79


    --
    19 Nov 2013 02:54 AM
    Servo,

    I would like to do several comments:

    1 - You're modifying the configure of a ramdisk. To test it is OK, but it is not permanent. When you reboot the current configuration will be lost.

    2 - To do the configuration permanent, use procedure defined by Steven in comment 1, or my own in comment 2.

    3 - In comment 3, Steven has forgotten an step to configure the IP address. That is, you should edit the file but also you should apply the configuration that is, execute the commands:

    # /etc/rc.d/init.d/network restart

    NOTE: you should edit the network script to fix the name of the configuration file (already reported to LogicPD), reboot the board or execute the commands:

    # . /etc/rc.d/rc.local
    # /etc/rc.d/init.d/network restart

    Thanks and Best Regards,
    Joaquim Duran
    Servo R.
    New Member
    New Member
    Posts:6


    --
    19 Nov 2013 08:12 AM
    Posted By jduran.gm on 19 Nov 2013 02:54 AM
    Servo,

    I would like to do several comments:

    1 - You're modifying the configure of a ramdisk. To test it is OK, but it is not permanent. When you reboot the current configuration will be lost.

    --> ltib is configure as a ramdisk but I copy rootfs to an SD card. When I edit a file, file modification is keep....
    2 - To do the configuration permanent, use procedure defined by Steven in comment 1, or my own in comment 2.

    --> Your post refer to an IP setup in uBoot. We want an ''end User'' to be able to set a static IP address and at next boot up, the eth0 will be configured automatically using that IP fix address.
    3 - In comment 3, Steven has forgotten an step to configure the IP address. That is, you should edit the file but also you should apply the configuration that is, execute the commands:

    # /etc/rc.d/init.d/network restart

    NOTE: you should edit the network script to fix the name of the configuration file (already reported to LogicPD), reboot the board or execute the commands:

    # . /etc/rc.d/rc.local
    # /etc/rc.d/init.d/network restart

    --> So the only way to configure correctly the ip address is to reset network service? Even on boot your rc.conf file is not read?
    Thanks and Best Regards,
    Joaquim Duran


    jduran.gm
    New Member
    New Member
    Posts:79


    --
    19 Nov 2013 08:30 AM
    --> So the only way to configure correctly the ip address is to reset network service? Even on boot your rc.conf file is not read?

    If you want apply the changes to the network configuration, introduced in the rc.d file, without rebooting the board, then you need to restart the network service. If in the BSP you've configured to start the network service at boot time, when linux boots the configuration of the rc.conf file is read and the interfaces specified in rc.d are configured properly.

    Joaquim Duran
    steven.eckhoff
    Basic Member
    Basic Member
    Posts:192


    --
    19 Nov 2013 08:56 AM
    Thanks jduran,

    What you have suggested is correct. If ServoRobot is using a ramdisk then they will need to restart so the modified configuration file is read. On reboot everything will be lost. I tested this using yaffs, so my configuration was persistent and the ip updated on reboot.
    Servo R.
    New Member
    New Member
    Posts:6


    --
    19 Nov 2013 09:50 AM
    Thank.

    I thing your not understanding the problems I've got. My file is persistant. In my case, rc.conf seem not to be read on boot.

    If I configure my IP from ltib, rc.conf is generated . I copy rc.conf on my SD card. When I boot, network configuration is ignored. IP address is 171.0.0.0. Then, I have to restart network service to read rc.conf.

    What can be wrong? I did not edit any of the booting script except /etc/rc.d/init.d/network to read /etc/rc.d/rc.conf.
    jduran.gm
    New Member
    New Member
    Posts:79


    --
    20 Nov 2013 02:48 AM
    Servo,

    Could you check if the option 'start networking' is enabled in the BSP configuration? It is placed in the menu of 'Taget system configurations'.

    Joaquim Duran
    Servo R.
    New Member
    New Member
    Posts:6


    --
    25 Nov 2013 02:01 PM
    Thank for your answer.
    CONFIG_SYSCFG_START_NETWORK was not set. I was only configuring CONFIG_SYSCFG_IFACE0=Y.

    Just be aware that /etc/rc.d/rc.conf must match what is in /etc/network/interfaces. If not, you will get different behaviour in the following case:
    - ifdown eth0; ifup eth0 --> read /etc/network/interfaces
    - /etc/rc.d/init.d/network restart --> read /etc/rc.d/rc.conf
    You are not authorized to post a reply.