How do I set the IP address on my Linux server?

To set the IP address via the GUI:

To set the IP address via the command line:

Set the default gateway:

vim /etc/sysconfig/network

Change the GATEWAY line, save and quit

Set the IP address and network mask:

vim /etc/sysconfig/network-scripts/ifcfg-eth0

Change the IPADDR, GATEWAY and NETMASK lines, save and quit

 

2 thoughts on “How do I set the IP address on my Linux server?”

  1. When entering the vim commands it displayed information, but not gateway, IP or mask. I couldn’t see how to change it using those commands. We ended up using the GUI to do so.

Comments are closed.