FEZCerb + ENC28 Module

1 Sometimes do not get IP.
2 If do not receive an IP is not consistently resolved.
3 starts and unplug the cable, do not get an IP.
( unplug cable and then Turn On ,after Then connect cable)

How do I solve the problem?

Here is my source

While iface.IPAddress = "0.0.0.0"
Debug.Print(“waiting IP Address…”)
Thread.Sleep(2000)
Me.char_Display.SetCursor(0, 0)
Me.char_Display.PrintString(“Re NEW IP Address”)

            iface.ReleaseDhcpLease()
            iface.RenewDhcpLease()
            Thread.Sleep(2000)


        End While
        Debug.Print("IP Address Granted: " + iface.IPAddress)