How to configure a static IP address ?
To configure a network interface with a static ip address, create a file called
ifcfg-
under the folder
/etc/sysconfig/network-scripts
where
Example: ifcfg-en01
Edit the file and add the following:
- Modify IPADDR to match your desired static ip address.
- Modify HWADDR to match the MAC address, as reported by ifconfig command (ether)
- DEVICE must match the interface name reported by ifconfig command
- BROADCAST, NETWORK and GATEWAY have to be modified according to your local network.
After a reboot, the Ethernet port will take the fixed address if physically connected.