LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Can't get internet working without dhcpcd (https://www.linuxquestions.org/questions/linux-newbie-8/cant-get-internet-working-without-dhcpcd-929797/)

archnemesis 02-16-2012 07:38 PM

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

evo2 02-16-2012 08:04 PM

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.

archnemesis 02-16-2012 08:09 PM

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?

evo2 02-16-2012 08:22 PM

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.

archnemesis 02-16-2012 08:27 PM

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


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