Skip to main content

Network Configuration - Linux OS

Configuring Network for a Linux System

Edit configuration files stored in /etc/sysconfig/network-scripts/

You can configure network card by editing text files stored in /etc/sysconfig/network-scripts/ directory.

First change directory to /etc/sysconfig/network-scripts/:

# cd /etc/sysconfig/network-scripts/

Edit / create files as follows:

• /etc/sysconfig/network-scripts/ifcfg-eth0 : First Ethernet card configuration file
• /etc/sysconfig/network-scripts/ifcfg-eth1 : Second Ethernet card configuration file

For edit/create first NIC file, type command:

# vi ifcfg-eth0

Modify as follows:

# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)

DEVICE=eth0
BOOTPROTO=static
DHCPCLASS=
HWADDR=00:30:48:56:A6:2E
IPADDR=10.10.29.66
NETMASK=255.255.255.192
ONBOOT=yes
Save and close the file.

Define default gateway (router IP) and hostname in /etc/sysconfig//network file:

# vi /etc/sysconfig/network

Append/modify configuration as follows:

NETWORKING=yes
HOSTNAME=www1.nixcraft.in
GATEWAY=10.10.29.65
Save and close the file.

Restart networking:
# /etc/init.d/network restart

Make sure you have correct DNS server defined in /etc/resolv.conf file:

# vi /etc/resolv.conf

Setup DNS Server as follows:
nameserver 10.0.80.11
nameserver 10.0.80.12
nameserver 202.67.222.222

Save and close the file. Now you can ping the gateway/other hosts:

$ ping 10.0.80.12

PING 10.0.80.12 (10.0.80.12) 56(84) bytes of data.
64 bytes from 10.0.80.12: icmp_seq=1 ttl=251 time=0.972 ms
64 bytes from 10.0.80.12: icmp_seq=2 ttl=251 time=1.11 ms
You can also check for Internet connectivity with nslookup or host command:

$ nslookup citi.biz
Output:
Server: 10.0.80.11
Address: 10.0.80.11#53

Non-authoritative answer:
Name: citi.biz
Address: 75.126.43.232

Also you can use host command:

$ host nixcraft.in
Output:
nixcraft.in has address 75.126.43.232
nixcraft.in mail is handled by 10 mail.nixcraft.in.

Regards
Avinash Pillai
URL : http://avinashpillai.blogspot.com
Email: avinashp[AT]aztecsoft[DOT]com, avinashp25[AT]gmail[DOT]com

Comments

Popular posts from this blog

Adding a New Hard Drive to Linux using LVM

I did this on RHEL 5.5. You should have the new drive created and added to the machine before you start anything.First you need to fdisk the drive like any other drive in linux. One key step is that you need to change the type; option ?t? to ?8e? for lvm. root@itsme ~# fdisk /dev/sdc Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel. Changes will remain in memory only,until you decide to write them. After that, of course, the previous content won't be recoverable. The number of cylinders for this disk is set to 7832. There is nothing wrong with that, but this is larger than 1024, and could in certain setups cause problems with: 1) software that runs at boot time (e.g., old versions of LILO) 2) booting and partitioning software from other OSs (e.g., DOS FDISK, OS/2 FDISK) Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) Command (m for help): n Command action e ex

Seven Personal Qualities Found In A Good Leader

Whether in fact a person is born a leader or develops skills and abilities to become a leader is open for debate. There are some clear characteristics that are found in good leaders. These qualities can be developed or may be naturally part of their personality. Let us explore them further. Seven Personal Qualities Found In A Good Leader: 1. A good leader has an exemplary character. It is of utmost importance that a leader is trustworthy to lead others. A leader needs to be trusted and be known to live their life with honestly and integrity. A good leader “walks the talk” and in doing so earns the right to have responsibility for others. True authority is born from respect for the good character and trustworthiness of the person who leads.   2.A good leader is enthusiastic about their work or cause and also about their role as leader. People will respond more openly to a person of passion and dedication. Leaders need to be able to be a source of inspiration, and be a

Various Types of Hunt Groups

                                                         Various Types of Hunt Groups         * Sequential Hunt Groups    * Peer Hunt Groups   * Longest-Idle Hunt Groups   * Parallel Hunt Groups (Call Blast) Sequential Hunt Groups In a sequential hunt group, extensions always ring in the order in which they are listed, left to right, when the hunt group is defined. The first number in the list is always the first number to be tried when the pilot number is called. Maximum number of hops is not a configurable parameter for sequential hunt groups. Peer Hunt Groups In a peer hunt group, extensions ring in a round-robin order. The first extension to ring is the number in the list to the right of the last extension to ring when the pilot number was last called. Ringing proceeds in a circular manner, left to right, for the number of hops specified when the hunt group was defined. Below figure llustrates a peer hunt group. Longest-Idle Hunt Groups