Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] dhcp works not properly
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Mon Apr 05, 2010 3:02 pm    Post subject: [SOLVED] dhcp works not properly Reply with quote

Hello,

I have a box with is connecting to a router.
The router is connecting to internet.

When i boot the system I get a ip-adres from the router.
But when i want to go to the internet I get dns failures.

How to solve this ?

Roelof


Last edited by roelof on Thu Apr 08, 2010 6:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Apr 05, 2010 3:09 pm    Post subject: Reply with quote

Can you post the contents of your /etc/conf.d/net and your /etc/resolv.conf?
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Mon Apr 05, 2010 4:12 pm    Post subject: Reply with quote

Hello Mike,

They both empty so something went wrong on installing.
Now google how a resolv.conf must look like.

Roelof

Edit : When I do nano -w /etc/resolv.conf
And i put this lines in it.

Search localhost
nameserver 212.54.35.25
nameserver 212.54.40.25

And I save it.
After a reboot the file is empty.
It looks like dhcpcd writes it.
And on reboot dhcpcd times out.
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Apr 05, 2010 5:16 pm    Post subject: Reply with quote

That is correct, your resolv.conf will be overwritten on each boot by whatever dhcp places there. The reason I was asking to see your /etc/conf.d/net is to see if you are accidentally using nodns in your dhcp configuration.
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Mon Apr 05, 2010 5:31 pm    Post subject: Reply with quote

Hello,

I don't use nodns.

The only thing what in conf.d/net is comments

Any other idea how to solve this or do I need NAT because im behind a router ?

Roelof
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Apr 05, 2010 6:30 pm    Post subject: Reply with quote

Is your router set to send you its default nameservers? Perhaps you haven't configured this option on your router? Also, can you post the version of dhcpcd you are using (or whatever dhcp client you are using)?
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Mon Apr 05, 2010 6:52 pm    Post subject: Reply with quote

Hello,

DHCPCD is version 4.0.15.

In Windows the router is sending the nameservers with it,
So I think that in Gentoo it's the same.
In the router config there is nothing about sending dns data.

Roelof
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Mon Apr 05, 2010 8:49 pm    Post subject: Reply with quote

How are you starting your network adapter at boot? Have you manually added net.eth0 to your default renlevel, are you letting something like netplug start it, or something else?

Also, are you sure that with the ip address your router gives you, you are able to ping external addresses? You might want to try and ping your router for starters, and then try something on the net like google.com (72.14.209.104).
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 6:15 am    Post subject: Reply with quote

Hello Mike,

Here the data you asked for and a little bit more.

I have manually added eth0 to the default runlevel as stated in the book.

Here the ping results :

ping 192.168.0.1 (router) connect : network unreachable
ping 72.14.209.104 connect : network unreachable
ping www.google.nl ping : unknown host www.google.com

And here is ifconfig :
Code:

eth0 link encap : UNSPEC HWadres : a lot of numbers and letters.
        inet addr : 169.254.126.196 Bcast : 169.254.255.255 mask : 255.255.0.0
        UP BROADCAST RUNNING MULTICAST MTU:1500 METRIC:1
        RX packets : 0  errors : 0   dropped : 0 overruns : 0 frame:0
        TX packets : 38 errors : 0   dropped: 0 overruns : 0 carrier:0 collisions : 0  txqueulelen : 1000
        RX packets : 0 (0,0 b)    TXbytes: 11335 (11,0 Kib)


And on booting I see this messages :
Code:

dhcpcd 4.0.15 starting
broadcasting  for lease
timed out
trying to use old lease in 'var/lib/dhcpcd/dhcpcd-eth0.lease'
checking 169.254.126.196 is avaible on attached networks.
Using IPv4LL adres 169.254.126.196
   eth0 recieved adress 169.254.126.196


Roelof
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Tue Apr 06, 2010 1:28 pm    Post subject: Reply with quote

Ok, so it looks like the issue isn't that you aren't getting your dns settings, it's that you aren't getting a proper ip address. The one it is assigning you is the one dhcp has in its cache.

I'm not 100% sure where to go from here, but some things that you might want to check are:
1) Ensure your ethernet cable works well (a good test would be to see if you get an ip when booting off a gentoo minimal cd)

2) Verify that you are using the correct drivers for your card in the kernel (Can you post the results of `lspci -nn | grep Network`)

3) Ensure that you don't have firewall settings blocking the dhcp request
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 2:31 pm    Post subject: Reply with quote

Hello Mike,

1) I have a working internet when using rescuedisk after doing net-setup eth0

2) lscpi -nn | grep Network gives nothing.
lspci -nn gives this on networking:

02:03.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ [10ec:8139] (rev 10)


3) I don't think that's the problem. With the same computer on Windows no problem and in the config of the router nothing can be found on blocking DNS.

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 3:58 pm    Post subject: Reply with quote

Have you done "Copy DNS Info" from the handbook?
You can still do it with rescuecd.
Do net-setup eth0 with rescuecd and then
chroot into your install.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 4:00 pm    Post subject: Reply with quote

Hello Gerard.

Oke and then ?

What must I do after chrooting.
I have done "Copy DNS info" from the handbook.

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 5:33 pm    Post subject: Reply with quote

Are you sure it's copied to your /etc/resolv.conf?
Then you exit the chroot,unmount and remove the rescuecd and reboot.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 5:38 pm    Post subject: Reply with quote

Hoi Gerard.

Im sure I copied it.
That's where I find the problems that I described.

After rebooting dhcp will rewrite resolv.conf

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 5:55 pm    Post subject: Reply with quote

Apparently /etc/resolv.conf is not important.
I did the following:
I moved resolv.conf out of /etc.
I then did /etc/init.d/net.eth0 restart.
To my surprise it connected w/o any problem.
It's been a long time since I had to config this.
But I did my regular updates and things might have changed.
One last question:did you compile the 8139 driver in-kernel or as a module?
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Tue Apr 06, 2010 5:55 pm    Post subject: Reply with quote

I still think the problem is not dns, but with your dhcp client not receiving an ip for some reason. BTW - When I asked about the firewall above, I meant the firewall on your local machine, not on your router... Sometimes if the local firewall is not configured properly it will block all net connections.

A kernel misconfiguration still seems like it could be an option. Maybe you should try copying over the kernel configuration off the livecd and reconfigure your kernel. You can use this command to get the kernel .config off the livecd (when you are booted into the livecd): `zcat /proc/config.gz > .config`
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 6:20 pm    Post subject: Reply with quote

Hello Mike,

Kernel misconfig I don't think so. The config is made by pappa_mcfea

I can see that the modules for the network card are modules and both modules are loaded on start.
With lsmod I see this :

8139cp 22616 0
8139too 27260 0

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 6:41 pm    Post subject: Reply with quote

The 8139cp is prolly the culprit.
I used to have a box with the 8139 and in make menuconfig I had a choice of 2 8139 modules.
I remember that only the one option that resulted in 8139too worked.
You might try
Code:

modprobe -r 8139cp

and then
Code:

etc/init.d/net.eth0 restart

Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 7:04 pm    Post subject: Reply with quote

Hello Gerard,

Did your steps but still the same messages.

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 7:06 pm    Post subject: Reply with quote

What message did you get after modprobe -r?
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 7:08 pm    Post subject: Reply with quote

Hello Gerard,

I get no message , just the prompt.
But the module disappear on the list generated by lsmod.

Roelof
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Apr 06, 2010 7:11 pm    Post subject: Reply with quote

OK.
Plse do rc-status and post the result.
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
mikegpitt
Advocate
Advocate


Joined: 22 May 2004
Posts: 3224

PostPosted: Tue Apr 06, 2010 7:12 pm    Post subject: Reply with quote

Try removing both modules and adding the 8139too module:
Code:

rmmod 8139cp
rmmod 8139too
modprobe 8139too
Back to top
View user's profile Send private message
roelof
Guru
Guru


Joined: 05 Feb 2009
Posts: 488

PostPosted: Tue Apr 06, 2010 7:36 pm    Post subject: Reply with quote

Hello Mike and Gerard.

Gerard

Here's the output of rc-status.

local started
net.eth0 started
netmount started
udev.postmount started.

Mike,

If I do your steps and restarted eth0 the problem stays.


Roelof
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum