[CentOS] netmask set with ifconfig doesn't hold

Pete Biggs pete at biggs.org.uk
Thu Mar 14 15:38:21 UTC 2019


On Thu, 2019-03-14 at 15:12 +0000, KM via CentOS wrote:
> I gather that ifconfig is a way of setting the netmask in the current
> shell instead of a persistent value.  I say this because I am running
> it and see it for my specific network interface, directly after
> running it.
> However if I restart the network service the netmask is reverted to
> the previous value.
> What is the correct way to set the new netmask for the network
> interface to make it persistent.  

CentOS 6 & 7 use network manager to control the interfaces.  Probably
the easiest way to edit a connection for inexperienced users from the
command line is 'nmtui'.

You can also use 'nmcli' from the command line, but you have to craft
the command yourself and it can get quite involved if you don't know
what you are doing.

You may need to restart the network to pick up the new config after
editing it.

P.



More information about the CentOS mailing list