Wednesday, December 27, 2017

Changing the Hostname and Gateway in Linux Environment

Add IP to the Linux Machine.

Verify the IP current settings

[root@xxx] $route -n

Add IP to the
[root@xxx] $sudo ifconfig eth0 172.16.74.10 netmask 255.255.255.0

Add Default Gateway
[root@xxx] $sudo route add default gw 172.16.74.1 eth0

Add Hostname
Modify the below file as below.
/etc/sysconfig/network

NETWORKING=yes
HOSTNAME="plain.domainname.com"
GATEWAY="172.16.74.1"
GATEWAYDEV="eth0"
FORWARD_IPV4="yes"

Retest the issue.
Reboot the server

No comments:

Post a Comment