First you need to login in and get a terminal. The su – to root and cd to the /etc/sysconfig/network-scripts directory
This is where the network configuration files are;
Eth0 is the ethernet port that is used for server access, we will vi the config file ifcfg-eth0; “vi ifcfg-eth0”
and then your in the editor, where you edit the file.
- BOOTPROTO is either dhcp or static, dhcp is used when dynamically assigning the IP address
- IPADDR is the IP Address when statically defined
- NETMASK is the network mask, usually 255.255.255.0 for most home networks
- GATEWAY is the default gateway
- DNS1 is the DNS server
- DNS2 is the secondary DNS server
Once the new IP information is set, you can restart the network service to use the new configuration
“service network restart”
Assuming there are no errors, your new network configuration will be live.
Wow! Thank you for this tips! It’s great that you have included a screenshot along with an instruction.
you forgot to mention that you also need to change the IP in the /etc/hosts file. This may trip up a few people.
Only if the IP is in the host file.. which admittedly is more common than not. Nice catch!