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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.