Hi all,

I'm trying to using a 4G (WiMAX) dongle (project: gctwimax) on x86 ubuntu.
However, I've found a problem when I'm doing connection with base
station and dhcp server.

The problem is that, when I used udhcpc to request the IP for wimax
interface (wimax0).
The dhcp server will assign the client IP with netmask 255.255.255.255.
The default script will set the IP and the netmask to this interface "wimax0".
However, the kernel won't create a routing entry related to this
interface when we set the netmask as "255.255.255.X" to this
interface.
This behavior leads the next operation of adding default gateway to
the routing table will be failed.

After I've printed the routing control command as debug message.
I've found that when using ifconfig to set the netmask of NIC as
255.255.255.255
won't create an entry in routing table.
That's why configure the default gateway will fail.

I don't remembered set the nemask as 255.255.255.255 to a NIC with ifconfig
won't create an entry in routing table. At least 3G networks works very well.
The dhclient won't have a problem on this situation.
Should we fix the udcpc/default.script to cover this kinde of situation?

The following log is the debug dump of udhcpc/default.script on ubuntu 11.11.

/home/macpaul/vmax# udhcpc -i wimax0 -q
udhcpc (v1.18.4) started
Sending discover...
Sending select for 111.67.56.236...
Lease of 111.67.56.236 obtained, lease time 3600
=== debug: /sbin/ifconfig wimax0 111.67.56.236  netmask 255.255.255.255 ===
/usr/share/udhcpc/default.script: Resetting default routes
=== debug: while /sbin/route del default gw 0.0.0.0 dev wimax0; do :; done ===
SIOCDELRT: no such process
=== debug: /sbin/route add default gw 111.67.48.1 dev wimax0 metric 0 ===
SIOCADDRT: no such process
/usr/share/udhcpc/default.script: Adding DNS 111.67.54.11
/usr/share/udhcpc/default.script: Adding DNS 111.67.54.12


Compared it to dhclient, the dhclient is able to configure the
routeing table correctly.
The routing table after dhcp request by using dhclient will be as follows.

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         111.67.48.1     0.0.0.0         UG    0      0        0 wimax0
111.67.48.1     0.0.0.0         255.255.255.255 UH    0      0        0 wimax0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 br-lan

I have quote some part of the default.script of udhcpc with debug
message I've added as follows.

The default script on ubuntu (11.11)
I've add the debug message before the command introduce problem.
/usr/share/udhcpc/default.script

case $1 in
   bound|renew)
       [ -n "$broadcast" ] && BROADCAST="broadcast $broadcast"
       [ -n "$subnet" ] && NETMASK="netmask $subnet"

# print the command as debug message
# where $NETMASK == 255.255.255.255 cannot add routing entry
# related to the interface.
       echo "/sbin/ifconfig $interface $ip $BROADCAST $NETMASK";
       /sbin/ifconfig $interface $ip $BROADCAST $NETMASK

       if [ -n "$router" ]; then
           echo "$0: Resetting default routes"
# print the command as debug message
# Adding default route will fail if the routing entry
# of this interface hasn't been added to kernel
               echo "while /sbin/route del default gw 0.0.0.0 dev
$interface; do :; done"
           while /sbin/route del default gw 0.0.0.0 dev $interface; do :; done

           metric=0
           for i in $router; do
# print the command as debug message
               echo "/sbin/route add default gw $i dev $interface
metric $metric";
               /sbin/route add default gw $i dev $interface metric $metric
               metric=$(($metric + 1))
           done
       fi

Would you please help fixing this problem?
Thanks!

-- 
Best regards,
Macpaul Lin

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to