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 13 Nov 2012 07:59 AM by  richard.laborde@logicpd.com
The router is not configured with wifi fixed address
 5 Replies
Sort:
You are not authorized to post a reply.
Author Messages
jduran@gem-med.com
New Member
New Member
Posts:79


--
05 Nov 2012 07:36 AM
    Dear all,

    In the BSP Linux, I've found an uncommon behavior running on the DM3730 torpedo module: if the IP address of the wlan0 interface is set fixed, then the router of this interface is not configured. This doesn't happen when the interface is configured using dhcp.

    Here is the execution:

    Current interfaces and route table

    $ ifconfig
    eth0 Link encap:Ethernet HWaddr BA:DE:F8:05:E9:BA
    inet addr:192.168.1.189 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:37807 errors:0 dropped:0 overruns:0 frame:0
    TX packets:3225 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:4714551 (4.4 MiB) TX bytes:671081 (655.3 KiB)
    Interrupt:33

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    UP LOOPBACK RUNNING MTU:16436 Metric:1
    RX packets:28 errors:0 dropped:0 overruns:0 frame:0
    TX packets:28 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:2856 (2.7 KiB) TX bytes:2856 (2.7 KiB)

    $ route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0


    Configuring the wifi interface with DHCP

    - Interface file:

    auto lo
    iface lo inet loopback

    iface eth0 inet dhcp
    iface wlan0 inet dhcp


    - Enable wlan interface

    $/etc/rc.d/init.d/network-wifi-station start


    - Interfaces and routes:

    $ ifconfig wlan0
    wlan0 Link encap:Ethernet HWaddr 00:08:EE:06:02:55
    inet addr:192.168.1.65 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:133 errors:0 dropped:0 overruns:0 frame:0
    TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:10524 (10.2 KiB) TX bytes:7154 (6.9 KiB)
    $route -n
    route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 wlan0
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0


    The router 192.168.1.254 has been added (OK).

    Configuring the wifi interface with fixed IP address

    - Interface file:

    # The loopback interface
    auto lo
    iface lo inet loopback

    iface eth0 inet dhcp
    iface eth1 inet dhcp

    iface wlan0 inet static
    address 192.168.1.195
    netmask 255.255.255.0
    gateway 192.168.1.254


    - Enable wlan interface

    $/etc/rc.d/init.d/network-wifi-station start


    - Interfaces and routes:

    $ ifconfig wlan0
    wlan0 Link encap:Ethernet HWaddr 00:08:EE:06:02:55
    inet addr:192.168.1.195 Bcast:0.0.0.0 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:138 errors:0 dropped:0 overruns:0 frame:0
    TX packets:32 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:10734 (10.4 KiB) TX bytes:7464 (7.2 KiB)

    route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0


    Configuring a fixed address, the Ip address has been set, but not the router address.

    Thanks and Best Regards,
    Joaquim Duran
    richard.laborde@logicpd.com
    Basic Member
    Basic Member
    Posts:247


    --
    05 Nov 2012 08:33 AM
    Joaquim,

    Try this experiment using a static ip. Once you see the routing table without the gateway, then ping the gateway. Assuming a successful ping, then view the routing table again. I am guessing you will see the gateway in the table.

    The routing table is populated either using "Dynamic Routing" (kernel figures it out on the fly), or "Static Routing" (user uses the route command to add a unique route).

    I suspect the routing table is being populated automatically when using the DHCP, because with DHCP the kernel has to talk on the network to get the IP address. Whereas using a static IP, no network activity occurs, and the kernel has not had an opportunity to automatically find the gateway. I believe if you tell the kernel to talk on the network (using ping), the kernel will talk on the network and automatically find the gateway.

    Setting up a static IP doesn't necessarily setup up the routing table.
    Thanks

    Richard
    jduran@gem-med.com
    New Member
    New Member
    Posts:79


    --
    05 Nov 2012 09:11 AM
    Richard,

    The experiment has not been successful: no router has been added.

    > Setting up a static IP doesn't necessarily setup up the routing table.

    This depends on the commands that are used to configure the interface. Using the ifconfig command, only the interface is configured so the route should be configured using route command. However using ifup and ifdown command (and configuring the interfaces in /etc/network/interfaces file) the ip address of the interface and the router table are configured. (http://www.cyberciti.biz/...rk-interfaces-file/)

    Joaquim Duran
    jduran@gem-med.com
    New Member
    New Member
    Posts:79


    --
    06 Nov 2012 01:57 AM
    Dear all,

    I've investigated about the problem. I've modified the script /etc/rc.d/init.d/network-wifi-station to get verbose output from ifup command. When activating the wlan0 interface with a fixed address, the commands executed are:


    # /etc/rc.d/init.d/network-wifi-station start
    Importing configuration variables from /etc/rc.d/rc.conf
    loading wl12xx_sdio
    Starting wpa_supplicant:
    Bouncing WiFi interface (workaround).
    run-parts /etc/network/if-pre-up.d
    ip addr add 192.168.2.5/24 dev wlan0 label wlan0
    ip link set wlan0 up
    ip route add default via 192.168.2.254 dev wlan0
    ip: RTNETLINK answers: File exists


    You see that the 'ip route add' command fails, because it add the default gateway. The following command should be executed:


    ip route add 0.0.0.0 via 192.168.2.254 dev wlan0


    Next, I add the execution of the command:


    DM-37x# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
    DM-37x# ip route add 0.0.0.0 via 192.168.2.254 dev wlan0
    DM-37x# route -n
    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    0.0.0.0 192.168.2.254 255.255.255.255 UGH 0 0 0 wlan0
    0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0
    127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
    192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
    192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0


    To fix this problem is easy: replace in ifup command the 'default' gateway for '0.0.0.0'.

    A patch to fix this problem could be added to the BSP?

    Joaquim Duran
    jduran@gem-med.com
    New Member
    New Member
    Posts:79


    --
    13 Nov 2012 03:33 AM
    Could you confirm if this issue is going to be fixed or not?

    Joaquim Duran
    richard.laborde@logicpd.com
    Basic Member
    Basic Member
    Posts:247


    --
    13 Nov 2012 07:59 AM
    It is currently listed in our JIRA system to be fixed in future releases.
    Thanks
    You are not authorized to post a reply.