LinuxQuestions.org
Review your favorite Linux distribution.
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, 01:25 AM   #1
windstory
Member
 
Registered: Nov 2008
Posts: 486

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, 06: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,497

Rep: Reputation: 90
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:16 PM
normal user unable to use ping command after changing the security level to higher sleepyz Linux - Security 1 08-06-2008 11:24 PM
'ping -b' / ping <switch> doesn't work bmike1 Linux - Networking 2 01-10-2005 03:48 PM
Ping doesn't work (but everything else does) podollb Linux - Networking 2 10-13-2003 11:08 PM
How does ping work? rainmann Linux - Networking 0 06-20-2003 07:44 AM


All times are GMT -5. The time now is 05:37 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration