Change subnetmask in linux

1.5k Views Asked by At

How can I change the subnetmask of my eth0 interface?

sudo ifconfig netmask 255.255.254.0

I tried this but it wasn't effective

1

There are 1 best solutions below

1
xialeistudio On BEST ANSWER

you lose device parameter.

Just like this:

sudo ifconfig eth0 192.168.120.56 netmask 255.255.254.0

Then restart your network service

systemctl restart network