Enabling USB Ethernet

Started by David Goadby, November 09, 2012, 04:54:28 am

Previous topic - Next topic

David Goadby

November 09, 2012, 04:54:28 am Last Edit: November 10, 2012, 02:19:35 am by David Goadby
I have just "swapped" my A13 from Android to Linux. Ethernet via USB worked superbly on Android and I expected the USB adaptor to be detected automatically and voilĂ  a network connection. However nothing happens.

lsmod does show the asix adaptor as detected and there is an entry in syslog for the USB adaptor showing a MAC address and assignment to eth0. However, ifconfig -a shows eth2 and /etc/network/interfaces only has an entry for eth1. A bit confusing.

- updated.
I added an entry for eth2 in /etc/network/interfaces then the following command will start eth2:

ifconfig eth2 192.168.0.240 netmask 255.255.255.0 up

So far so good. All I need to do now is use change this to use DHCP and make it start automatically at boot-up.

- updated again..

These commands will fire-up the dhcp client and then start the Ethernet interface on eth?. If you don't have a dhcp server (usually your router) then use the first command with the IP address to suit your network.

In my case these commands are for eth2 on my network where I have a dhcp server on 192.168.0.1

dhclient eth2      - start dhcp client. Takes a few seconds sometimes; don't panic.
ifconfig eth2 up   - start the Ethernet port up and use the an address given by dhcp server.

ifconfig - with no parameters will show the network interfaces. If the above worked you will have eth2 and lo
netstat -nr        - will show the gateway address (192.168.0.1 for me).
ping bbc.co.uk     - real proof that you are now connected to the Internet and have access to a DNS server.

Now it works we need make this permanent so the system starts up eth2 at boot up.

Edit /etc/network/interfaces

You need an entry like this:

auto eth2
iface eth2 inet dhcp


The easiest way is to edit the entry for eth0 as this is not used.

My only remaining question is why are we using eth2 when syslog shows the USB adaptor as eth0? For now, I have a network connection that works every time.