Centos – ubuntu network settings equivalent in centos 7

centoscentos7linux-networkingnetworking

I have in a ubuntu server an interface setup as the following

(in /etc/network/interfaces)

address xxx.xxx.xxx.xxx
netmask 255.255.255.255
broadcast xxx.xxx.xxx.xxx
post-up route add xxx.xxx.xxx.xxx dev eth0
post-up route add default gw xxx.xxx.xxx.xxx
post-down route del xxx.xxx.xxx.xxx dev eth0
post-down route del default gw xxx.xxx.xxx.xxx

I am wondering how can I use this configuration in a centos 7 server
(in /etc/sysconfig/network-scripts/ifcfg-ens18)

Best Answer

I would use the nmtui command-line tool (from the package NetworkManager-tui) to configure the network settings (you can set up custom routes there), and then have a look at the configuration file it produces. I have found that a lot easier than trying to edit the NetworkManager configuration files directly.