Monthly Archives: May 2016

11.4 Ubuntu Realtek Ethernet Fix

Original post is here.  Copied as following:

Ubuntu 11.04 – the Natty Narwhal

A few weeks back I had my on board Realtek PCI express go out. I thought the onboard chip had fried so I installed another Ethernet card a ENLGA-1320 all was well until around 12:00pm today and then flop, no Internet connection from it either. So I started my decent into Google and finally got it working 5 hours later.

Here’s what didn’t work, but things you may try to get it up and working…for it seemed it was working for some just not for me.

A cold start which info was gathered from this thread on it. http://www.uluga.ubuntuforums.org/sh….php?t=1436667

Giving that forum credit by linking it, I will supply the info below:

Cold Start Instructions:

  1. Shut down the machine
  2. Unplug all cables from the tower(The power cable especially)
  3. Hold the power button down for 30 seconds Then Release
  4. Press the button a good time or two for good measure, wait 3 minutes.
  5. Plug all cables back up and press the power button
  6. Internet may or may not be active now.

This didn’t work for me, and if it did not for you lets continue on. This is another post located in the thread linked above, ones again I’ll sum it up. Open a terminal and do the following.

  1. Check the model number of your Ethernet controller:
    :~$ lspci | grep Realtek
    02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express
  2. Check the driver your kernel is loading:
    :~$ lsmod | grep r816*
    r8169 36489 0
    mii 4425 1 r8169
  3. Download the 8168 Linux drivers from RealTek: http://www.realtek.com.tw/downloads/…Cbr%3ERTL8105E
  4. cd to the directory you downloaded the realtek driver:
    :~$ cd Downloads
  5. extract the files:
    :~$ tar -xvf r8168-8.020.00.tar.bz2
  6. cd to the newly extracted folder:
    :~$ cd r8168-8.020.00
  7. Auto compile the driver:
    :~$ sudo ./autorun.sh
  8. I highly doubt this is needed, because at this point my machine restarted its network connection on its own. However I will still include the optional commands to test the driver.
    :~$ sudo rmmod r8169
    :~$ sudo modprobe r8168
    :~$sudo /etc/init.d/networking restart
  9. At this point your network should be up and running, if not do not take the following next two steps.
  10. Blacklist r8169:
    :~$ sudo gedit /etc/modprobe.d/blacklist.conf
  11. Append the following lines:
    #Blacklist Realtek RTL8111/8169 gigabit driver
    blacklist r8169
  12. Save and quit
  13. Update driver cache:
    :~$ update-initramfs -u
  14. Reboot, and see if correct driver has loaded:
    $ lsmod | grep r816*
    r8168 91629 0

Ok so if that worked for you cool, however for me I was ones again met with dismay and had to find another solution. This time around I’m desperate this is my development box, but also sort of mad and just going to do what it takes to get it up and running,

http://www.webupd8.org/2009/06/how-t…our-wired.html

The link above is where most/parts of the following instructions came from, must give credit where credit is due.

  1. Remove any drivers/modules installed i had both r8169 and r8168 installed so in terminal write
    :~$ sudo rmmod r8169
    sudo rmmod r8168
  2. So now I have no eth0 at this point.
  3. Remove network manager:
    sudo apt-get remove network-manager-gnome network-manager
  4. now in terminal type:
    :~$ ifconfig

    all I saw was lo listed and not eth0, again I was lost but I thought what the hey might as well continue on with the instructions that were provided by the link mentioned above.

  5. Set up manually the /etc/network/interfaces in terminal type:
    gksu gedit /etc/network/interfaces
  6. I set up a static IP and even though All that was in the file was
    auto lo
    iface lo inet loopback

    I still appended the following to that file:

    auto eth0
    iface eth0 inet static
    address 192.168.1.10
    netmask 255.255.255.0
    gateway 192.168.0.1

    Change eth0, address, and gateway to your own network values. Save the file and close it.

  7. For the static IP It needed to find the domain name servers(DNS). This is the function of the /etc/resolv.conf file so you need to edit it. If the file doesn’t exist, create it.
  8. In terminal:
    gksu gedit /etc/resolv.conf
  9. In that file place the following:
    nameserver 208.67.222.222
    nameserver 208.67.220.220

    Replace these values with your own DNS values. I just used googles DNS

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    Save and close the file.

  10. Download the 8168 Linux drivers from RealTek: http://www.realtek.com.tw/downloads/…Cbr%3ERTL8105E
  11. cd to the directory you downloaded the realtek driver:
    :~$ cd Downloads
  12. extract the files:
    :~$ tar -xvf r8168-8.020.00.tar.bz2
  13. cd to the newly extracted folder:
    :~$ cd r8168-8.020.00
  14. Auto compile the driver:
    :~$ sudo ./autorun.sh
  15. Now restart the network in terminal :
    :~$ sudo /etc/init.d/networking restart

Ok at this point my pc fully black screened after resetting the network, it was on but no body was home. So I shut it down manually by holding the power button cut it back on and eth0 works perfect now, and that’s the built in one that went out on the mother board first.

Last edited by zxkelxz; January 7th, 2011 at 12:30 AM. Reason: Addition

 

 

Advertisements

%cd% vs %~dp0 in windows cmd

(type in the cmd “Call /?” to check the meaning of %%~dp0)
They are not equivalent.

%cd% is available either to a batch file or at the command prompt and expands to the drive letter and path of the current directory (which can change e.g. by using the CD command)

%~dp0 is only available within a batch file and expands to the drive letter and path in which that batch file is located (which cannot change). It is obtained from %0 which is the batch file’s name.

An experiment like the following shows the difference

Here is D:\dirshow.bat:

Code: [Select]

@echo off
echo this is %%cd%%  %cd%
echo this is %%~dp0 %~dp0

Run it from C:\ and this is what you see

Code: [Select]

C:\>D:\dirshow.bat
this is %cd%  C:\
this is %~dp0 D:\

« Last Edit: April 02, 2008, 09:58:10 AM by Dias de verano »