# Can't use Realtek usb to ethernet card on usb hub to connect to internet on FreeBSD



## anon101 (Jun 14, 2019)

Hi, 
I just joined the forum here after installing BSD, the actual process and everything went fine.
But I'm absolutely unable to get anywhere with getting internet through my usb dongle.
I've tried a veriety of things, listed below (all with no luck, under root):

Adding if_cdee_load="YES" , if_re_load="YES", if_rue_load="YES" to /boot/loader.conf (read somewhere that they may be needed).

Using `ifconfig -a` to find the device and then `dhclient blahblahblah` to set it up

Using `dmesg` to get information on the device

`ping google.com` to make sure the internet isn't working (I get host name lookup failure)

Unplug and replug hub before using `dhclient` again

Trying `usbconfig` to get info on usb device

Tried `usbconfig -d X.Y set_config 1` from https://lists.freebsd.org/pipermail/freebsd-net/2015-June/042396.html
For more info on this one I think I've entered my X.Y wrong, as now in ifconfig one less entry appears (which I believe was the usb to ethernet adapters one)

Also on startup I did get a message before:
ure0 on uhub 2
ure0: <Realtek USB 10/100/1000 LAN, class 0/0. rev 3.00/30.00. addr 8> on usbus0
miibus1: <MII bus> on ure0
rgephy1: <RTL8251/8153 1000BASE-T media interface> PHY0 on miibus1
rgephy1: none, 10baseT, 10baseT-FDX, 100baseTX, 1000baseTX-FDX, 1000baseT-FDX, 1000baseT-FDX-master, auto

Although the last 2-3 there may be because off a bluetooth error (I can't tell, but there is one later on at startup, however I don't even use bluetooth so I don't care much if it's not working).

Thanks for any help/support, I really appreciate it!


----------



## George (Jun 14, 2019)

Hey, welcome to the forum.
Output of `ifconfig` would be helpful.


----------



## SirDice (Jun 14, 2019)

anon101 said:


> Adding if_cdee_load="YES" , if_re_load="YES", if_rue_load="YES" to /boot/loader.conf (read somewhere that they may be needed).


I'm not sure where you got `if_cdee` from, it doesn't seem to exist. Adding if_re shouldn't be needed, it's already in GENERIC by default. But it's a driver for PCI/PCIe cards. if_rue(4) is a different Realtek chipset. Looking at the log output you posted, you need if_ure(4). 



anon101 said:


> Although the last 2-3 there may be because off a bluetooth error


No they're part of if_ure(4). A lot of network card drivers in FreeBSD make use of an abstraction layer called miibus(4), this avoids a lot of code duplication if every network driver had to do on its own. 

As Elazar already noted, please post the output of `ifconfig`. Please also post the output of `uname -a` so we know what version you have.


----------



## anon101 (Jun 18, 2019)

SirDice said:


> I'm not sure where you got `if_cdee` from, it doesn't seem to exist. Adding if_re shouldn't be needed, it's already in GENERIC by default. But it's a driver for PCI/PCIe cards. if_rue(4) is a different Realtek chipset. Looking at the log output you posted, you need if_ure(4).
> 
> 
> No they're part of if_ure(4). A lot of network card drivers in FreeBSD make use of an abstraction layer called miibus(4), this avoids a lot of code duplication if every network driver had to do on its own.
> ...


ifconfig Output: 








						ifconfig output - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				




uname -a Output:
FreeBSD MyPC 12.0-RELEASE-p4 FreeBSD 12.0-RELEASE-p4 GENERIC  amd64


----------



## anon101 (Jun 18, 2019)

Elazar said:


> Hey, welcome to the forum.
> Output of `ifconfig` would be helpful.


Here: 








						ifconfig output - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com


----------



## tommiie (Jun 18, 2019)

anon101 said:


> ping google.com to make sure the internet isn't working (I get host name lookup failure)


Ping an IP address first, preferably your default gateway. Then a device behind your default gateway. A name lookup failure indicates a problem with DNS, not with your network card or your IP configuration.

Please do some basic troubleshooting as above and include the output of these steps, including your configuration and output of `ifconfig` or other useful commands and files, e.g. /etc/resolv.conf.


----------



## George (Jun 18, 2019)

Your `ifconfig` output shows

```
re0: flags=...
 status: no carrier
 
 ue0: flags=...
 status: no carrier
```

My guess is that /etc/rc.conf needs these lines:

```
ifconfig_re0="DHCP"
ifconfig_ue0="DHCP"
```
Then do `service netif restart` to test the settings.


----------



## SirDice (Jun 18, 2019)

"No carrier" means there's no cable connected.


----------



## anon101 (Jun 18, 2019)

SirDice 
There definately is a working cable attached.
The internet works fine through it in my arch linux install.


----------



## anon101 (Jun 18, 2019)

I've tried this multiple times, with no luck.
Here's the output off doing it:








						netif restart - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com


----------



## anon101 (Jun 18, 2019)

I can't actually ping them:
If I try and ping my default gateway, 192.168.1.1 I get `sendto: No route to host`

The output of netstat -r:








						netstat - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				




The output of ifconfig:








						ifconfig output - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				




The output of `dhclient ue0`:
`ue0: no link .............. giving up`

The output of /etc/resolv.conf








						/etc/resolve.conf - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com


----------



## SirDice (Jun 18, 2019)

No amount of configuration is going to change "no carrier". If there's really a good cable connected then the network card or the driver isn't detecting a signal. Without a carrier signal it will be useless to try to configure it.


----------



## anon101 (Jun 18, 2019)

SirDice said:


> No amount of configuration is going to change "no carrier". If there's really a good cable connected then the network card or the driver isn't detecting a signal. Without a carrier signal it will be useless to try to configure it.


So what I'm confused about is where FreeBSD is going wrong then.
Because there is a cable with a good connection which my arch linux install can use, so is it the driver then?


----------



## SirDice (Jun 18, 2019)

Realtek has a tendency to change their hardware without changing the identification. So the card may be correctly detected but not configured correctly because it's a slightly different design.


----------



## anon101 (Jun 18, 2019)

SirDice said:


> Realtek has a tendency to change their hardware without changing the identification. So the card may be correctly detected but not configured correctly because it's a slightly different design.


I keep getting this error message btw:
`ure0: timeout waiting for chip autoload`

So what should I do now?


----------



## Phishfry (Jun 18, 2019)

anon101 said:


> ue0: no link .............. giving up


What I don't understand is why you are using this in /etc/rc.conf:
`"ifconfig_ue0=DHCP"`

When you should be using ure0. For instance in /etc/rc.conf:
`ifconfig_ure0="DHCP"`
and in /boot/loader.conf:
`if_ure_load="YES"`


----------



## Phishfry (Jun 18, 2019)

anon101 said:


> I keep getting this error message btw:
> ure0: timeout waiting for chip autoload
> 
> So what should I do now?


This is because the firmware is not loaded. Add the two settings above and report back.


----------



## anon101 (Jun 19, 2019)

Phishfry said:


> This is because the firmware is not loaded. Add the two settings above and report back.


Ok, I've just tried, now the above error isn't coming up but is still shows the same `ifconfig` results, as shown here:








						ifconfig after - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com
				




Thanks for the help, I feel like I'm starting to get somewhere with this now

EDIT: here is the output of [cnd]dmesg -a[/cmd], it may be useful








						dmesg -a - Pastebin.com
					

Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.




					pastebin.com


----------

