How do I change the IP address/netmask and hostname on the command line WITHOUT rebooting the machine?

Updated -

Here are some example configuration files:

/etc/hosts

127.0.0.1      localhost.localdomain  localhost
192.168.0.254  server1.example.com    server1

/etc/sysconfig/network

NETWORKING=yes
HOSTNAME=server1.example.com
GATEWAY=192.168.0.1

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

DEVICE=eth0
BOOTPROTO=static
IPADDR...

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content