LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-16-2012, 07:38 PM   #1
archnemesis
Member
 
Registered: Dec 2009
Posts: 31

Rep: Reputation: 0
Can't get internet working without dhcpcd


I've just set up a new adsl2 modem/router, and tried to get the internet working on my PC by manually assigning an address and default route with the ip command:

ip addr add 192.168.1.10/24 dev eth0;
ip route add default via 192.168.1.1;

Using the ip show addr and ip show route commands I see everything looking the same as when using dhcpcd, and eth0 is up.

However it doesn't work. It's like I've forgotten some essential command needed to activate it. Any ideas?

Cheers
 
Old 02-16-2012, 08:04 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

is it a nameserver issue? What is in your /etc/resolv.conf? Can you ping IP addresses?
Eg
Code:
ping 8.8.8.8
Evo2.
 
Old 02-16-2012, 08:09 PM   #3
archnemesis
Member
 
Registered: Dec 2009
Posts: 31

Original Poster
Rep: Reputation: 0
Yes, that works.

EDIT: I have two nameservers in my /etc/resolv.conf though. I checked my ISP's site as well just to make sure they are correct. Is this not being read except when using dhcpcd for some reason?

Last edited by archnemesis; 02-16-2012 at 08:20 PM.
 
Old 02-16-2012, 08:22 PM   #4
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
Hi,

so you should just need to define a nameserver in /etc/resolv.conf. Your router should probably provide one, so the following should work:
Code:
echo "nameserver 192.168.1.1" >> /etc/resolv.conf
However, your distro might provide some other way of managing that file. Have a look in your reslov.conf to see if there are any comments/instructions.

HTH,

Evo2.
 
Old 02-16-2012, 08:27 PM   #5
archnemesis
Member
 
Registered: Dec 2009
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks evo, I just noticed the comment at the top of the file "Generated by dhcpcd from eth0". So that explains it.
Cheers
 
  


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
dhcpcd not working jimerickso Linux - Wireless Networking 1 04-02-2007 07:13 AM
Why has DHCPCD stopped working? the-yikes Linux - Wireless Networking 1 02-25-2007 12:07 PM
dhcpcd not working with working wlan0 mclinkor Linux - Wireless Networking 1 12-20-2005 10:12 AM
dhcpcd not working? [LAG] Prude Linux - Wireless Networking 7 03-24-2005 01:00 AM
blfs - dhcpcd - not working bauld Linux From Scratch 1 06-30-2002 11:55 AM

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

All times are GMT -5. The time now is 09:41 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