# Networking over usb0 doesn't work.

## chris_andrew

Hi, all.

Thanks to the assistance here of poly_poly-man, I now have a bootable Gentoo box  :Smile: .

My network connection goes from my USB socket to my hub.

My networking isn't currently working, so I wondered if anyone could tell me how I can get usb0 to work.  dmesg shows that (as you would expect), eth0 is trying to get a dhcp address.  I don't have a cable into eth0, so this times-out.

Can anyone help me configure usb0?

Cheers,

Chris.

----------

## poly_poly-man

dhcp?

try:

ln -s /etc/init.d/net.lo /etc/init.d/net.usb0

/etc/init.d/net.usb0 start

If it's not dhcp, set up /etc/conf.d/net before those steps.

----------

## chris_andrew

Sorry, I should have said, I'm using dhcp.

Unfortunately, eth0 tried to start on boot, and my usb0 doesn't appear when I do ifconfig, I just see eth0 and lo.

Sorry I'm being such a pain.

Chris.

----------

## poly_poly-man

ifconfig -a?

----------

## chris_andrew

ifconfig -a:

eth0 has an ipaddress...strange, as not being used.

lo

sit0 (ipv6 over ipv4, by the looks of it).

I'm unable to ping the internet (host unreachable).

----------

## poly_poly-man

eth0 probably has a zeroconf address - ignore.

The driver is in the kernel? the module is loaded if it's there?

What does dmesg say about it?

----------

## chris_andrew

I'll grep dmesg for usb.  I think the module I need is cdc_ether.

usb appears in dmesg, so something is working.  It sees my usb sockets, but doesn't realise that the network is running into one of them.

----------

## chris_andrew

Hi,

I've been Googl'ing my problem, and think I need to activate cdc_ether and usbnet, in my kernel.  I've done menuconfig, but can't find them anywhere.

I thought they should be in:

Device drivers > USB support > USB Network adaptors, but I can't find them anywhere.  

Does anyone know where these items live?

Cheers,

Chris.

----------

## pappy_mcfae

Make sure you have

```
General setup ---> [*] Prompt for development and/or incomplete code/drivers
```

set so you can get to experimental drivers. 

Once that's done, you can find USB network devices under

```
Device Drivers ---> [*] Network device support ---> USB Network Adapters --->
```

 and make your selection from there.

If you have X windows setup, I suggest trying make xconfig. It looks prettier, and you can maneuver easier.

Blessed be!

Pappy

----------

## chris_andrew

Pappy,

Thanks for that.  Just done that and recompiling, now.  I haven't got as far as X yet, I wanted to get my first successful install working properly, before I start emerging things.

Cheers,

Chris.

----------

## chris_andrew

Hmmm,

Recompile done and rebooted.  Unfortunately, eth0 still tries to get a DHCP IP address and then times out (as I'd expect). I guess I need to tell Gentoo to stop looking for eth0 and to use usb0.  If anyone knows how I can do that, some help would be appreciated.

Many thanks,

Chris.

----------

## poly_poly-man

 *chris_andrew wrote:*   

> Hmmm,
> 
> Recompile done and rebooted.  Unfortunately, eth0 still tries to get a DHCP IP address and then times out (as I'd expect). I guess I need to tell Gentoo to stop looking for eth0 and to use usb0.  If anyone knows how I can do that, some help would be appreciated.
> 
> Many thanks,
> ...

 

baselayout-1 (for arch):

config_eth0=( "null" )

baselayout-2/openrc (for ~arch):

config_eth0="null"

You'd think you could just stop it, but net.eth0 provides some services that you need... don't ask.

----------

## chris_andrew

Poly,

My broadband just came back-up.

Thanks for the words of advice.  I'm afraid I don't know which file these entries would go into.  Could you be a bit more specific for someone new to Gentoo?

Cheers,

Chris.

----------

## poly_poly-man

 *chris_andrew wrote:*   

> Poly,
> 
> My broadband just came back-up.
> 
> Thanks for the words of advice.  I'm afraid I don't know which file these entries would go into.  Could you be a bit more specific for someone new to Gentoo?
> ...

 

/etc/conf.d/net

----------

## chris_andrew

Unfortunately I got syntax errors on reboot, to do with arch.  Is that a variable, that I should substitute?

----------

## poly_poly-man

 *chris_andrew wrote:*   

> Unfortunately I got syntax errors on reboot, to do with arch.  Is that a variable, that I should substitute?

   :Shocked: 

just use the one line that looks like the other lines (regarding the parentheses) in /etc/conf.d/net...

----------

## chris_andrew

Checking accuracy of file, after my reboot..

----------

## chris_andrew

Syntax error Line 6 near unexpected token 'for'.

Unfortunately in the past, it's this sort of strange config error that makes me go back to Debian.  I really want to succeed this time, as 4 years of trying is getting a bit silly  :Smile: 

----------

## poly_poly-man

post the config file... did you put anything besides the "config...." line?

----------

## chris_andrew

As my network is dead, I'd have to copy it by hand, which would surely be scope for more errors.  Al I put in the file, was what you mentioned.

I put the two baselayout lines, also. Was that correct?

----------

## poly_poly-man

 *chris_andrew wrote:*   

> As my network is dead, I'd have to copy it by hand, which would surely be scope for more errors.  Al I put in the file, was what you mentioned.
> 
> I put the two baselayout lines, also. Was that correct?

 

nope... see, I should have been more clear..  :Embarassed: 

If you have baselayout version 1 (the entries in /etc/conf.d/net has parentheses) put the following line in your /etc/conf.d/net:

```
config_eth0=( "null" ) 
```

If the lines don't have parentheses:

```
config_eth0="null"
```

----------

## chris_andrew

I'll try both as not sure which baseline I have.

Many thanks for explaining.  :Smile: 

----------

## chris_andrew

Well I went for option 2 and eth0 didn't try to get a DHCP address.  Looks like it worked.  Still no usb0, though.

----------

## poly_poly-man

 *chris_andrew wrote:*   

> Well I went for option 2 and eth0 didn't try to get a DHCP address.  Looks like it worked.  Still no usb0, though.

 

not even in ifconfig -a?

make sure ALL the correct drivers are in the kernel (or if they are modules, load the modules).

----------

## pappy_mcfae

 *chris_andrew wrote:*   

> Pappy,
> 
> Thanks for that.  Just done that and recompiling, now.  I haven't got as far as X yet, I wanted to get my first successful install working properly, before I start emerging things.
> 
> Cheers,
> ...

 

You're most welcome. And I agree, it's always best to tweak and/or fix one thing at a time. 

Good luck and happy Gentooing!

Blessed be!

Pappy

----------

## chris_andrew

Still haven't got usb0 working (all kernel bits are done).  So close, yet so far.....

----------

## pappy_mcfae

Please post the results of lsusb and ifconfig -a.

Blessed be!

Pappy

----------

## chris_andrew

Hi,

lsusb...command not found.  I guess I can't emerge it without a network connection, unless it's on the CD image.

ifconfig -a:

eth0: No IP address as expected, as we've told Gentoo not to get one.

lo:  127.0.0.1 (as expected)

sit0: IPv6 in IPv4 (no IP address)

I hope this helps.

Thanks,

Chris.

----------

## poly_poly-man

 *chris_andrew wrote:*   

> Hi,
> 
> lsusb...command not found.  I guess I can't emerge it without a network connection, unless it's on the CD image.
> 
> 

 emerge usbutils *Quote:*   

> 
> 
> ifconfig -a:
> 
> eth0: No IP address as expected, as we've told Gentoo not to get one.
> ...

 

looks like you don't have the correct drivers for your usb network device, or it's not plugged in right, or it's not set up right, etc. What does lsusb say?

----------

## abhinav420420

If you have X windows setup, I suggest trying make xconfig. 

moreover do you have the drivers correct

thanks

----------

