# Internet stopped working after etc-update [solved]

## mhelvens

After etc-update and reboot. So I figure I accidentally rewrote a file that had some important networking-information. I remember that in the beginning, I had to add a gateway-ip to a certain file to make my internet work. But I forgot where I got that information and I can't find the file again (Gentoo has too many configuration files.)

The laptop is connected to a router. ifconfig shows eth0 is there.

Which file could it be?

Thanks!Last edited by mhelvens on Sun Sep 04, 2005 11:11 am; edited 1 time in total

----------

## St. Joe

Any chance this might help?

Configuring Your Network How-To

----------

## mhelvens

I'm afraid not. I didn't find the answer in there. That's the install guide, for when the live-cd is still in your drive. And when booting from the live-cd, the internet DOES work.

Anyway, if I'm overlooking something, please tell me.

----------

## mahdi1234

network config should be at /etc/conf.d/net ...

----------

## aceFruchtsaft

It's in the installation guide, just not quite where St. Joe linked to.

You need to edit /etc/conf.d/net

The syntax has changes after the last major baselayout update and looks like this:

```

config_eth0=( "192.168.0.2 netmask 255.255.255.0" )

routes_eth0=( "default gw 192.168.0.1" )

```

----------

## mhelvens

Hm.. That file doesn't have the syntax you describe yet for me. And apparently the gateway is set as it should.  :Confused:  I don't know what to do next. Something must have changed after the etc-update..

Can I input some commands and show the output here? Maybe someone can see what's wrong from that?  :Smile: 

----------

## mhelvens

Apparently the net.example file DOES use the syntax you describe, so I tried to use it as well. The example file sais that it might work if I don't specify anything. Well, it didn't. So I tried the two lines you gave me (with the appropriate ip addresses. Anyway, those lines were in the example file as well), and that didn't work either.  :Sad: 

----------

## aceFruchtsaft

Since your Laptop is connected to a router, does your router have dhcp enabled?

In that case you might try

```

config_eth0=( "dhcp" )

```

and delete everything else. The DHCP server should provide all relevant information automatically.

BTW, this is the new syntax introduced in newer versions of baselayout.

----------

## mhelvens

That gives the following error at startup:

 *Quote:*   

> * Starting eth0
> 
> *      Bringing up eth0
> 
> *           dhcp
> ...

 

And another couple of errors when starting other internet-things.

----------

## mahdi1234

old one would be iface_eth0="dhcp" in case of dhcp ...

----------

## mhelvens

That one doesn't work either. The very same error occurs.  :Confused: 

----------

## aceFruchtsaft

Output of 

```

emerge -pv baselayout dhcpcd

```

please.

----------

## mhelvens

Here you go.  :Smile:  In color.

 *Quote:*   

> [ebuild R ] sys-apps/baselayout-1.11.13-r1 -bootstrap -build -static -unicode 0 kB
> 
> [ebuild N ] net-misc/dhcpcd-2.0.0 -build -debug -static 119 kB

 

I could emerge those ebuilds.. you know.. if I had internet-access.

----------

## aceFruchtsaft

Ok, so DHCP won't be available as long as you don't emerge dhcpcd.

However, i don't even know if you need it.

How do you post on this forum anyway? Are you connected to the same router as your laptop with your desktop machine?

----------

## mhelvens

Exactly. From Windows XP.

Well, obviously I never needed that ebuild before. Internet has worked fine for many months, until it just stopped working after a reboot following a (careless) etc-update.

----------

## aceFruchtsaft

 *Michiel_H wrote:*   

> Exactly. From Windows XP.
> 
> Well, obviously I never needed that ebuild before. Internet has worked fine for many months, until it just stopped working after a reboot following a (careless) etc-update.

 

Ok, then post your WinXP network config. There is a tab with all the details in the network connection properties somewhere.

Using the same config with a modified IP address should work for your Linux laptop too since they are connected to the same router.

BTW, you can also use

```

ipconfig /all

```

in cmd.exe.

----------

## mhelvens

You mean the TCP/IP settings? Those are set at "Assign IP address automatically" and "Assign DNS-server address automatically" (translated from Dutch WinXP installation. Not sure if exact wording is used in English version.)

Doesn't seem like much help.

----------

## aceFruchtsaft

 *Michiel_H wrote:*   

> You mean the TCP/IP settings? Those are set at "Assign IP address automatically" and "Assign DNS-server address automatically" (translated from Dutch WinXP installation. Not sure if exact wording is used in English version.)
> 
> Doesn't seem like much help.

 

But you will still have received an IP address, a DNS Server, a default gateway, etc...

Use the ipconfig command to find those out.

----------

## mhelvens

Yep. I posted that before your edit.

Here it is (in Dutch, but it should be understandable.)

 *Quote:*   

> Verbindingsspec. DNS-achtervoegsel:
> 
> Beschrijving . . . . . . . . . . .: NVIDIA nForce Networking Controller
> 
> Fysiek adres. . . . . . . . . . . : 00-13-D4-17-50-A4
> ...

 

----------

## aceFruchtsaft

Great.

Edit your /etc/conf.d/net to read:

```

config_eth0=( "192.168.1.11 netmask 255.255.255.0" )

routes_eth0=( "default gw 192.168.1.1" )

```

Then your /etc/resolv.conf:

```

nameserver 194.134.5.5

nameserver 194.134.0.97

```

Then restart /etc/init.d/net.eth0.

See if that works. After that we will update your config to work with dhcp just like your windows.

----------

## mhelvens

 :Sad:  I'm afraid I already tried that very configuration. The nameservers were correct already. Anyway, I tried it again and it didn't work. Firefox will try to find a website for a couple of minutes before saying it's no use.

----------

## aceFruchtsaft

Ok, some more diagnostics to see what's wrong:

```

ifconfig -a

ping 192.168.1.1

ping 140.211.166.170

route

```

Post the output once again.

And make sure the physical connection is also up. It's just really weird that 2 machines connected to the same router with identical configurations except for the IP address would work differently.

----------

## mhelvens

ifconfig -a shows both eth0 and lo. But do you need all the output-information? That's a lot of typing, there.  :Smile: 

100% packet loss on both pings.

route:

192.168.1.0   *               255.255.255.0   U     0   0   0   eth0

loopback       animus.helvenst   255.0.0.0           UG   0   0   0   lo

default          192.168.1.1          0.0.0.0              UG   0   0   0   eth0

Hope that's clear enough. (helvenst should be helvensteijn, but I assume that's just the route command cutting a piece off, right?)

----------

## mhelvens

It's late, so I probably won't read your reply until tomorrow. Thanks! You've been very patient with me.  :Smile: 

----------

## aceFruchtsaft

route output looks fine.

The problem is that there is no connection between your router and your laptop.

So do I understand this correctly that the current setup looks like this?

Router (192.168.1.1)  <--> Laptop (192.168.1.11) (direct connection)

Usually routers have one LED per port showing whether something is connected to it. Is the LED for the port to which you connected your laptop really lit?

And when running ifconfig, is this your second line for eth0?

```

 inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0

```

If this all really works you must be able to ping your router.

The only other thing I could think of is to download dhcpcd from you XP box, transfer it to your /usr/portage/distfiles, compile dhcpcd and run it so your NIC gets configured automatically.Last edited by aceFruchtsaft on Sun Sep 04, 2005 12:07 am; edited 1 time in total

----------

## aceFruchtsaft

 *Michiel_H wrote:*   

> It's late, so I probably won't read your reply until tomorrow. Thanks! You've been very patient with me. 

 

You're right, time to go to bed, at least for us Europeans.  :Wink: 

----------

## hickmott

Try adding 

```
dhcpcd_eth0="-t 300"
```

to your /etc/conf.d/net file. If the file already has an uncommented dhcpcd_eth0 line, just add "-t 300" to it.

If this works, you're running into the same problem that we're having over here.

----------

## aceFruchtsaft

 *hickmott wrote:*   

> Try adding 
> 
> ```
> dhcpcd_eth0="-t 300"
> ```
> ...

 

The problem is that he doesn't even have dhcpcd installed right now, so he cannot use it.

----------

## mhelvens

I am deeply ashamed. The same day I did the etc-update, I removed my laptop from the router, to make place for another. I.. sort of.. didn't put it back in again.  :Embarassed: 

Thanks for your help. I will now go bang my head against the wall several times.

*owch*

Now that's over, should I emerge that dhcp package and replace the net-file with config_eth0=( "dhcp" )?

----------

## aceFruchtsaft

 *Michiel_H wrote:*   

> I am deeply ashamed. The same day I did the etc-update, I removed my laptop from the router, to make place for another. I.. sort of.. didn't put it back in again. 
> 
> Thanks for your help. I will now go bang my head against the wall several times.
> 
> *owch*
> ...

 

Hehe, I thought that something with the physical connection must have been broken since you could not even ping the router.

Enabling DHCP will be a good idea, then it works just like your XP box.

----------

## mhelvens

Ok, it works. Except for one thing. My gentoo laptop also recieves 192.168.1.10 as its ip, just like my Windows box. When I restart eth0, Windows shows a warning. Both computers can still use internet, but still, how should I solve this ip conflict? Should I forget about dhcpcd and just manually give an ip address?

----------

## aceFruchtsaft

 *Michiel_H wrote:*   

> Ok, it works. Except for one thing. My gentoo laptop also recieves 192.168.1.10 as its ip, just like my Windows box. When I restart eth0, Windows shows a warning. Both computers can still use internet, but still, how should I solve this ip conflict? Should I forget about dhcpcd and just manually give an ip address?

 

Hmm that really is strange, as DHCP servers usually keep track of what IPs they've leased to computers on the LAN to avoid conflicts.

If your router has some kind of configuration interface (e.g. via a web browser) you could check that, otherwise just use the settings I've given you on the previous page.

----------

## mhelvens

I think I'll put the old settings back. In this case: it's good enough for me if it works. Until I come across a better solution.

----------

