Eth0 not recognised

Asked by ikaya

My wireless connection works fine but I cannot access the internet using my wired connection. The options in 'Connection Properties' are wlan0 and lo only. There is no evidence of eth0 where I think it should be. I've tried 'ifdown eth0' and 'ifup eth0' as I saw on another thread but the response is 'interface eth0 not configured'. I'm running Jaunty on a dual boot system with Vista as the other OS and that works OK with the wired connection. Would appreciate some help.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Solved by:
Al Butler
Solved:
Last query:
Last reply:
Revision history for this message
Al Butler (al-butler) said :
#1

Try the following in a terminal:

      cd /etc/network

      sudo nano interfaces

then add the following lines to the interfaces file:

      auto eth0
      iface eth0 inet dhcp

Then press CTRL + X to exit and Y to save changes.

Revision history for this message
ikaya (ikaya) said :
#2

Thank you Al, that seemed to work but then I lost the wireless so had to delete it. Now have wireless back but once more no eth0.

Revision history for this message
Al Butler (al-butler) said :
#3

What are you using to configure your wireless connection? "network-manager-gnome"? What i did was actually remove network manager and configure both connections in /etc/network/interfaces . For some reason I also found this increased the speed of my wireless connection.

Are you using encryption on your wireless connection (WEP/WPA/WPA2 ?)
Do you just connect to one wireless access point or multiple?
And what does your wireless connection show as if you run 'ifconfig' in the terminal (wlan0?)

Let me know this and I can tell you how to set up both connections using the interfaces file rather than the graphical network manager. That might resolve your problem

Revision history for this message
ikaya (ikaya) said :
#4

Thanks Al, sorry for the delay, I've been away for a couple of days.
Yes, I'm using gnome to manage the network (I think) but don't find it very helpful. I'd be happy to follow your advice and do it your way.
No, not using encryption as I've had problems with setting up the WEP for both Jaunty and Vista, I'm using MAC filtering only, but that's another story which may warrant a question/advice.
I connect only to a Netgear DGN2000 ADSL/wireless router and have one other laptop, running XP only.
I've tried to copy and paste the output from 'ifconfig' but it doesn't work. Can you tell me how to do it?
Thanks again.

Revision history for this message
Al Butler (al-butler) said :
#5

Okay before you do these steps just remember that if you remove network-manager and this fails you will have no network connection. If that happens change the interfaces file just to have eth0 configured and you should be able to re-install network-manager via connection on ethernet cable.

To remove network manager:

sudo apt-get remove network-manager
sudo apt-get remove network-manager-gnome

Now edit your /etc/network/interfaces to look like this:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wireless-essid YourWirelessSSID

Let me know if that works for you. If it does I can let you know how to setup encryption also.
If this fails and you need to reinstall network-manager:

sudo apt-get install network-manager network-manager-gnome.

Revision history for this message
ikaya (ikaya) said :
#6

Thanks, I did as you suggested but now eth0 works but wlan0 does not. When I check the Network Connections Properties the Address, Broadcast and Subnet Mask are all wrong.

Revision history for this message
Al Butler (al-butler) said :
#7

When it is set-uop like the above can you do these commands in terminal:

ifconfig

iwconfig

and paste the output of them?

Revision history for this message
ikaya (ikaya) said :
#8

Can do but, short of copying them word by word, is there a way to copy and paste them?

Revision history for this message
Al Butler (al-butler) said :
#9

If you are using gnome terminal, just highlight the text by holding down left mouse button and dragging, once highlighted, right click -> copy.

Revision history for this message
ikaya (ikaya) said :
#10

Thanks. I restored the file to what you suggested but then could not get any internet connection so have reverted to the one for wlan only. Here are the outputs from
ifconfig:
lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:60 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2640 (2.6 KB) TX bytes:2640 (2.6 KB)

wlan0 Link encap:Ethernet HWaddr 00:21:5d:b7:b0:f8
          inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::221:5dff:feb7:b0f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:117 errors:0 dropped:0 overruns:0 frame:0
          TX packets:141 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:43534 (43.5 KB) TX bytes:16513 (16.5 KB)

wmaster0 Link encap:UNSPEC HWaddr 00-21-5D-B7-B0-F8-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING 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)
and ifconfig:
lo no wireless extensions.

eth0 no wireless extensions.

wmaster0 no wireless extensions.

wlan0 IEEE 802.11abgn ESSID:"IKAYA"
          Mode:Managed Frequency:2.442 GHz Access Point: 00:22:3F:55:E8:10
          Bit Rate=1 Mb/s Tx-Power=15 dBm
          Retry min limit:7 RTS thr:off Fragment thr=2352 B
          Power Management:off
          Link Quality=100/100 Signal level:-36 dBm Noise level=-86 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

pan0 no wireless extensions.

I shall try again and let you know.

Revision history for this message
ikaya (ikaya) said :
#11

No, it doesn't work now unless I delete the two lines about eth0 so now I'm back on wireless.

Revision history for this message
ikaya (ikaya) said :
#12

Hi, I've copied the output of the two commands using the amended interface file:

keay@ubuntu:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:1d:ba:87:f2:54
          inet addr:192.168.0.3 Bcast:192.168.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:16

lo Link encap:Local Loopback
          inet addr:127.0.0.1 Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING MTU:16436 Metric:1
          RX packets:344 errors:0 dropped:0 overruns:0 frame:0
          TX packets:344 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:14568 (14.5 KB) TX bytes:14568 (14.5 KB)

wlan0 Link encap:Ethernet HWaddr 00:21:5d:b7:b0:f8
          inet addr:192.168.0.2 Bcast:192.168.0.255 Mask:255.255.255.0
          inet6 addr: fe80::221:5dff:feb7:b0f8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
          RX packets:172 errors:0 dropped:0 overruns:0 frame:0
          TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:24167 (24.1 KB) TX bytes:8787 (8.7 KB)

wmaster0 Link encap:UNSPEC HWaddr 00-21-5D-B7-B0-F8-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING 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)

keay@ubuntu:~$ iwconfig
lo no wireless extensions.

eth0 no wireless extensions.

wmaster0 no wireless extensions.

wlan0 IEEE 802.11abgn ESSID:"IKAYA"
          Mode:Managed Frequency:2.442 GHz Access Point: 00:22:3F:55:E8:10
          Bit Rate=1 Mb/s Tx-Power=15 dBm
          Retry min limit:7 RTS thr:off Fragment thr=2352 B
          Power Management:off
          Link Quality=65/100 Signal level:-60 dBm Noise level=-86 dBm
          Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
          Tx excessive retries:0 Invalid misc:0 Missed beacon:0

pan0 no wireless extensions.

Hope this helps.

Revision history for this message
Al Butler (al-butler) said :
#13

Okay, from looking above it looks like both connections are working. I presume form the above your router has an IP address of 192.168.0.1. and the 2 network cards have IP addresses assigned via DHCP from the router of 192.168.02 and 192.168.0.3 with a mash of 255.255.255.0. If your routers IP address is 192.168.0.1 this is correct. iwconfig shows that the wireless NIC has associated with your wireless access point. When both eth0 and wlan0 were configured in interfaces was eth0 working? and wlan0 not working? When configured as above can you run command:

route

and copy output.

If eth0 works but wlan0 is not working but both work when configured seperately, it sounds like what you need to switch between the 2 interfaces. You can either manually use commands in a terminal to switch on/off network interface cards. Or you could use something such as 'ifplugd' to automatically switch to the network card that has an available connection.

Revision history for this message
Al Butler (al-butler) said :
#14

hmmm maybe i'm being too complex actually. try a package called 'netapplet' install that. the in a terminal run:

netapplet

netapplet should then load everytime you log into gnome. the icon should allow you to choose between network connection eth0 of wireless. It may be worth giving this a go before looking at more complex options like ifplugd.

Revision history for this message
ikaya (ikaya) said :
#15

The problem is that when both are configured I seem to be able to connect to the router with the wireless (it sends and receives packets) but can't get to the internet. The connections time out when I try my email client and browser. What I've now done is to uncomment the eth0 lines and the wireless works fine. I shall re-configure eth0 and run 'route' and post it.
Thanks for your persistence.

Revision history for this message
ikaya (ikaya) said :
#16

This is the output of 'route':
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 1000 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 100 0 0 wlan0
default 192.168.0.1 0.0.0.0 UG 100 0 0 eth0
Thanks, ikaya

Revision history for this message
ikaya (ikaya) said :
#17

In answer to your earlier question, when both eth0 and wlan0 are configured neither works properly. I cannot connect using eth0 (I click on the network icon and change interfaces in 'Connection properties') and wlan0 shows sending and receiving and has found my network but I still cannot get to a website or mail server.
I've installed 'netapplet' and tried to run it but it does not seem to run and I can't find an icon for it.
What next?

Revision history for this message
Launchpad Janitor (janitor) said :
#18

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
ikaya (ikaya) said :
#19

Unfortunately the problem remains unsolved and I am hoping for further advice.

Revision history for this message
ikaya (ikaya) said :
#20

On looking at my inferfaces file I found two lines at the end which I have uncommented:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wireless-essid IKAYA

#iface eth0 inet dhcp

#auto eth0

Have I done the right thing?

I have now managed to get eth0 working by:

sudo ifdown eth0
sudo ifdown wlan0
sudo ifup eth0

and by a similar procedure swapping to wlan0

How do I do this more easily?

Revision history for this message
Best Al Butler (al-butler) said :
#21

Okay try this :)
first of all run command 'sudo apt-get install xdialog'

interfaces should look like this(no other lines needed):

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp
wireless-essid IKAYA

Then create a script to enable wireless called someting like: 'wirelessup.sh'
it should look like this:

#!/bin/bash
gksu ifdown eth0
gksu ifdown wlan0
gksu ifup wlan0

Xdialog --title "Wireless Enabled" \
        --msgbox "Wireless connection has been enabled" 10 41

case $? in
  0)
    echo "OK";;
  255)
    echo "Box closed.";;
esac

And a script to enable eth0 called something like 'wiredup.sh':
#!/bin/bash
gksu ifdown eth0
gksu ifdown wlan0
gksu ifup eth0

Xdialog --title "Wired Connection Enabled" \
        --msgbox "Wired connection has been enabled" 10 41

case $? in
  0)
    echo "OK";;
  255)
    echo "Box closed.";;
esac

then u need to be able to execute the scripts in a terminal go to the same directory you have saved the scripts in and use command:
sudo chmod a+x wirelessup.sh
sudo chmod a+x wiredup.sh

Then you can create a icons on your desktop to run the scripts by right click -> create launcher...

this my first attemp at a bash script so i hope this works :)

Revision history for this message
ikaya (ikaya) said :
#22

Many thanks, I've deleted the last two lines in interfaces and installed xdialog. As a newbie, I need help creating the scripts as I've never done it before. That includes what may be simple things like do I need to leave a space or more at the beginning of some of the lines as in your example? And if so, how do I do that? Sorry if I'm being thick, just not a Linux hand.

Revision history for this message
ikaya (ikaya) said :
#23

HI Al, I've had a go at it and have written both scripts using gedit. I put spaces in to align the letters the same as yours, hopefully that was right? Then I created a launcher for each but am not sure if I got that right - for 'Name' I put in 'Wired up' and 'Wireless up' and for 'Command' the relevant 'sudo chmod ...' then clicked 'OK'. Was that right? I now have two icons on my desktop but nothing happens when I double-click either.
Sorry if I'm being thick. Where do I go from here?

Revision history for this message
ikaya (ikaya) said :
#24

Hi Al, I managed to work out how to get the launchers to find and run the scripts and Fantastic, it works! Thank you so much for your patience and persistence.
My only question now (perhaps I should have asked it a long time ago and perhaps you're the wrong person to ask) is why does Ubuntu not do this automatically?
Anyway, I'm delighted that I can change between the two interfaces so easily. Many thanks again.
ikaya

Revision history for this message
ikaya (ikaya) said :
#25

Thanks Al Butler, that solved my question.