Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to configure CentOS 5.5 network

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I had an issue with InstallShield not being able to use Computer Browser service on Windows Server 2012. Here is the solution I found.
In this article, the configuration steps in Zabbix to monitor devices via SNMP will be discussed with some real examples on Cisco Router/Switch, Catalyst Switch, NAS Synology device.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses

580 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