0

I tried to change my private IP address with the following commands:

sudo ifconfig wlp3s0 down
sudo ifconfig wlp3s0 192.168.1.12
sudo ifconfig wlp3s0 up

They just work fine becouse the IP changes but then the newtork become unavailable. The issue remains if I change again the IP address to the initial one. What's wrong with that? How can I solve it?

5

You might need to specify the subnet mask to use. The command above is likely assuming that the subnet mask is 255.255.255.255, which is for a point-to-point network.

The following might work:

sudo ifconfig wlp3s0 down
sudo ifconfig wlp3s0 192.168.1.12/255.255.255.0
sudo ifconfig wlp3s0 up

(Also check to see that a default route is present, using the ip route command.)

On a side note, ifconfig is deprecated and is replaced by the ip command. The equivalent steps are:

sudo ip link set dev wlp3s0 down
sudo ip addr add 192.168.1.12/24 dev wlp3s0
sudo ip link set dev wlp3s0 up

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.