# dhcp works with kernel 2.6.7 but not with newer [SOLVED]

## msl75

Hi

I need some help from You one more time.

I've spent almost whole last week for googling and reading forums and I've found no solution for my problem.  :Crying or Very sad: 

I have gentoo system working with kernel 2.6.7r11. My box has two NICs: eth0 - for my local home network and eth1 which connects me to the internet via dhcp.

The system can see both of them for every kernel version mentioned in the subject:

```

root@tux root # lspci -v | less

(...)

0000:00:08.0 Ethernet controller: Advanced Micro Devices [AMD] 79c978 [HomePNA] (rev 52)

        Subsystem: Advanced Micro Devices [AMD]: Unknown device 2000

        Flags: bus master, medium devsel, latency 32, IRQ 10

        I/O ports at d400

        Memory at dfffbfe0 (32-bit, non-prefetchable) [size=32]

        Capabilities: [40] Power Management version 2

0000:00:0a.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)

        Subsystem: 3Com Corporation 3C905C-TX Fast Etherlink for PC Management NIC

        Flags: bus master, medium devsel, latency 32, IRQ 5

        I/O ports at d000 [size=dffc0000]

        Memory at dfffbf00 (32-bit, non-prefetchable) [size=128]

        Expansion ROM at 00020000 [disabled]

        Capabilities: [dc] Power Management version 2

(...)

```

Drivers to these NICs are compiled as modules and auto-loaded during boot time in the same order for every kernel version:

```

root@tux root # lsmod

Module                  Size  Used by

nvidia               2074952  12

pcnet32                24164  0

3c59x                  34024  0

root@tux root # less /etc/modules.autoload.d/kernel-2.6

# first internal nic

3c59x

# second external nic

pcnet32

nvidia

```

Running net services is added to default boot level. Both net services start for kernel 2.6.7 without any problems:

```

root@tux root # rc-status default

Runlevel: default

  gpm                                                                                                  [ started ]

  xfs                                                                                                  [ started ]

  ntp-client                                                                                           [ started ]

  sshd                                                                                                 [ started ]

  local                                                                                                [ started ]

  squid                                                                                                [ started ]

  vixie-cron                                                                                           [ started ]

  iptables                                                                                             [ started ]

  syslog-ng                                                                                            [ started ]

  domainname                                                                                           [ started ]

  net.eth0                                                                                             [ started ]

  net.eth1                                                                                             [ started ]

  netmount                                                                                             [ started ]

  numlock                                                                                              [ started ]

```

but net service for external NIC doesn't start for kernel 2.6.8 nor 2.6.9:

```

root@tux root # rc-status default

Runlevel: default

  gpm                                                                                                  [ started ]

  xfs                                                                                                  [ started ]

  ntp-client                                                                                           [   off   ]

  sshd                                                                                                 [ started ]

  local                                                                                                [ started ]

  squid                                                                                                [ started ]

  vixie-cron                                                                                           [ started ]

  iptables                                                                                             [ started ]

  syslog-ng                                                                                            [ started ]

  domainname                                                                                           [ started ]

  net.eth0                                                                                             [ started ]

  net.eth1                                                                                             [   off   ]

  netmount                                                                                             [ started ]

  numlock                                                                                              [ started ]

```

For kernel 2.6.7 dhcp receives everything in 1 or 2 seconds and all NICs are up:

```

root@tux root # ifconfig

eth0      Link encap:Ethernet  HWaddr (...)

          inet addr:172.18.0.1  Bcast:172.18.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:5 Base address:0xd000

eth1      Link encap:Ethernet  HWaddr (...)

          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:100 txqueuelen:1000

          RX bytes:545389 (532.6 Kb)  TX bytes:69050 (67.4 Kb)

          Interrupt:10 Base address:0xd400

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:200 (200.0 b)  TX bytes:200 (200.0 b)

```

but for kernel 2.6.8 and 2.6.9 dhcp doesn't receive anything and eth1 is down:

```

root@tux root # ifconfig

eth0      Link encap:Ethernet  HWaddr 00:0A:5E:3E:B4:2C

          inet addr:172.18.0.1  Bcast:172.18.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000

          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

          Interrupt:5 Base address:0xd000

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:200 (200.0 b)  TX bytes:200 (200.0 b)

```

but I can set it up manually, so pcnet32 module works:

```

root@tux root # ifconfig eth1 up

root@tux root # ifconfig

(...)

eth1      Link encap:Ethernet  HWaddr 00:50:FC:1E:00:89

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:100 txqueuelen:1000

          RX bytes:545389 (532.6 Kb)  TX bytes:69050 (67.4 Kb)

          Interrupt:10 Base address:0xd400

(...)

```

Starting this service manually has the same effect.

Starting dhcpcd manually for eth1 gave me info, that dhcpcd is working but it didn't receve anything from the server and it gave up - I've checked with afew longer timeouts - it simply doesn't receive anything. Below is example for 20 seconds

```

Jan 10 22:02:34 tux dhcpcd[8395]: broadcasting DHCP_REQUEST for 192.168.1.3

Jan 10 22:02:54 tux dhcpcd[8395]: timed out waiting for DHCP_ACK response

Jan 10 22:02:54 tux dhcpcd[8395]: broadcasting DHCP_DISCOVER

Jan 10 22:03:14 tux dhcpcd[8395]: timed out waiting for a valid DHCP server response

```

I used the same kernel config file to compile all versions of kernel: 2.6.7, 2.6.8 and 2.6.9. I've checked all options - they are the same.  :Confused: 

Do You have any idea what could be wrong and how can I force it to work?  :Question: 

I am waiting for Your suggestions.

Greetings

MaciekxLast edited by msl75 on Tue Jan 18, 2005 8:03 pm; edited 2 times in total

----------

## agent_jdh

2.6.8 and 2.6.9 have a bad rep for being decidedly dodgy, 2.6.10 is out so you could give that a try.

----------

## asiobob

probably a TCP/IP window resizing issue, The server or a router in front of those services you say may be broken and dropping packets

To go back to the default window size with the newer kernels try

```
   

 echo 0 > /proc/sys/net/ipv4/tcp_default_win_scale 

```

or by adding a line like:

```
   

    net.ipv4.tcp_default_win_scale = 0

```

to /etc/sysctl.conf.

----------

## msl75

Hi

Thank You for Your suggestions.

1) I've checked this:

 *Quote:*   

> 
> 
> ```
> 
> echo 0 > /proc/sys/net/ipv4/tcp_default_win_scale
> ...

 

and I already had set ZERO in this file.

2) I've checked also this:

 *Quote:*   

> 
> 
> ```
> 
> net.ipv4.tcp_default_win_scale = 0
> ...

 

there wasn't anything like that, so I added this line. But after reboot to 2.6.9 - still the same problem - no connection via dhcp.

3) I've emerged gentoo-dev-sources for 2.6.10.r4 and compiled them with the same kernel config, after reboot - the same effect - no connection via dhcp.

So, I have no idea at this moment, what is wrong, but I feel that it is configuration problem or something like that.  :Confused: 

What do You think now?

Maciek

----------

## msl75

Hi

I've spend a few huors googling for the solution, and I found a few places, with information, that gentoo some time ago changes syntax of /etc/conf.d/net config. Is that true? Maybe this is a problem? Below I put the content of my /etc/conf.d/net file. Could anybody write if it is correct?

```

# /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

iface_eth0="172.18.0.1 broadcast 172.18.0.255 netmask 255.255.255.0"

iface_eth1="dhcp"

dhcpcd_eth1=" -d -t 10"

```

With kernel 2.6.7r11 it seems to be working, so I am not sure.

Thank You

Maciek

----------

## agent_jdh

I use ~x86, and recently there was a change in the /etc/conf.d/net behaviour - if you just leave an interface unconfigured, it assumes dhcp so you might want to try that.

Also what dhcp client do you use?  I use dhcpcd here.

----------

## msl75

Hi

I also use dhcpcd (dhcpcd-1.3.22_p4-r5).

I tried with eth1 unconfigured, and it said, that I have to use ifcace_eth1 or ifconfig_eth1. So I've tried with ifconfig_eth1 - it accepted this, but effect was the same - it didn't receive anything from dhcp server  :Sad: . So I restored previous settings syntax.

Still - no idea.

Maciek

----------

## msl75

Sorry about that, but I still have this problem.   :Sad: 

Maciek

----------

## msl75

Hi

I would like to inform You that I've solved this problem. My friend told me to check the ChangeLog of the kernel which was the first where my problem has appeared. So I've checked the ChangeLog: http://kernel.org/pub/linux/kernel/v2.6/testing/ChangeLog-2.6.8-rc1

and I've found that the new optional parameter named homepna was introduced for pcnet32 module what I use for my nic with DHCP. Default value for this parameter is 0 which means that nic should work in a standard ethernet mode, but when the card should work in HomePNA mode the homepna=1  parameter should be passed to pcnet32 module in /etc/modules.autoload.d/kernel-2.6 file:

```

# /etc/modules.autoload.d/kernel-2.6:  kernel modules to load when system boots.

# internal nic

3c59x

# external nic

pcnet32 homepna=1

```

Nowadays everything works fine. (Except my Cisco VPN client, which never has worked yet, but it is not in the scope of this thread).

So, thank You for the help.

Greetings

Maciek

----------

## kotik

I'm having a smililar problem. I am a total noob when it comes to linux so I dont know what a DHCP is, but I think the problem is my router. 

```

eth0      Link encap:Ethernet  HWaddr 00:50:FC:1E:00:89 

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1 

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

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

          collisions:100 txqueuelen:1000 

          RX bytes:545389 (0.0 Kb)  TX bytes:69050 (0.0 Kb) 

          Interrupt:10 Base address:0xd400 

(...) 
```

I copy pasted this from this thread but when i type ifconfig this is what the result is like.

[RX bytes:545389 (0.0 Kb)  TX bytes:69050 (0.0 Kb)]

I was wondering why it shows 0.0 kb in TX and RX bytes? Obviously the network card (which is built-in) has been detected but I cannot connect to the internet. What could the problem be?

Thanks in advance

Mike

----------

## msl75

Hi

DHCP is a software which connects to DHCP server (DHCP deamon which is running on the router what You are behind) and requests for the IP addres for You. If You are allowed to get one, it dynamiccaly assigns the IP address for You from the range of IP addresses.

I can't tell You if You shoud use it or not - ask Your ISP, or try to run dhcpcd, if You get the IP it means that You should use it.  :Wink: 

You have to configure You net service to start it just after booting.

Please refer to gentoo handbook to read how to do that: http://www.gentoo.org/doc/en/handbook/2004.3/handbook-x86.xml?part=1&chap=3

Good luck.

Maciek

----------

