# RTL8153 Ethernet Adapter on PfSense



## Manos Zoumpoulakis (Aug 15, 2016)

Hello everyone.

I am new to FreeBSD and PfSense.
I have purchased a TP-LINK UE300 USB-to-Ethernet Adapter to use with my PfSense router, which is not recognized as a network interface.
I read this http://lists.freebsd.org/pipermail/freebsd-net/2015-June/042396.html and using "usbconfig -d X.Y set_config 1" Pfsense can see it as a network adapter.
However, after reboot or power loss, it returns to the previous condition.
How can I make the command permanent or to run automatically on every boot?

Thank you in advance.


----------



## ondra_knezour (Aug 15, 2016)

rc.conf(5), however I don't know to which extend it can be applied to the pfSense.


----------



## Murph (Aug 15, 2016)

PC-BSD, FreeNAS, NAS4Free, and all other FreeBSD Derivatives

Although pfSense is derived from FreeBSD, there are major differences in important areas, such as configuration.  You should ask on their forum first, as the people there are much more likely to know the correct mechanism for cleanly configuring it.


----------



## Murph (Aug 15, 2016)

I got curious about this, so I'll give you a partial fix for it on FreeBSD, which might help someone else who is actually trying to do this on FreeBSD.  All of the following is specific to FreeBSD, and might either not work or cause problems on pfSense.

The correct place is loader.conf(5) / /boot/loader.conf, where something similar to the following is needed.  See usb_quirk(4) for details, and how to fill in the variables correctly.

```
hw.usb.quirk.0="VendorId ProductId LowRevision HighRevision UQ_CFG_INDEX_1"
```

Those IDs and revisions need to be replaced with the appropriate numbers (I believe they are all normally 16-bit numbers, similar to PCI) specific to your device.  Use usbconfig(8) and its various dump options to find the correct numbers.  E.g. something like the following (fictitious ID numbers for example purposes, and enabled for all possible revisions):

```
hw.usb.quirk.0="0x1234 0x5678 0 0xffff UQ_CFG_INDEX_1"
```

If you already have any USB quirks in /boot/device.hints or /boot/loader.conf, you need to pick the next unused number/index, as described in usb_quirk(4).  I'm not 100% certain that UQ_CFG_INDEX_1 is the specific quirk needed here, but it looked like a good possibility.

Don't blindly apply this to any FreeBSD derivatives, it could easily result in a system which refuses to boot, or break something else in the general area of kernel and devices.  Usual BSD warranty applies, i.e. you own any problems caused by the above.


----------



## Thiago Fiori (Oct 20, 2017)

I was able to solve it differently,

Using PfSense 2.4.0 was and changed the file in /conf/config.xml, according to the documentation https://doc.pfsense.org/index.php/Executing_commands_at_boot_time it is possible to add command when starting the system.
So my file looks like this:


```
<? xml version = "1.0"?>
<pfsense>
   <version> 17.0 </ version>
   <lastchange> </ lastchange>
   <system>
     <optimization> normal </ optimization>
     <hostname> pfSense </ hostname>
     <domain> localdomain </ domain>
     <dnsserver> </ dnsserver>
     <dnsallowoverride> </ dnsallowoverride>
     <earlyshellcmd> usbconfig -d 4.2 set_config 1 </ earlyshellcmd>
     <group>
```

Then when saving just delete the file in memory `rm /tmp/config.cache` as  https://doc.pfsense.org/index.php/How_can_I_reload_the_config_after_manually_editing_config.xml

Now every time I turn off or restart the modem, it is already up properly.


----------



## toorski (Jan 2, 2019)

And, after a year + few months later, still works in OpnSense-18.7.9/FreeBSD-11.1 with USB TP-Link UE300


Murph said:


> I got curious about this, so I'll give you a partial fix for it on FreeBSD, which might help someone else who is actually trying to do this on FreeBSD. All of the following is specific to FreeBSD, and might either not work or cause problems on pfSense.


Thanks for your curiosity!


----------



## aroldobossoni (Jan 7, 2019)

I used the following command to search and activate the USB network interface. I had problems when I plugged in another USB device, the order of the devices was changed.


```
<earlyshellcmd> usbconfig -d `usbconfig list | grep "TP-LINK USB 101001000 LAN" | cut -c5-7` set_config 1 </earlyshellcmd>
```


I found the interface name string "TP-LINK USB 101001000 LAN" with the command `usbconfig list`


----------

