follow this steps
Go to Settings and tap on Wi-Fi.
Turn on the Wi-Fi and connect to a network.
Long press on the connected network and select Modify Network.
Check Show Advance Options.
On IP Settings drop down menu, select Static.
Assign IP of your choice but leave other variable untouched.