LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Network card does not work properly (https://www.linuxquestions.org/questions/linux-hardware-18/network-card-does-not-work-properly-4175437570/)

franchukrom 11-17-2012 08:43 AM

Network card does not work properly
 
Hello, All.

I have a very strange problem with my network card. Often when I boot Linux I get this problem:
Code:

DHCPDISCOVER ****
DHCPREQUEST ****
DHCPOFFER ****

in infinite loop. It can't get DHCPACK and retries, retries, retries ...

But I found the way how to make it connect: reboot to Windows, wait Windows to connect to this network, then reboot to Linux. And after this Linux easily connects to this network. Why?

/etc/network/interfaces:
Code:

auto eth0
iface eth0 inet dhcp
hwaddress ether 00:2b:cb:dc:ff:bb

(I need to fake MAC, and this is root of the evil)

My system: Debian GNU/Linux Wheezy.

uname -a: Linux franchuk-r 3.6.2-vanillamy #1 SMP Thu Nov 8 17:57:16 EET 2012 x86_64 GNU/Linux (I have the same problem with Debian's 3.2 kernel and with Liquorix kernel).

My network card: 05:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)

Driver: r8169

// Sorry for my bad English.

hamlindsza 11-18-2012 08:11 AM

Hi,

I guess your DHCP server assigns you an specific IP address based on your MAC.

The key is to change your MAC address before eth0 comes up. To do this, create a file in /etc/network/if-pre-up.d/changemac.sh with the following contents:
Quote:

#! /bin/sh
ifconfig eth0 hw ether 00:2b:cb:dc:ff:bb
Don't forget to give execute permissions to the file by running chmod +x /etc/network/if-pre-up.d/changemac.sh

Hope this helps :)

franchukrom 12-09-2012 01:13 AM

Thanks, that helped.


All times are GMT -5. The time now is 08:54 PM.