[Galaxy S II Q&A, Help & Troubleshooting] franjorge:
WIFI DHCP problem?

Sorry if this has been asked before, but I cannot find any reference and search is temporarily unavailable on xda.

I am experiencing the following behavior with siyah 5.0.1. The phone connects to the WIFI AP without any problem, it even gets an IP address, DNS servers, ... but it has no connectivity even to the hosts in the same subnet:

ip address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN
link/sit 0.0.0.0 brd 0.0.0.0
3: ip6tnl0: <NOARP> mtu 1452 qdisc noop state DOWN
link/tunnel6 :: brd ::
4: rmnet0: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 1000
link/ppp
5: rmnet1: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 1000
link/ppp
6: rmnet2: <POINTOPOINT,MULTICAST,NOARP> mtu 1500 qdisc noop state DOWN qlen 1000
link/ppp
17: p2p0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1
link/ether 00:90:4c:33:22:11 brd ff:ff:ff:ff:ff:ff
inet6 fe80::290:4cff:fe33:2211/64 scope link
valid_lft forever preferred_lft forever
18: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 14:7d:c5:43:60:e5 brd ff:ff:ff:ff:ff:ff
inet 10.152.86.18/22 brd 10.152.87.255 scope global wlan0
inet6 fe80::167d:c5ff:fe43:60e5/64 scope link
valid_lft forever preferred_lft forever

Routes seem OK

~ # ip route show
ip route show
default via 10.152.87.254 dev wlan0
default via 10.152.87.254 dev wlan0 metric 318
10.152.84.0/22 dev wlan0 proto kernel scope link src 10.152.86.18 metric 318
10.152.87.254 dev wlan0 scope link

However ping to the default gateway is not working.

~ # ping 10.152.87.254
ping 10.152.87.254
PING 10.152.87.254 (10.152.87.254) 56(84) bytes of data.
From 10.152.86.18 icmp_seq=2 Destination Host Unreachable
From 10.152.86.18 icmp_seq=5 Destination Host Unreachable
From 10.152.86.18 icmp_seq=6 Destination Host Unreachable
^C

The problem looks like there is no ARP entry for the default gateway:

~ # arp -n
arp -n
? (10.152.87.254) at <incomplete> on wlan0

How can we get the ARP entry for the default gateway? It should have been populated in response to the ping, but it was not. After much trying, pinging to the broadcast address of the network seems to do the trick:

~ # ping -b 10.152.87.255
ping -b 10.152.87.255
WARNING: pinging broadcast address
PING 10.152.87.255 (10.152.87.255) 56(84) bytes of data.
64 bytes from 10.152.87.252: icmp_seq=1 ttl=255 time=15.0 ms
64 bytes from 10.152.87.253: icmp_seq=1 ttl=255 time=15.5 ms (DUP!)
64 bytes from 10.152.86.27: icmp_seq=1 ttl=64 time=84.0 ms (DUP!)
64 bytes from 10.152.86.87: icmp_seq=1 ttl=64 time=84.4 ms (DUP!)
64 bytes from 10.152.86.19: icmp_seq=1 ttl=64 time=88.2 ms (DUP!)
64 bytes from 10.152.84.78: icmp_seq=1 ttl=64 time=194 ms (DUP!)
64 bytes from 10.152.86.101: icmp_seq=1 ttl=64 time=194 ms (DUP!)
64 bytes from 10.152.84.64: icmp_seq=1 ttl=64 time=194 ms (DUP!)
64 bytes from 10.152.84.15: icmp_seq=1 ttl=64 time=195 ms (DUP!)
64 bytes from 10.152.84.37: icmp_seq=1 ttl=64 time=198 ms (DUP!)
64 bytes from 10.152.87.253: icmp_seq=2 ttl=255 time=2.77 ms
64 bytes from 10.152.87.252: icmp_seq=2 ttl=255 time=3.14 ms (DUP!)
64 bytes from 10.152.86.27: icmp_seq=2 ttl=64 time=6.35 ms (DUP!)
64 bytes from 10.152.84.37: icmp_seq=2 ttl=64 time=7.00 ms (DUP!)
64 bytes from 10.152.84.64: icmp_seq=2 ttl=64 time=31.3 ms (DUP!)
64 bytes from 10.152.84.15: icmp_seq=2 ttl=64 time=36.2 ms (DUP!)
64 bytes from 10.152.86.87: icmp_seq=2 ttl=64 time=64.9 ms (DUP!)
64 bytes from 10.152.86.19: icmp_seq=2 ttl=64 time=66.1 ms (DUP!)
64 bytes from 10.152.84.78: icmp_seq=2 ttl=64 time=95.2 ms (DUP!)

After that ping, we definitely have the ARP entry:

~ # arp -n
arp -n
? (10.152.87.254) at 00:07:b4:01:a6:01 [ether] on wlan0

And the ping to the default gateway starts responding:

~ # ping 10.152.87.254
ping 10.152.87.254
PING 10.152.87.254 (10.152.87.254) 56(84) bytes of data.
64 bytes from 10.152.87.254: icmp_seq=1 ttl=255 time=33.8 ms
64 bytes from 10.152.87.254: icmp_seq=2 ttl=255 time=3.27 ms
^C

From this moment on, I have complete Internet connectivity, but after some time (I guess after the ARP expiration time), connectivity gets lost again.

A workaround for this behavior is to configure a static IP instead of using DHCP, This avoids the need to ping the broadcast address and gives me immediate access to the net. But I would rather avoid this static configuration, since I am in a company environment and am not allowed to grab an IP for my own.

Hope anyone can help or could advise for any other place to ask this question.

Regards