?
Solved

How to configure CentOS 5.5 network

Posted on 2011-03-21
4
Medium Priority
?
1,345 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 1000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This month, Experts Exchange’s free Course of the Month is focused on CompTIA IT Fundamentals.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

719 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