# No more Internet connection

## Pyrates

Hi there!

The last update to my system made me lose my internet connection, and I can't get it to work again. I have a router that I connect via  ethernet. The thing is, when I boot windows everything is working as it should, so I think this is a configuration issue, probably caused by the new modular configuration system of gentoo.

I use dhcp, and that seems to work ok, I get a lease (also confirmed on the router's side), the IP get assigned to the ethernet card, the routes are set (seemingly correct with 1 issue, see below), the nameserver get put into resolv.conf correctly. Still, the router doesn't respond to pings or anything, ONLY the configuration interface (port 80 via http) is reachable and works. DNS isn't working, and I also can't  reach anything outside by using IP-adresses. On the router's side I disabled anythng like firewall and stuff, I only have a bit of port-forwarding (When I use windows, I can ping the router, and the dns works as it's supposed to)

I think I understood how to use the new configuration, I set eth0 to use dhcp, and it seems to work, as I said above. I changed nothing else in the example file (  I once chanched the use of dhcpcd to dhclient, but that didn't change anything, so I uncommented that line again).

One particular thing: I get an IP adress from the range 192.168.0.100 to 192.168.0.199, and so a route to the network 192.168.0.0 via eth0 is set, but I can't delete it! I use 'route del -net 192.168.0.0', but that gives an error (not sure which, can't use my comp right now, but it might also be that I just used the wrong command).

I'd REALLY be glad for any hints. I know the info is a bit undetailed, but I don't have copy and paste. So if you know where I should look I could post what I find.  Thanks for any pointers...

Cheers, 

Philipp

----------

## Aurisor

Did you do an etc-update after your last update?

Can you post your /etc/conf.d/net ?

----------

## Pyrates

Hey ishan, thanks for your answer  :Smile: 

 *ishan wrote:*   

> Did you do an etc-update after your last update?

 

Yes I did. Checked again, nothing new to update...

 *ishan wrote:*   

> Can you post your /etc/conf.d/net ?

 

Of course. I don't know where this is used, because interfaces have their own (like net.eth0), but since you asked:

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

# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/conf.d/net,v 1.7 2002/11/18 19:39:22 azarah Exp $

# Global config file for net.* rc-scripts

# This is basically the ifconfig argument without the ifconfig $iface

#

#iface_eth0="192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0"

#iface_eth1="207.170.82.202 broadcast 207.0.255.255 netmask 255.255.0.0"

# For DHCP set iface_eth? to "dhcp"

# For passing options to dhcpcd use dhcpcd_eth?

#

iface_eth0="dhcp"

#dhcpcd_eth0="..."

# For adding aliases to a interface

#

#alias_eth0="192.168.0.3 192.168.0.4"

# NB:  The next is only used for aliases.

#

# To add a custom netmask/broadcast address to created aliases,

# uncomment and change accordingly.  Leave commented to assign

# defaults for that interface.

#

#broadcast_eth0="192.168.0.255 192.168.0.255"

#netmask_eth0="255.255.255.0 255.255.255.0"

# For setting the default gateway

#

#gateway="eth0/192.168.0.1"

```

As for net.eth0, the only uncommented line is

```
config_eth0=( "dhcp" )
```

Anything else I should look at or try? Thanks for your help  :Smile: 

Cheers

Philipp

----------

## stanlus

Same problem here...

Yesterday my inet (wlan) works fine. After an emerge world I can not connect anymore.

I have a router and I can ping it. But it can not resolve google.com.

----------

## JaQoB

Same here...

But i can get it up working temporary with "route add default gw ********"

Something wrong with the gateway settings in net.eth?

----------

## stanlus

Now I found out the following:

After:

```
/etc/init.d/net.wlan0 start
```

I can ping my router but nothing else. Here is my net:

```

config_wlan0="192.168.115.140 broadcast 192.168.115.255 netmask 255.255.255.0"

routes_wlan0=(

        "default via 192.168.115.8"

)

```

And here is my wireless:

```

sid_wlan0="any"

mode_wlan0="auto"

preferred_aps=( "WLANSTSPI" )

dns_domain_WLANSTSPI="HOMENET-STSPI"

key_WLANSTSPI="XXXX-XXXX-XX"

```

And this is my resolv.conf:

```

# Generated by net-scripts for interface wlan0

domain HOMENET-STSPI

```

Now I do some

```

echo "nameserver 192.168.115.8" >> /etc/resolv.conf

```

And everything works fine.

How can I prevent the resolv.conf to be overwritten?

----------

## gemini91

I have the same problem on two systems. It has to do with changes to

/etc/conf.d/net (I think because of baselayout changes). I use static addressing

and before my net file contained only the gateway address. Now when I put

the static eth0 address in I connect to my router, but not to the internet. If I 

add a gateway address it makes no difference. If I do "route add default gw xx.xx.xx.xx"

that works.

EDIT: somehow going through /etc/conf.d/net.example I missed this

# Here's how todo routing if you need it

#routes_eth0=(

#       "default via 192.168.0.1"               # IPv4 default route

#       "10.0.0.0/8 via 192.168.0.1"            # IPv4 subnet route

#       "::/0"                                  # IPv6 unicast

#)

I added  

 routes_eth0="192.168.1.1"

Things now work fine.

----------

## bhav2007

I had the same problem, but I think I've figured it out now.

 *Quote:*   

>  routes_eth0="192.168.1.1" 

 

didn't quite work for me.

I have a static ip behind a NAT enabled router

To manually set up my static ip (according to the gentoo handbook), I would do

```
ifconfig eth0 192.168.1.1 netmask 255.255.255.0

route add default gw 192.168.1.1

```

Previous to the upgrade I had this in my /etc/conf.d/net:

```
config_eth0="192.168.1.1 netmask 255.255.255.0"

gatway="eth0/192.168.1.1"

```

The gateway line no longer works, now I need this

```
config_eth0=( "192.168.1.100 netmask 255.255.255.0" )

routes_eth0="default gw 192.168.1.1"
```

I believe my system is configured to use ifconfig to set up the networking.

----------

## stanlus

 *Quote:*   

> 
> 
> The gateway line no longer works, now I need this
> 
> Code:
> ...

 

Doesn't have any effect for me.  

I do not understand this. I have a router with the IP 192.168.115.8 and I need a static IP for my Laptop 192.168.115.140. Until yesterday this worked very well with:

```

config_wlan0="192.168.115.140 broadcast 192.168.115.255 netmask 255.255.255.0"

routes_wlan0=(

        "default via 192.168.115.8"

) 

```

After update of baselayout it doesn't work anymore   :Evil or Very Mad: 

----------

## aguettinger

Here is my /etc/conf.d/net, in case that helps anybody. I use static IP behind a router+firewall.

To get name resolution working again I had to add

dns_servers_eth0="xx.xx.xx.xx xx.xx.xx.xx"

to /etc/conf.d/net. Where xx.xx.xx.xx are my providers primary and secondary name servers.

So here is the whole file content:

#

```
 /etc/conf.d/net:

#modules=( "ifconfig" )

config_eth0=( "192.168.1.4 broadcast 192.168.1.255 netmask 255.255.255.0" )

#fallback_eth0=( "dhcp" )

gateways_eth0="192.168.1.1"

routes_eth0=( "default via 192.168.1.1" )

dns_domain_eth0=""

dns_servers_eth0="62.2.24.162 62.2.17.60"

dns_search_eth0=""

#dns_options_eth0=( "timeout 1" "rotate" )

#dns_sortlist_eth0="130.155.160.0/255.255.240.0 130.155.0.0"

#ntp_servers_eth0="192.168.0.2 192.168.0.3"

```

----------

## stanlus

jep, this works for me. Thanks to aguettinger.

Was there any information after update of baselayout about old configuration not working anymore?

----------

## gemini91

Yes, a note said that /etc/conf.d/net contained variables that were no longer

supported. Showed up in enotice output.

----------

