Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
eth0 and DHCP working but not internet
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
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Fri Aug 12, 2005 5:53 pm    Post subject: eth0 and DHCP working but not internet Reply with quote

Hey

The subject title pretty much says it all. I boot up and it finds my network card and all the DHCP stuff.
It also shows the correct info when I type ifconfig. I have broadband going through ethernet, not USB,
and I can browse the internet in Windows.

But when I:

ping google.com or ping www.google.com (shouldn't make a difference)
or any host

it says, "Host not found"

Any ideas?

Thanks
Back to top
View user's profile Send private message
Sven Vermeulen
Retired Dev
Retired Dev


Joined: 29 Aug 2002
Posts: 1345
Location: Mechelen, Belgium

PostPosted: Fri Aug 12, 2005 6:05 pm    Post subject: Reply with quote

Do you have the /etc/nsswitch.conf file? If not, create one with the following content:

Code:

passwd:      compat
shadow:      compat
group:       compat

hosts:       files dns
networks:    files dns

services:    db files
protocols:   db files
rpc:         db files
ethers:      db files
netmasks:    files
netgroup:    files
bootparams:  files

automount:   files
aliases:     files


Next, check if you have a /etc/resolv.conf which contains the correct domain name servers.

You can always try pinging to them:
Code:

~# cat /etc/resolv.conf
nameserver 195.130.130.11
nameserver 195.130.133.11
domain siphos.be

~# ping -c 3 195.130.130.11
PING 195.130.130.11 (195.130.130.11) 56(84) bytes of data.
64 bytes from 195.130.130.11: icmp_seq=1 ttl=59 time=58.6 ms
64 bytes from 195.130.130.11: icmp_seq=2 ttl=59 time=52.3 ms
64 bytes from 195.130.130.11: icmp_seq=3 ttl=59 time=58.9 ms

--- 195.130.130.11 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2014ms
rtt min/avg/max/mdev = 52.331/56.638/58.961/3.061 ms


If that works out well, and you can still not ping any domain name, your domain servers are probably not valid.
Back to top
View user's profile Send private message
Crisis
l33t
l33t


Joined: 10 Feb 2003
Posts: 613
Location: Portland, OR

PostPosted: Fri Aug 12, 2005 6:05 pm    Post subject: Reply with quote

Sounds like DNS. Did you copy over /etc/resolv.conf during the install?

Try pinging an IP (not dns name).
Back to top
View user's profile Send private message
nixnut
Bodhisattva
Bodhisattva


Joined: 09 Apr 2004
Posts: 10974
Location: the dutch mountains

PostPosted: Fri Aug 12, 2005 6:05 pm    Post subject: Reply with quote

Moved from Installing Gentoo to Networking & Security.

Check your /etc/resolv.conf.
Can you ping ip numbers even if you can't ping domain names?
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Fri Aug 12, 2005 6:09 pm    Post subject: Reply with quote

Let me give everything a go, and I'll post back here. Just for interest sake, what nameservers do I use?

I also haven't installed anything yet, I'm booting off the Minimal Install CD.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Fri Aug 12, 2005 6:29 pm    Post subject: Reply with quote

No luck, I tried it all. The files and nameservers are all there.

When I ping the ip address I get "network unreachable".
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Fri Aug 12, 2005 9:55 pm    Post subject: Reply with quote

OK, I got it working. For some reason it wouldn't assign me and ip address ann gateway`.
So I did an ipconfig in Windows and got the details, and then manually set it up using ifconfig and route.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 4:20 pm    Post subject: Reply with quote

Hey, I'm getting the same problem again, but I've installed GenToo now.

I tried what I did before but it doesn't work. It's actually quite strange, because it doesn't
say anything like, "host not found", it just sits there.

How can I fix this?
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sat Aug 13, 2005 5:10 pm    Post subject: Reply with quote

ok lets see if we can pin this down
1. dose your windows box boot up with DHCP ?
2 what dose your net work look like modem --> switch --- > computers ?
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 5:21 pm    Post subject: Reply with quote

no switches etc, it goes straight to the cable modem.

i've booted up with and without dhcp, but neither worked.
i also got the ip address and gateway from windows and set it manually but that didn't work.
The strange thing is that it did work from the LiveCD, manual config i mean.
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sat Aug 13, 2005 5:27 pm    Post subject: Reply with quote

Ok but how dose the windows box boot via DHCP or do you have setting your ISP gave you to put in to windows via the control panel ... networking ect...
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 5:47 pm    Post subject: Reply with quote

Windows just picks it up automatically, thats the other thing I can't figure out.
Why doesn't linux pick it up. In the LiveCD I still had to enter it manually. Strange.
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sat Aug 13, 2005 6:12 pm    Post subject: Reply with quote

ok so when you boot the linux box do you shutdown the windows box first then boot the linux box
I guess I should ask these are 2 diffrent boxes are they not.
if so cat the output of your /var/lib/dhcpc/dhcpcd-eth0.info and lets look at that.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 6:25 pm    Post subject: Reply with quote

I'll do that. No, same box, I am dual booting.
Back to top
View user's profile Send private message
the_mgt
Apprentice
Apprentice


Joined: 05 Aug 2005
Posts: 259
Location: Germany, near Hannover

PostPosted: Sat Aug 13, 2005 6:43 pm    Post subject: Reply with quote

1. If you boot with windows, you can contact the internet? So you have set up your internet connection via the cable modem there, right? Or what takes you to the internet? Any hardware routers???

2. If you connect to the internet from the box you are running gentoo on, did you set up any internet connection? If not, how do you expect to connect to the internet, if you have no external hardware router?

3. If you don't have a hardware router and your only computer connects directly to the internet, what do you need dhcp for?

After all these posts here, i am still not able to figure out your problem. Describe your network configuration and the involved computers more precisely.....

As an example, my configuration:
ISP--->ADSL Modem--->GentooBox (Router, runs dhcp Server) ---> MyLaptop (is dhcp Client)
My Router connects to the internet, is the gateway and provides DNS and DHCP for my LAN. Any computer starting with "config_eth0=("dhcp")" in my network gets an IP address assigned and automatically uses my router as gateway and nameserver. The GentooBox has a fixed IP address.

So, if you only want to connect one single desktop pc to the internet, you don't need a dhcp server.
If you have a hardware router, that is your DHCP and DNS server and is your gateway.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 7:07 pm    Post subject: Reply with quote

Ok, here goes.

I recently got a Broadband connection with modem, which I connected straight to my pc.
so it's PC -> Modem -> ISP.

The internet in Windows works fine using DHCP, it finds everything.

Now when I was installing GenToo, using the LiveCD, it didn't pick up the ip adress, gateway etc. Or perhaps it did, but it didn't work.
So I went and ipconfig'ed Windows and got the ip details and then did this in GenToo:

Code:

ifconfig eth0 <ip> netmask <mask> up
route add default gw <gw>


And that worked fine. So thinking that I would have a similar problem in the actual installed linux, I added the relevant details so it would be done on startup.
No I finished installing, and it did what it was supposed to do, except there was no internet. So I tried to use DHCP again and then it failed on netmount.

Hope that makes things a bit more clear.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 7:16 pm    Post subject: Reply with quote

Code:
/var/lib/dhcpc/dhcpcd-eth0.info


doesn't exist on my machine. Theres a dhcp directory in the lib dir but it's empty.
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sat Aug 13, 2005 7:34 pm    Post subject: Reply with quote

Ok I'm the one whos confused now.
when you boot of the live-cd you get an ipaddress. and you tested this by
ifconfig eth0 (and it had some like)
eth0 Link encap:Ethernet HWaddr 00:yy:zz:00:11:22
inet addr:192.168.1.12 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:18443 errors:0 dropped:0 overruns:0 frame:0
TX packets:14750 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:19549297 (18.6 Mb) TX bytes:2065479 (1.9 Mb)

forget the address shown thats for over here on my network.
but you did get some like that yes ?
Back to top
View user's profile Send private message
the_mgt
Apprentice
Apprentice


Joined: 05 Aug 2005
Posts: 259
Location: Germany, near Hannover

PostPosted: Sat Aug 13, 2005 7:45 pm    Post subject: Reply with quote

EDIT: hehe, the poster above me was faster, please answer his question first ;)

hmmm, i am still confused. Are you sure you didn't setup an internet connection under windows which dials in automatically?
What where the exact ip values, ipconfig listed in windows? How many connections did you see in windows?

What i can't figure out is, which of your computers sends the username and password to your ISP. Thats essentially for having an internet connection. So either your modem does that or you setup somthing in windows....
1.If your modem really provides internet over dhcp (which i think makes it a hardware router) then using dhcp should work.. (and your ip in windows should have been something like 192.168.x.x or 169.x.x.x or in rare cases 10.x.x.x)
Did you emerge net-misc/dhcp ? If so, using "config_eth0=( "dhcp" )" in /etc/conf.d/net and restarting /etc/init.d/net.eth0 should do the trick. If you didn't emerge net-misc/dhcp, no wonder it doesn't work.

2.If your modem does not provide internet via dhcp, than you have to set up an adsl connection under gentoo. Try using adsl-connect. (your ip in windows should have been something like 89.181.53.44 or some seemingly random number)

If you only use a single pc, you don't need netmount at all. But if netmount does not start, it is always a sign for a net device which didn't start.

I suggest you look at some howtos about setting up networks with linux. Maybe one of the examples fits your needs.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 9:05 pm    Post subject: Reply with quote

m_sqrd:
yip, i did that. I don't think I did it after it worked though.

the_mgt:
the ip is 89.19.xx.xx (don't want to give it all out)
Hmm, I did setup up stuff in Windows, but that doesn't explain why it worked off the liveCD. I think it looks at the mac address of the modem.
I'm sure I emerged dhcp. Well I can can run it so I must have. Let me go try that config.. thing. I did iface="dhcp" and it didn't work.
Back to top
View user's profile Send private message
the_mgt
Apprentice
Apprentice


Joined: 05 Aug 2005
Posts: 259
Location: Germany, near Hannover

PostPosted: Sat Aug 13, 2005 9:12 pm    Post subject: Reply with quote

89.x.x.x is an internet adress, so you are directly connected to your ISP.
Why it worked with the LiveCD is a miracle to me...

I think you need to establish a pppoe connection first.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sat Aug 13, 2005 9:19 pm    Post subject: Reply with quote

Nope, the config thing didn't work.

I think what we have to ask ourselves is:

What did LiveCD do that I'm not?

How do I establish the PPPoe connection?
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sat Aug 13, 2005 9:34 pm    Post subject: Reply with quote

Hmmm..
what ISP are you using and the modem info as well may be we can finger it out that way.
Back to top
View user's profile Send private message
Mr_Ridd
n00b
n00b


Joined: 12 Aug 2005
Posts: 29

PostPosted: Sun Aug 14, 2005 12:11 pm    Post subject: Reply with quote

I'm with NTL uk.

How do I set the DHCP server address?
Back to top
View user's profile Send private message
m_sqrd
Guru
Guru


Joined: 18 Jul 2005
Posts: 367

PostPosted: Sun Aug 14, 2005 1:01 pm    Post subject: Reply with quote

I think the_mgt is correct. I think you need one of the ppp set up's
look at http://www.gentoo.org/doc/en/handbook/2005.1/handbook-x86.xml?part=1&chap=3#rp-pppoe
and see if that make any diffrence I was just hunk up on the fact that the fisrt time it work with out it (well kinda work ?) any way take a look at that link and see if it help and let us know.
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