LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-23-2009, 12:25 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 489

Rep: Reputation: 36
After changing eth0's ip, ping not work


I have selected intel pro/1000 network adapter 1 for NAT.

And I changed 10.0.2.15 ip to 192.168.0.11 by under-mentioned commands.


Code:
ifconfig eth0 down 
ifconfig eth0 192.168.0.x netmask 255.255.255.0 up  
ifconfig eth0
My box is centos 5.2 x86 as guest and windows 7 x64 as host.
And eth0 configuration is as shown at screen shot.

http://www.postimage.org/PqaA6UJ.jpg

Please let me know how can fix this problem and connect to internet.
I want to connect internet through eth0 with ip:192.168.0.x for my dns configuration.
 
Old 01-23-2009, 05:03 AM   #2
rylan76
Senior Member
 
Registered: Apr 2004
Location: Potchefstroom, South Africa
Distribution: Fedora 17 - 3.3.4-5.fc17.x86_64
Posts: 1,552

Rep: Reputation: 103Reputation: 103
Quote:
Originally Posted by windstory View Post
I have selected intel pro/1000 network adapter 1 for NAT.

And I changed 10.0.2.15 ip to 192.168.0.11 by under-mentioned commands.

Code:
ifconfig eth0 down 
ifconfig eth0 192.168.0.x netmask 255.255.255.0 up  
ifconfig eth0
Hmm, shouldn't the above be

Code:
ifconfig eth0 down 
ifconfig eth0 192.168.0.x netmask 255.255.255.0 up  
ifconfig eth0 up
i. e. add "up" to the last line?

Additionally, you may need to configure a gateway in order to get on the net - i. e. add a line like this, which "points" to your router / bridge / proxy / whatever you use to get on the internet:

Code:
/sbin/route del default
/sbin/route add default gw 10.0.0.2 eth0
where 10.0.0.2 is your router or gateway address.

My whole "recipe" to do the above looks like this:

Code:
/sbin/ifconfig eth0 down
/sbin/ifconfig eth0 10.0.0.8 netmask 255.255.255.0 broadcast 10.254.255.255 up
/sbin/route del default
/sbin/route add default gw 10.0.0.2 eth0
since I installed my Linux box as having IP 169.254.255.10, but later I had to change it to 10.0.0.8 ...

Hope this helps.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ping work,ssh can not work aixilin Ubuntu 2 09-03-2008 03:16 PM
normal user unable to use ping command after changing the security level to higher sleepyz Linux - Security 1 08-06-2008 10:24 PM
'ping -b' / ping <switch> doesn't work bmike1 Linux - Networking 2 01-10-2005 02:48 PM
Ping doesn't work (but everything else does) podollb Linux - Networking 2 10-13-2003 10:08 PM
How does ping work? rainmann Linux - Networking 0 06-20-2003 06:44 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration