# [solved] Same installation + different kernels = dead networ

## _savage

I've got a bit of a weird problem here; at least it looks weird to me.  There are different versions of the kernel installed on my box, amongst them 2.6.12 and 2.6.17.  For the last months 2.6.12 has been working fine and stable, including (wireless) network.  Then, after several months of inactivity, I updated my system and built a new kernel version 2.6.17.

The 2.6.12 kernel is still working fine on a recent system, although udev complains about unimplemented inotify feature.

The problem is with the 2.6.17 kernel (at least one of the more recent versions like -r4 or -r5).  When I boot that, the first thing different is that it automatically brings up eth0 (which I don't usually use) although both network interfaces are disabled in /etc/conf.d/rc before runlevel 3 is being entered.  Next, during runlevel 3 bringup, eth1 (wireless) is being brought up, receives an IP address via DHCP, but the network does not work.  Meaning: the name resolution fails, pinging an external IP address fails.

The 2.6.17 kernel ought to work though (I assume): the .config was created automatically using make.

I am not sure where to start here, what to look for.  Anybody got an idea, hints, suggestions?  Looks to me like an actual kernel problem because 2.6.12 is working fine.

----------

## wynn

 *Quote:*   

> When I boot that, the first thing different is that it automatically brings up eth0 (which I don't usually use) although both network interfaces are disabled in /etc/conf.d/rc before runlevel 3 is being entered. Next, during runlevel 3 bringup, eth1 (wireless) is being brought up, receives an IP address via DHCP, but the network does not work. Meaning: the name resolution fails, pinging an external IP address fails. 

 It may be that when eth0 is brought up, it sets the default route to something which doesn't work. DHCP should set the default route and change /etc/resolv.conf appropriately but it may have slipped up...

P.S. "the .config was created automatically using make"

To make sure that everything in the old kernel is taken across to the new, I copy the (latest version of the) old kernel's .config to the new one and run "make && make modules_install", if there are new configuration options in the new kernel, they will be presented to you to make a choice. This seems to work (Ducks!)

----------

## _savage

 *wynn wrote:*   

> It may be that when eth0 is brought up, it sets the default route to something which doesn't work. DHCP should set the default route and change /etc/resolv.conf appropriately but it may have slipped up...

 

You're right: there's no route set all, and even shutting down all network interfaces and only eth1 up doesn't set a route:

```
root@tigger ~ # route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

loopback        *               255.0.0.0       U     0      0        0 lo

root@tigger ~ # /etc/init.d/net.eth0 stop

 * Stopping eth0

 *   Bringing down eth0

 *     Stopping ifplugd on eth0 ...

 *     Shutting down eth0 ... 

root@tigger ~ # /etc/init.d/net.eth1 stop

 * Stopping apache2 ...

 * Unmounting network filesystems ...   

 * Stopping ntpd ...

 * Stopping firewall ...

 * Stopping sshd ...

 * Stopping xinetd ...

 * Stopping eth1

 *   Bringing down eth1

 *     Stopping dhcpcd on eth1 ...

 *     Shutting down eth1 ...

root@tigger ~ # /etc/init.d/net.eth1 start

 * Starting eth1

 *   Configuring wireless network for eth1

 *     eth1 connected to ESSID "Tigger" at 00:09:5B:DD:DA:5E

 *     in managed mode on channel 11 (WEP enabled - open)

 *   Bringing up eth1

 *     dhcp

 *       Running dhcpcd ...  

 *       eth1 received address

root@tigger ~ # ifconfig

eth1      Link encap:Ethernet  HWaddr 00:30:65:24:2C:7D

            UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

            TX packets:813 errors:0 dropped:0 overruns:0 carrier:0

            collisions:0 txqueuelen:1000

            RX bytes:105427 (102.9 Kb)  TX bytes:181060 (176.8 Kb)

            Interrupt:57

 lo        Link encap:Local Loopback

            inet addr:127.0.0.1  Mask:255.0.0.0

            UP LOOPBACK RUNNING  MTU:16436  Metric:1

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

            TX packets:4 errors:0 dropped:0 overruns:0 carrier:0

            collisions:0 txqueuelen:0

            RX bytes:280 (280.0 b)  TX bytes:280 (280.0 b)

root@tigger ~ # route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

loopback        *               255.0.0.0       U     0      0        0 lo
```

It's weird that the second time around, when I try to bring up eth1 it doesn't get an IP address assigned.

 *wynn wrote:*   

> To make sure that everything in the old kernel is taken across to the new, I copy the (latest version of the) old kernel's .config to the new one and run "make && make modules_install", if there are new configuration options in the new kernel, they will be presented to you to make a choice. This seems to work (Ducks!)

 

Actually, according to this thread this make oldconfig (to merge an older .config with the current one) does not work when you jump across kernel version 2.6.15/16.

----------

## wynn

 *Quote:*   

> 
> 
> ```
>  *       Running dhcpcd ... 
> 
> ...

 If you run ifconfig immediately after dhcpcd has finished, the address may not have shown up. It shows up after a delay of a few seconds.

However, that is not the problem here: "eth1 received address" should continue with the address received and it hasn't.

If you add a "-d" argument to dhcpcd in /etc/conf.d/net, close down the two interfaces and then bring up eth1 alone, dhcpcd will give more information about what it is doing.

It does look, however, as if your wireless router isn't responding properly to the DHCP request.

----------

## _savage

 *wynn wrote:*   

> If you add a "-d" argument to dhcpcd in /etc/conf.d/net, close down the two interfaces and then bring up eth1 alone, dhcpcd will give more information about what it is doing.
> 
> It does look, however, as if your wireless router isn't responding properly to the DHCP request.

 

Thanks for the hint; here is the debug spew when I restart eth1:

```
root@tigger ~ # /etc/init.d/net.eth1 restart

 * Stopping eth1

 *   Bringing down eth1

 *     Stopping dhcpcd on eth1 ...

 *     Shutting down eth1 ...

 * Starting eth1

 *   Configuring wireless network for eth1

 *     eth1 connected to ESSID "Tigger" at 00:09:5B:DD:DA:5E

 *     in managed mode on channel 11 (WEP enabled - open)

 *   Bringing up eth1

 *     dhcp

 *       Running dhcpcd ...

Info, MAC address = 00:30:65:24:2c:7d

Debug, broadcasting DHCP_REQUEST for 192.168.0.2

Debug, broadcastAddr option is missing in DHCP server response. Assuming 192.168.0.255

Debug, dhcpIPaddrLeaseTime=4294967295 in DHCP server response.

Debug, dhcpT1value is missing in DHCP server response. Assuming 2147483647 sec

Debug, dhcpT2value is missing in DHCP server response. Assuming 3758096383 sec

Debug, DHCP_ACK received from  (192.168.0.1)

Debug, broadcasting ARPOP_REQUEST for 192.168.0.2

Info, verified 192.168.0.2 address is not in use

Info, your IP address = 192.168.0.2

Debug, orig hostname = tigger

 *       eth1 received address 192.168.0.2/24
```

So if I can believe that then I do have an IP address assigned.  At the same time, my other laptop owns 192.168.0.3 and is online with no problems.  However, this one still doesn't work:

```
root@tigger ~ # ping  192.168.0.1

connect: Network is unreachable

root@tigger ~ # ping  192.168.0.3

connect: Network is unreachable

root@tigger ~ # ifconfig

eth1      Link encap:Ethernet  HWaddr 00:30:65:24:2C:7D

             inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0

             UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

             TX packets:5026 errors:0 dropped:0 overruns:0 carrier:0

             collisions:0 txqueuelen:1000

             RX bytes:653982 (638.6 Kb)  TX bytes:1118268 (1.0 Mb)

             Interrupt:57
```

----------

## wynn

 *Quote:*   

> 
> 
> ```
> root@tigger ~ # ping  192.168.0.1
> 
> ...

 Then it looks as though DHCP hasn't set up the routing table properly: could you post the output of "route -n"?

Could you also post the relevant entries in /etc/conf.d/net, please?

```
grep -E -v '^#|^$' /etc/conf.d/net
```

P.S. After the dust has settled, you might want to look at the way the DHCP server on your wireless router is set up,  *Quote:*   

> 
> 
> ```
> dhcpIPaddrLeaseTime=4294967295 in DHCP server response.
> ```
> ...

 seems a bit long   :Smile: 

----------

## _savage

Here is my routing table (empty).  When I try to add the default gateway, I get an error:

```
root@tigger ~ # route -v add default gw 192.168.0.1

SIOCADDRT: Network is unreachable

root@tigger ~ # route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
```

Am I missing a package, or a kernel option?

 *wynn wrote:*   

> P.S. After the dust has settled, you might want to look at the way the DHCP server on your wireless router is set up,  *Quote:*   
> 
> ```
> dhcpIPaddrLeaseTime=4294967295 in DHCP server response.
> ```
> ...

 

It's simply the decimal version of 0xFFFFFFFF, which ought to mean an unlimited lease time.

Anyway, the thing that confuses me here is that everything works when running my old 2.6.12 kernel.  But booting the system with the 2.6.17 kernel breaks it all.  All the configurations work fine, DHCP works fine, it's all good running on 2.6.12 ... not on 2.6.17 though?!  Doesn't that seem a little bit odd?

----------

## wynn

 *Quote:*   

> It's simply the decimal version of 0xFFFFFFFF, which ought to mean an unlimited lease time. 

 Oh I see, I thought it was unset and that it was supposed to be set to a short(er) interval.

 *Quote:*   

> everything works when running my old 2.6.12 kernel. But booting the system with the 2.6.17 kernel breaks it all. All the configurations work fine, DHCP works fine, it's all good running on 2.6.12 ... not on 2.6.17 though?! Doesn't that seem a little bit odd?

 Unfortunately, computers being deterministic things, nothing is odd, which makes them both interesting   :Smile:  and infuriating   :Sad: 

----------

## _savage

Now that sucks: even the default kernel doesn't work.  So when I create a .config with

```
make pmac32_defconfig
```

then this configuration produces a kernel which still exposes the same problems.  What now???

----------

## wynn

To try and gather things together (and get back to the main point   :Smile:  ), dhcpcd is assigning an address to eth1 but you get "Network unreachable" when pinging another address on the same subnet. This means that the routing table is not being set up as you have shown by posting the output of "route -n".

You can try setting up the routing table yourself:

```
route add default gw 192.168.0.1
```

which, I believe, is the address of your wireless router, and then check /etc/resolv.conf. Your router probably handles DNS queries so just

```
nameserver 192.168.0.1
```

should do.

If this works then dhcpcd should set up the routing table but there may be something in your /etc/conf.d/net which is stopping it: could you post  your /etc/conf.d/net and /etc/conf.d/wireless if you don't have everything in net. To leave out blank lines and comments, please use

```
grep -E -v '^#|^$' /etc/conf.d/net
```

and

```
grep -E -v '^#|^$' /etc/conf.d/wireless
```

----------

## _savage

Setting the default gateway using route doesn't really work and gives me this error:

```
root@tigger ~ # route -v add default gw 192.168.0.1

SIOCADDRT: Network is unreachable
```

For more information on that, see my above posting from Mon Aug 14.

There's something odd happening here though: the routing table seems to change every few seconds:

```
root@tigger ~ # date ; route -n

Wed Aug 16 08:07:06 PDT 2006

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

root@tigger ~ # date ; route -n

Wed Aug 16 08:07:08 PDT 2006

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     0.0.0.0         255.255.255.0   U     2000   0        0 eth1

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.0.1     0.0.0.0         UG    2000   0        0 eth1
```

This keeps going on in a fine rhythm.  I managed to dump resolv.conf, however:

```
root@tigger ~ # cat /etc/resolv.conf

# Generated by dhcpcd for interface eth1

search myhome.westell.com

nameserver 192.168.1.1

nameserver 204.127.198.4

nameserver 63.240.76.4
```

Is that first nameserver IP address ok?

And here are the two configuration files you asked for:

```
root@tigger ~ # grep -E -v '^#|^$' /etc/conf.d/net

modules=( "ifconfig" )

modules=( "iwconfig" )

modules=( "dhcpcd" )

config_eth0=( "dhcp" )

dhcpcd_eth0="-d -t 20"

config_eth1=( "dhcp" )

dhcpcd_eth1="-d -t 20"

fallback_eth1=( "192.168.0.2 netmask 255.255.255.0" )

fallback_route_eth1=( "default via 192.168.0.1" )

root@tigger ~ # grep -E -v '^#|^$' /etc/conf.d/wireless

essid_eth1="Tigger"

key_Tigger="<long fancy key> enc open"

preferred_aps=( "Tigger" )
```

Does that hint at something for you?  Thanks  :Smile: 

----------

## wynn

 *Quote:*   

> Setting the default gateway using route doesn't really work and gives me this error:
> 
> ```
> root@tigger ~ # route -v add default gw 192.168.0.1
> 
> ...

 Yes, my fault. I've been reading the route manpage and it says

```
gw GW  route  packets  via a gateway.  NOTE: The specified gateway must be reachable first. This usually means that 

       you have to set up a static  route to the gateway beforehand.  If you specify the address of one of your local 

       interfaces,  it will be used to decide about the interface to which the packets should be routed to.
```

So the NIC has to be given a static address first.

If you want to explore further you can do

```
ifconfig eth0 192.168.0.2 broadcast 192.168.0.255 netmask 255.255.255.0 up
```

before setting the route.

 *Quote:*   

> the routing table seems to change every few seconds: 
> 
> This keeps going on in a fine rhythm.

 You mean to say that it keeps on changing from

```
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo 
```

to

```
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     0.0.0.0         255.255.255.0   U     2000   0        0 eth1

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.0.1     0.0.0.0         UG    2000   0        0 eth1
```

and back again? The metric 2000 looks suspicious but I don't know enough about it to comment.

 *Quote:*   

> Is that first nameserver IP address ok? 

 No and I can't see from your /etc/conf.d/net and /etc/conf.d/wireless where it could have come from. It should be 192.168.0.1, shouldn't it?

I'm afraid I have come to the end of my resources. 

Your config files look OK and  your routing table looks OK too, except for the metric 2000. Your resolv.conf is wrong but I don't think that gives rise to "Network is unreachable".

Sorry I can't be of any further help.

----------

## nixnut

Moved from Gentoo on PPC to Networking & Security.

Moved at the request of the OP.

----------

## _savage

Out of curiosity I just plugged in an ethernet cable, shut down eth1 and brought up eth0...  to no avail.  The routing table is still the same, and the error messages are the same too.  So it doesn't seem like related to the wireless interface, but a general networking issue.

Any thoughts, please?!?!

----------

## tdm

I had the same problem until a few secs ago...

I just reinstalled my PC with 2006.0, the /etc/conf.d/net.example used udhcpcd so I tried that one out

(I have never used udhcpcd before, I always used dhcpcd on my previous configurations).

After a reboot I could connect to my local network, but I couldn't reach outside my local network while my other PC had not problems reaching the internet.

When I tried to contact something outside my network I got an "unreachable" message.

Then I unmerged udhcp and went back to dhcpcd, rebooted, and now all is fine.

Maybe a bug in udhcp, I don't know. But dhcpcd works for me, so I stay with it  :Smile: 

Hopefully this helps somebody

----------

## _savage

 *tdm wrote:*   

> Then I unmerged udhcp and went back to dhcpcd, rebooted, and now all is fine.  Maybe a bug in udhcp, I don't know. But dhcpcd works for me, so I stay with it 

 

Nope  :Sad:   I don't even have udhcp installed on my system; my /etc/conf.d/net I already posted on Aug 16 (bottom) and it used dhcpcd.

----------

## tdm

This is my /etc/conf.d/net:

```
config_eth1=( "dhcp" )

dhcp_eth1="nodns nontp nonis"
```

I have read you net file, and I have no idea what the following rules mean in your net file:

```
modules=( "ifconfig" )

modules=( "iwconfig" )

modules=( "dhcpcd" )

fallback_eth1=( "192.168.0.2 netmask 255.255.255.0" )

fallback_route_eth1=( "default via 192.168.0.1" )
```

Do you know where I could find information about the modules and fallback rules?

The /etc/conf.d/net.example file didn't made it clear for me..

----------

## _savage

 *tdm wrote:*   

> Do you know where I could find information about the modules and fallback rules?
> 
> The /etc/conf.d/net.example file didn't made it clear for me..

 

Have a look at this site: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4.

----------

## tdm

 *_savage wrote:*   

> 
> 
> Have a look at this site: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=4.

 

Thanks for the link  :Very Happy: 

----------

## _savage

Well this really looks like a dhcp issue with the 2.6.17 kernel to me.  And I doubt that this issue is caused by an incorrect kernel .config file because even the default configuration fails.  Anyway, both interfaces work fabulously when I assign an IP address and a default gateway manually:

```
root@tigger ~ # grep -E -v '^#|^$' /etc/conf.d/net

modules=( "ifconfig" )

modules=( "iwconfig" )

config_eth0=( "192.168.0.2 netmask 255.255.255.0" )

routes_eth0=( "default via 192.168.0.1" )

config_eth1=( "192.168.0.2 netmask 255.255.255.0" )

routes_eth1=( "default via 192.168.0.1" )

root@tigger ~ # route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.0.1     0.0.0.0         UG    2000   0        0 eth1
```

With this configuration I can bring up either eth0 or eth1, and they work; the routing table doesn't change every few seconds anymore either.  (There's still the 2000 Metric though?  What does that mean?)

Is that a known issue, probably?  I know that the unstable (~ppc) dhcpcd has some issues, but even merging the stable (ppc) version didn't fix it.

----------

## _savage

No more net-misc/dhcpcd for me!  Thanks to this thread I replaced dhcpcd with dhclient, and everything seems to work excellent now...

----------

## wynn

 *Quote:*   

> Thanks to this thread I replaced dhcpcd with dhclient, and everything seems to work excellent now...

 I'm glad you've solved your problem.

 *Quote:*   

> There's still the 2000 Metric though? What does that mean?

 From the "route" manpage

```
Metric The 'distance' to the target (usually counted in  hops).  It  is not  used  by  recent kernels, but may be needed by routing daemons.
```

So it seems to be route's way of saying "don't go that way".

I've just had a look at the output of route here, it is

```
# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0     *               255.255.255.0   U     0      0        0 eth0

192.168.0.0     *               255.255.255.0   U     2000   0        0 ath0

loopback        *               255.0.0.0       U     0      0        0 lo

default         voyager.home    0.0.0.0         UG    0      0        0 eth0
```

ath0 goes to an AP which is a dead end ...

----------

