Solved

How to configure CentOS 5.5 network

Posted on 2011-03-21
4
1,271 Views
Last Modified: 2012-05-11
Hi,

I have a CentOS 5.5 server which is connected to a wireless router's Ethernet port. The wireless router has an IP 192.168.1.1, and is connected to an ADSL modem which then is connected to the Internet service provider.

I don't have a static IP assigned, but DHCP. I used tracert command and find that the dynamically assigned IP is xxx.xx.120.21.

All windows laptops and desktops are smoothly connected to the wireless router at the moment, meaning the Internet is working.

The CentOS server is not network pre-configured when shipped here. I want to configure the server to connect to Internet. How can I do it? I was told to use SETUP command, which seems a little bit difficult as I am new to CentOS.

Is there a way around?

Thanks.
0
Comment
Question by:wsyy
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Red-King
ID: 35179732
First things first, to find out your IP address for certain use the command:
ifconfig

The left hand column shows you your interface i.e. eth0, eth1, lo.
The first line of each interface is the encapsulation method (usually Ethernet) and the MAC address.
The second line is your IP, Broadcast and subnet. The rest is not useful except in advanced configuration and troubleshooting.

To configure your DNS settings for the server you need to edit the file /etc/resolve.conf
This takes effect imediately.

To configure your network settings the easiest way is to use the utility:
system-config-network

To enable and disable a network connection use:
ifup eth0

and:
ifdown eth0
0
 

Author Comment

by:wsyy
ID: 35186192
Thanks Red-King. Could you tell me what exactly DNS/IP/Network Mask to set?
0
 
LVL 9

Accepted Solution

by:
Red-King earned 250 total points
ID: 35188095
The DNS, IP and Netmask you set is specific to your private network.
For this you need to know what the settings are for your wireless router.

The steps you need to take are as follows;

Log into your wireless router
Find the configuration of your LAN (Usually displayed on a summary page)

Note down the LAN IP adderss (Probably 192.168.1.1)

Check it there is a DHCP server running (There may be a DHCP settings page with an "enabled" Check box)

If it is running a DHCP server (which is likely) note down the DHCP Range, netmask and DNS (this is to verify against your CentOS server)
Assuming the DHCP server is running on your wireless router do the following (if a DHCP server is not running then we'll do the steps for that instead)
{I'm assuming you're logging into the command line interface (CLI). If you're logging into the graphical user interface (GUI) then there's GUI based tools to do this}

Log into your CentOS server (you may need to be root)

Type in: system-config-network

The red and blue config interface is displayed. Choose to "Edit Devices" and then choose "eth0"
Move the cursor to the box titled "Use DHCP" and press the space bar.
Press Tab to move to the ok button and press enter
Press Tab to move to the Save button and press enter

Next select "Edit DNS Configuration"
Enter in a Hostname if you want a different one

For the Primary DNS enter the Wireless Router's LAN IP address which you noted earlier

For Secondary and Tertiary DNS enter Google's Public DNS servers, 8.8.8.8 and 8.8.4.4
Tab to Ok and then Tab to Save&Quit
You may need to restart your network connection to obtain a new DHCP address

Type: ifdown eth0

Type:ifup eth0
Verify your IP address is within the DHCP range (note earlier)
 Type: ifconfig

In the information related to eth0 note the "inet addr", "Bcast" and "Mask"

You should have something like: inet addr:192.168.1.34  Bcast:192.168.1.255  Mask:255.255.255.0
Check you can reach the wireless router: ping 192.168.1.1 (You should get "64 bytes from 192.168.1.1: ...")
Check you can reach outside your private network and also that DNS works: ping www.google.com

If all the above steps worked out ok then you are set, you are network connected.
If they didn't work let me know your LAN details for you wireless network and the output of the command: ifconfig
0
 

Author Closing Comment

by:wsyy
ID: 35276242
great, detailed info!!!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MAC Needs 2 Domains 2 45
How to check the PVU´s on AIX TSM servers? 3 52
Cisco switch SVI 17 41
Network Config 9 58
#Citrix #Citrix Netscaler #HTTP Compression #Load Balance
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now