Solved

How to configure CentOS 5.5 network

Posted on 2011-03-21
4
1,307 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your business is like most, chances are you still need to maintain a fax infrastructure for your staff. It’s hard to believe that a communication technology that was thriving in the mid-80s could still be an essential part of your team’s modern I…
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.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

734 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