Network Configuration for Linux servers (IP address, gateway, and DNS)

Configure the following as root:
1.  Configure IP and netmask
vi /etc/sysconfig/network-scripts/ifcfg-ethx

You should edit the file similar to:
DEVICE=ethx
HWADDR=xx:xx:xx:xx:xx:xx
BOOTPROTO=static
ONBOOT=yes
IPADDR=[your_IP_address]
NETMASK=255.255.255.0

2.  Configure Gateway
vi /etc/sysconfig/network
Then append the following if you don’t have a gateway:
GATEWAY=[your_gateway]

3.  Configure DNS
vi /etc/resolv.conf
Then append the following if you don’t have a DNS:
nameserver [your_DNS]

Advertisements
This entry was posted in Linux Admin Basics, Linux Tips. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s