randombio.com | computer notes
Saturday, March 21, 2020. Edited mar 26 2020

How to set up a BrosTrend AC3L 1200MBps USB wireless card in Debian Linux 9.9

Tested working procedure using a USB wireless card

I tried several different USB WiFi adapters with little success. This adapter worked very well, but the instructions that came with it were incomplete.

In this example my interface was named wlx7ca7b0ae8663. On other computers it will be different, possibly wlan0.

  1. Install the driver from the vendor's website using the command line in the manual on the tiny CD that comes with the adapter. This will be something like:

    sh -c 'wget deb.trendtechcn.com/installer.sh -O /tmp/installer.sh && sh /tmp/installer.sh'

    Notice that this means you need to have wired networking functional first. It may ask for your Debian installation binary DVD #1. A driver is also included on the vendor's CD. I did not test this one.

  2. Verify that the driver is recognized by typing /sbin/ifconfig. Make a note of the interface name that is printed.

  3. Set as many parameters as possible in Network Manager, which (at least in xfce) is in the menu under Settings—Network connections. The BSSID is the MAC address of the wireless access point. The Device (i.e., interface name) should be selectable from the submenu. Set the security to match your wireless access point, WPA2 is preferred. If it's a home network, all that's needed is your SSID and password. On an enterprise network, you'll need more settings depending on how they configured it. Most often, the mode will be "PWD", which requires only your assigned network username and password.

    Here is where you can most easily enter your static IP. Depending on how competent your corporate IT is, you might also need to set the IP of the DNS server, the gateway, and a route.

    This completes your basic networking, but you will not have a connection yet. More manual steps are needed to get the interface up.

  4. Become root

  5. Make sure iw is installed from your source media, then type

    /sbin/iw dev

    It will say something like:

      phy#0
    	Interface wlx7ca7b0ae8663
    		ifindex 3
    		wdev 0x1
    		addr 22:1d:69:bc:be:2e
    		type managed
    		txpower 12.00 dBm 
    This means the interface is recognized as a wifi and gives you its MAC address.
  6. If you're on a corporate network, you need to turn off MAC address randomization so you can ask your IT department to let your MAC address on the network. According to the networkmanager.conf man page, this can be done in NetworkManager itself or by editing the appropriate file in
    /etc/NetworkManager/system-connections/, such as
    /etc/NetworkManager/system-connections/"Wi-Fi connection 1"
    and setting
    wifi.scan-rand-mac-address=no
    in the section [wifi].

    If you need to change your MAC address, this series of commands (executed LOCALLY as root) will do it:

    In the example below 7c:a7:b0:ae:86:63 is the new MAC address. It's not desirable to change the first three octets as they indicate the hardware manufacturer; sometimes this is useful diagnostic information. It's a good idea to record the original MAC address down somewhere.

    ifconfig wlx7ca7b0ae8663 down
    ifconfig wlx7ca7b0ae8663 hw ether 7c:a7:b0:ae:86:63
    /etc/init.d/networking restart

    Note that these commands must be issued locally, as all network connections will become inaccessible, including wired ones. ifconfig wlx7ca7b0ae8663 up doesn't work—you must re-start the networking.

    ip link set dev wlx7ca7b0ae8663 down
    ip link set dev wlx7ca7b0ae8663 address 7c:a7:b0:ae:86:63
    /etc/init.d/networking restart
    also works.

  7. Check whether we're up yet by typing

    ip addr

    It will say something like:

    wlx7ca7b0ae8663: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 22:1d:69:bc:be:2e brd ff:ff:ff:ff:ff:ff

    This means it's not up, but at least the OS recognizes the interface.

  8. Check the /etc/network/interfaces file and make sure your interface, SSID, and preshared key are correct. Here is a sample file for a static IP.

         source /etc/network/interfaces.d/*
    
         # The loopback network interface
         auto lo wlx7ca7b0ae8663
         iface lo inet loopback
         iface wlx7ca7b0ae8663 inet static
    	     address 192.168.100.34
    	     gateway 192.168.100.10
    	     wpa-ssid your-ssid-here
    	     wpa-psk  your-wpa2-key-here
      

    The 'auto' line is a list of interfaces to be activated automatically. Each interface then gets a section, with its parameters indented by a tab.

  9. See if you're lucky and the interface comes up.

    ip link set wlx7ca7b0ae8663 up

    followed by ip addr again.

  10. You can also set the passphrase manually if for some reason Network Manager didn't allow you to enter the correct one.

    wpa_passphrase your-ssid your-passphrase

  11. Type this command to get more information on your wireless card, including signal strength, frequency, and WPA cipher.

    iw wlx7ca7b0ae8663 scan

  12. If it's still not up, restarting the networking is preferred because it gives you accurate and useful error messages. This is such a unique thing it's worth trying it just for the novelty of it.

    /etc/init.d/networking restart

    If it works, it will say:

    [ ok ] Restarting networking (via systemctl): networking.service.

    If it doesn't work, it will print a number of instructions for you to follow, for example:

    Failed to initialize control interface '/run/wpa_supplicant'.
    You may have another wpa_supplicant process already running or the file was left by an unclean termination of wpa_supplicant in which case you will need to manually remove this file before starting wpa_supplicant again.

  13. It should be working now. If not, check for problems in wpa_supplicant. If you have two or more running, it will be screwed up. If any wpa_supplicant is running, kill process and re-start the network as in the previous step.

    ps -aux | grep wpa_supplicant

    It will say something like:

    root 3202 0.0 0.0 46360 3208 ? Ss 18:34 0:00 /sb in/wpa_supplicant -s -B -P /run/wpa_supplicant.wlx7ca7b0ae8663.pid -i wlx7ca7b0ae8663 -D nl80211,wext -C /run/wpa_supplicant

    The process number in this case was 3202. Type kill 3202

    Only run this next command if the networking restart command failed.

    wpa_supplicant -B -i wlx7ca7b0ae8663 -c /run/wpa_supplicant.conf

    It will say:

    Successfully initialized wpa_supplicant

    Sometimes wpa_supplicant.conf is in /etc, sometimes it's in /etc/wpa_supplicant, and sometimes it's in /run and sometimes it's in /etc/dbus-1/system.d/. Sometimes it's in all these places. See the man page for what's supposed to be in it. Normally you shouldn't have to touch this file.

  14. If successful, /sbin/ifconfig will say that the link is up and show its assigned IP address.

      wlx7ca7b0ae8663: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.100.34  netmask 255.255.255.0  broadcast 
               192.168.100.255
            ether 16:6d:66:3d:f1:c8  txqueuelen 1000  (Ethernet)
            RX packets 76  bytes 9216 (9.0 KiB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 28  bytes 3670 (3.5 KiB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  
  15. If you're on a corporate network, a message box should pop up asking you for your credentials.

  16. Test from another computer by pinging the WiFi interface:

    ping 192.168.100.34
    PING 192.168.100.34 (192.168.100.34) 56(84) bytes of data.
    64 bytes from 192.168.100.34: icmp_seq=1 ttl=64 time=1.19 ms
    64 bytes from 192.168.100.34: icmp_seq=2 ttl=64 time=0.877 ms
    64 bytes from 192.168.100.34: icmp_seq=3 ttl=64 time=0.820 ms

    If you also have a wired interface, make sure that one still works.


On the Internet, no one can tell whether you're a dolphin or a porpoise
mar 21, 2020

back

to top