Thursday, July 25, 2013

Setup Network Card in CentOS Basic Server

Setup Network Card in CentOS Basic Server

Step 1. Login to the system as root.

Step 2. Setup a DHCP IP
The eth0 is the first network interface card in a server by default.
To enable for a DHCP IP modify the interface configuration file of eth0.
A sample interface configuration file is given below.
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:24:81:16:28:A5
TYPE=Ethernet
UUID=80e845b8-bfc8-4ef5-b2af-800d2b8b5ee2
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp


Step 3. Setup DNS Server names.
The DNS server cnfiguration will help the server to resolve domain name request into IP.
A sample DNS configuration file is given below.
# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 172.52.52.199
nameserver 12.11.23.199
nameserver 152.54.48.199


Step 4. Restart network interface.
The restart of network service is required after editing above files.
# /etc/init.d/network restart

Use ifconfig command to check the network interface
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:24:81:16:28:A5
          inet addr:XXX.XX.XX.XX Bcast:XXX.XX.XX.XX Mask:255.255.255.0
          inet6 addr: ffff::fff:ffff:ffff:ffff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4865 errors:0 dropped:0 overruns:0 frame:0
          TX packets:594 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:951393 (929.0 KiB)  TX bytes:141212 (137.9 KiB)
          Interrupt:19 Memory:f0000000-f0020000

No comments:

Post a Comment