Linux Server Deployment Cooked Book
Setting a static IP address
Open the Ethernet device's configuration file, found under /etc/ sysconfig/network-
scripts,with your text editor:
vi /etc/sysconfig/network-scripts/ifcfg-enp0s3
Change the value of BOOTPROTO to none:
BOOTPROTO="none"
At the end of the file, add the IPADDR, NETMASK, and BROADCAST entries to set the desired IP
address. Assign them values that properly reflect your network:
IPADDR="192.168.56.100"
NETMASK="255.255.255.0"
BROADCAST="192.168.56.255"
Open the /etc/sysconfig/network file using your editor:
vi /etc/sysconfig/network
Add a GATEWAY entry to identify your network's gateway:
GATEWAY="192.168.56.1"
Restart the networking service for the configuration changes to take effect:
systemctl restart network.service
Binding multiple addresses to a single Ethernet device