# [SOLVED] My internet connection died

## Galumph

Dad played with the router setup and stuff last night, and now I can't connect to the internet. Every other computer in the house has internet, and is running Windows (pesky bastards be stealing my connection).

I'm not even sure where to start with this one. I've always had a working connection ever since I started using Gentoo.

Here's what net.eth0 says when I restart it.

```
# /etc/init.d/net.eth0 restart

netmount           | * Unmounting network filesystems ...                                  [ ok ]

net.eth0           | * Bringing down interface eth0

net.eth0           | *   Stopping dhcpcd on eth0 ...                                       [ ok ]

net.eth0           | *   Removing addresses

net.eth0           | * Bringing up interface eth0

net.eth0           | *   dhcp ...

net.eth0           | *     Running dhcpcd ...

net.eth0           |dhcpcd[26268]: version 5.2.12 starting

net.eth0           |dhcpcd[26268]: eth0: waiting for carrier

net.eth0           |dhcpcd[26268]: eth0: carrier acquired

net.eth0           |dhcpcd[26268]: eth0: rebinding lease of 192.168.0.60

net.eth0           |dhcpcd[26268]: eth0: acknowledged 192.168.0.60 from 192.168.0.1 `ÿ'

net.eth0           |dhcpcd[26268]: eth0: checking for 192.168.0.60

net.eth0           |dhcpcd[26268]: eth0: leased 192.168.0.60 for 7200 seconds

net.eth0           |dhcpcd[26291]: eth0: eth0: MTU set to 576

net.eth0           |dhcpcd[26268]: forked to background, child pid 26310                   [ ok ]

net.eth0           | *     received address                                                [ ok ]

netmount           | * Mounting network filesystems ...

```

I'm pretty sure it should show an IP address instead of that 'ÿ'.Last edited by Galumph on Fri Sep 16, 2011 3:36 pm; edited 2 times in total

----------

## Jaglover

Can you connect from some liveCD?

Can you connect using static address?

What error you are getting?

Are you using a valid DNS?

----------

## NeddySeagoon

Galumph,

You seem to have got an IP address ok.

What do you have in /etc/resolv.conf?

You need at least one nameserver.

A line line 

```
nameserver 8.4.4.2
```

should get you going if it empty.  Thats a public nameserver.

```
eth0: eth0: MTU set to 576 
```

is a bit odd. Ethernet packets have an overhead of 64 bytes, such a small Maximum Transmission Unit can add a lot of overhead.

For wired networking, the MTU should be 1500 unless you use PPPoE, which has a further 8 bytes of overhead, so the MTU should be 1492.

Good values to avoid fragmentation are normally auto detected.

----------

## Galumph

 *Jaglover wrote:*   

> Can you connect from some liveCD?

 

I have Slackware installed to a USB drive, and the same thing happens when I boot from it.

 *Jaglover wrote:*   

> What error you are getting?

 

Where can I check for an error? ping gives an unknown host error, and the output of the network script is posted above.

 *Jaglover wrote:*   

> Are you using a valid DNS?

 

I'm pretty sure I am, though I'm not sure what this means. My Father takes care of the network here, and I trust he gets it right. Also, other computers around the house connect properly.

 *NeddySeagoon wrote:*   

> What do you have in /etc/resolv.conf?
> 
> You need at least one nameserver. 
> 
> 

 

/etc/resolve.conf says this:

```
# Generated by dhcpcd

# /etc/resolve.conf.head can replace this line

# /etc/resolve.conf.tail can replace this line

```

I'm guessing this means it's empty?

 *NeddySeagoon wrote:*   

> 
> 
> ```
> eth0: eth0: MTU set to 576 
> ```
> ...

 

The connection is wired, and last I recall we don't use PPPoE (Last time I set up the network for this box was last year, so I may be wrong.).

----------

## Jaglover

You need at least one valid nameserver in /etc/resolv.conf. Normally DHCP client should get it from DHCP server (for some reason this isn't happening), but you can override it and use any server available to you, closest one is probably the caching nameserver in your router. But you can use upstream ISP server or some public nameserver as NeddySeagoon suggested.

----------

## NeddySeagoon

Galumph,

You are missing a nameserver. Did adding the public nameserver help?

It won't stick as it will get wiped every time your DNS lease is renewed.

Put a static nameserver in /etc/resolv.conf  and add the nodns option to your /etc/conf.d/net file, so that its not overwritten by dhcpcd every time your dns lease is renewed.

I don't know the syntax but its in /usr/share/doc/openrc-<ver>/...

A good choice for your nameserver is the IP of your router as most routers run a caching nameserver. Second are your ISPs nameservers.

You want something close by as your nameserver is consulted every time something needs to change a name to IP address.

----------

## Hu

Very low MTU values can be a sign of stupid DHCP servers.  For a long time, my ISP tried to set an MTU of 576, but the connection worked fine for more traditional MTUs.  You can force an alternate MTU via /etc/conf.d/net if you believe that the DHCP-offered MTU is too low.  However, if you force a value that is too large, you may experience problems with stalled connections or excessive fragmentation, so any manually set values should be tested before you settle on one.

----------

## Galumph

I added my router as the nameserver in /etc/resolve.conf, but internet connection still doesn't work.

```
root:# cat /etc/resolv.conf 

secondary2 192.168.0.1

root:# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

dhcp_eth0="nodns"

root:# /etc/init.d/net.eth0 restart 

netmount           | * Unmounting network filesystems ...                                 [ ok ]

net.eth0           | * Bringing down interface eth0

net.eth0           | *   Stopping dhcpcd on eth0 ...                                      [ ok ]

net.eth0           | *   Removing addresses

net.eth0           | * Bringing up interface eth0

net.eth0           | *   No configuration specified; defaulting to DHCP

net.eth0           | *   dhcp ...

net.eth0           | *     Running dhcpcd ...

net.eth0           |dhcpcd[12122]: version 5.2.12 starting

net.eth0           |dhcpcd[12122]: eth0: waiting for carrier

net.eth0           |dhcpcd[12122]: eth0: carrier acquired

net.eth0           |dhcpcd[12122]: eth0: rebinding lease of 192.168.0.60

net.eth0           |dhcpcd[12122]: eth0: acknowledged 192.168.0.60 from 192.168.0.1 `ÿ'

net.eth0           |dhcpcd[12122]: eth0: checking for 192.168.0.60

net.eth0           |dhcpcd[12122]: eth0: leased 192.168.0.60 for 7200 seconds

net.eth0           |dhcpcd[12149]: eth0: eth0: MTU set to 576

net.eth0           |dhcpcd[12122]: forked to background, child pid 12157                  [ ok ]

net.eth0           | *     received address                                               [ ok ]

netmount           | * Mounting network filesystems ...                                   [ ok ]

root:# ping www.google.com

ping: unknown host www.google.com
```

The nodns option does work. resolve.conf stays the same after restarting net.eth0, and after pinging google.com.

----------

## Jaglover

secondary2 192.168.0.1 ?

I just had a quick look at man resolv.conf and didn't see anything like this.

----------

## Galumph

secondary2 is the network's name, and 192.168.0.1 is the router's IP address. Lemme guess, I'm doing it wrong?

----------

## NeddySeagoon

Galumph,

```
# Generated by net-scripts for interface lo

nameserver 212.23.3.100

nameserver 212.23.6.100
```

is what I have in resolv.conf  Thats my ISPs nameservers, they won't work for you.

You must set the nodns option in /etc/conf.d/net, or your resolv.conf will be rewritten by dhcpcd every time your lease is renewed.

From your 

```
net.eth0           |dhcpcd[26268]: eth0: leased 192.168.0.60 for 7200 seconds
```

that happens every two hours.

----------

## krinn

 *Hu wrote:*   

> Very low MTU values can be a sign of stupid DHCP servers.  For a long time, my ISP tried to set an MTU of 576, but the connection worked fine for more traditional MTUs.  You can force an alternate MTU via /etc/conf.d/net if you believe that the DHCP-offered MTU is too low.  However, if you force a value that is too large, you may experience problems with stalled connections or excessive fragmentation, so any manually set values should be tested before you settle on one.

 

----------

## Galumph

Tried reading man resolv.conf this time. Here's what I have now:

```
root:# cat /etc/resolv.conf 

nameserver 192.168.0.1

root:# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="dhcp"

dhcp_eth0="nodns"

mtu_eth0="1500"

root:# /etc/init.d/net.eth0 restart 

netmount           | * Unmounting network filesystems ...                               [ ok ]

net.eth0           | * Bringing down interface eth0

net.eth0           | *   Stopping dhcpcd on eth0 ...                                    [ ok ]

net.eth0           | *   Removing addresses

net.eth0           | * Bringing up interface eth0

net.eth0           | *   dhcp ...

net.eth0           | *     Running dhcpcd ...

net.eth0           |dhcpcd[12264]: version 5.2.12 starting

net.eth0           |dhcpcd[12264]: eth0: waiting for carrier

net.eth0           |dhcpcd[12264]: eth0: carrier acquired

net.eth0           |dhcpcd[12264]: eth0: rebinding lease of 192.168.0.60

net.eth0           |dhcpcd[12264]: eth0: acknowledged 192.168.0.60 from 192.168.0.1 `ÿ'

net.eth0           |dhcpcd[12264]: eth0: checking for 192.168.0.60

net.eth0           |dhcpcd[12264]: eth0: leased 192.168.0.60 for 7200 seconds

net.eth0           |dhcpcd[12278]: eth0: eth0: MTU set to 576

net.eth0           |dhcpcd[12264]: forked to background, child pid 12286                [ ok ]

net.eth0           | *     received address                                             [ ok ]

netmount           | * Mounting network filesystems ...                                 [ ok ]

root:# ping www.google.com

ping: unknown host www.google.com
```

Does the nameserver's (my router's, in this case) IP need to be a public one? Also, I can't seem to force a higher MTU.

----------

## Jaglover

When your dad fiddled with router, did he disable caching nameserver? If yes then you need to use something from outside, find out what are your ISP's nameservers and use those. Or, you could tell your dad turn the DNS in router back on. Frankly, I do not know about Windows, maybe they can work with some DNS alternative.

----------

## Galumph

I got it working through a static IP:

```
root:# cat /etc/conf.d/net

# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /etc/conf.d/net.example and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="192.168.0.60 netmask 255.255.255.0"

routes_eth0="default via 192.168.0.1"

root:# cat /etc/resolv.conf 

nameserver 192.168.0.1
```

How do I make sure resolv.conf isn't overwritten whenever I restart my net script?

e, Never mind, I added 'dns_servers="192.168.0.1"' to /etc/conf.d/net and now resolv.conf is generated with the nameserver line.

----------

