# Can't connect to the internet

## Gerto

Hello,

first of all, I'm quite a n00b with linux, so sorry if this i s a stupid question  :Smile: :

I've tried installing gentoo on my new pc-> no problem ,

now I'm trying it on an older pc:

but I can't connect to the internet, I've followed the manual, and when I do ifconfig eth0 , it completely works (Link encap: Ethernet HWADDR blablabla 

UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU: 1500 Metric:1 

RX packets:0 errors:0 dropped:0 overruns: 0 frame: 0

TX packets:4 errors:0 dropped:0 overruns: 0 carrier:0 collisions:0 txqueuelen:1000

RX bytes:0  (0.0 b) tx bytes: 2360 (2.3 Kb)

Interrupt:9 Base address:0x8f00)

In the manual it says that if you get this message , everything works, but if I try ping , it doesn't work (unknown host),

On the network card, the link-led is on, but the act is off  :Smile: 

Can someone tell me what I have to do please?

Thanks

----------

## robbyjo

Did you install a firewall? Post your iptables -L.

----------

## mens

since you get a host unknown, I take it you tried to ping a hostname, not an ip-address.

Try pinging an ip-address. If that works, check your /etc/resolv.conf (which has to contain your nameservers)

----------

## Gerto

I didn't install a firewall , the only thing I've done is the chapter of 'preparing the disks' & 'configuring your network' in the installation guide,

by the way iptables -L ???  :Embarassed:  command not found  :Embarassed: 

I've tried pinging a IP , but it says: 'network is unreachable'

----------

## robbyjo

Then you haven't installed iptables. Okay... Try pinging yourself and try other computers pinging you.

----------

## mens

did you set a default gateway?

route add default gw xxx.xxx.xxx.xxx

----------

## Gerto

pinging myself? 

ping localhost -> 64 bytes from livecd.gentoo etc...

----------

## Gerto

*up* please, does anybody know how to solve this?  :Confused: 

----------

## mens

what's the output of /sbin/route ?

----------

## Gerto

Hmm, strange:

I boot: it says 'eth0 detected' ,

I try ifconfig:  it finds eth0 and lo,

so I do '/sbin/route' : and it only finds loopback , so I do ifconfig again and it only shows lo  :Confused: 

(so I do ifconfig it finds eth0 and lo, I try /sbin/route , I try ifconfig again and it only finds lo  :Confused:  )

But if I do 'ifconfig eth0' it shows somethink like in my first post:

Link encap: Ethernet HWaddr ...

BROADCAST MULTICAST etc

----------

## mens

looking at your first post again, I see you have no IP-address on eth0. How did you configure it? What's in /etc/conf.d/net?

----------

## Gerto

Hm, the only thing  I've done is net-setup eth0 (I chose dhcp because I have a dynamic IP, that's right I think?)

/etc/conf.d/net :

iface_eth0="dhcp"

iface_eth1="dhcp"

iface_eth2="dhcp"

iface_eth3="dhcp"

iface_eth4="dhcp"

----------

## mens

try running dhcpcd manually and see what happens.

----------

## Gerto

I ran dhcpcd manually, and nothing happens  :Confused: ,

by the way, isn't it strange it sometimes doesn't show eth0 with ifconfig? 

by example I do net-setup eth0 , after that ifconfig and it shows eth0, I do ifconfig again, it still shows eth0, I do zksd (just some invalid command  :Smile: ) and ifconfig again and it doesn't show eth0 anymore  :Confused:  (this doesn't always happen, sometimes it just keeps on showing eth0 but I still cann't connect to the internet)

----------

## mens

net-setup will do an ifconfig up

but since your dhcpcd doesn't give you an ip address, the interface automatically goes down again. Typing ifconfig with no arguments will only show the interfaces which are currently up. Specifying an interface as argument will show the interface - if it exists - regardless of wether it's up or not.

I assume you are trying to get the ip-address from your ISP. Is it possible that you are switching between two cimputers to get an IP address and that your ISP does not allow that. (My cable provider in Belgium is like that). If that's the case, try cleanly releasing the IP address on your other PC before attempting the dhcpcd again or wait a while (can be minutes or hours....).

----------

## Gerto

Well erm, I have telenet mono  :Smile:  ,

and I only have 1 cable atm so I'm constantly switching between this pc and the old one  :Surprised: 

maybe that's the problem

----------

## mens

aha...telenet indeed :-)

I didn't check your location...

You can try dhcpcd -k on the other pc (which is working) before you switch cables...if that one is a linux PC as well.

Or setup a small lan, use one PC to connect to the internet and have the others connect through that one using iptables. You'd better put a second NIC in the PC connected to the internet though...

----------

## Gerto

Mens, I love you  :Wink:  , I'm answerring with links , on the old pc  :Very Happy: , I've done ipconfig /release on the new win xp machine and now the internet on the old one finally works, thank you very very much for the help and the clear explanations  :Very Happy: 

----------

## mens

good...now stop using win xp ;-)

Actually, such an 'old' PC is ideal for setting up a gateway to share your internet connection. You get a free firewall for free which will help protect your windows boxes from the vicious internet out there.

Glad I could help.

----------

## Gerto

lol:) , actually , I have one last question  :Smile:  , what is the linux equivalent of 'ipconfig /release' ,because I'd like to be able to go back to the new pc without waiting a few hours  :Smile: 

----------

## mens

as mentioned above: dhcpcd -k

----------

