Website Migration Guides
A simple free resource for website migration
Ok, so recently I had an issue with my lovely unifi system dropping download / upload speeds. I have a VDSL2 connection from EE (aka BT) and the first thing I thought I would do is see what my line's up/down sync speeds were on the DrayTek Vigor 130 modem. Now, I was going to remove the ethernet cable from my Unifi USG and hook my PC directly up to the Vigor 130. However, I remembered a visitor to this site had commented on my other Vigor 130 setup guide regarding allowing the LAN to access the Draytek Vigor 130 directly (so no need to mess about swapping cables). As such, I thought I would give it a try and document it here.
Now, before you jump straight into the below steps, it's worth noting that this guide assumes your DrayTek's modem IP is 192.168.2.1 and your USG has the usual 192.168.1.1/24 Gateway/Subnet. If you have changed these yourself, you will need to modify the steps accordingly.
Ok, so lets get started.
Step 1 : Download putty
The first thing you will need is a SSH client such as Putty (https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html). Once you have downloaded it, open it up from a computer that is on the network which is hooked up to your USG.
Step 2 : Connect to your Ubiquiti USG via SSH
Open up putty and put the IP of your USG in the hostname box. This is usually 192.168.1.1 with port 22. Then click "Open" at the bottom.
Step 3: Log in to the Unifi USG
Enter your username and password as requested. If you do not know your USG SSH login details, they can be found via the controller admin under Setting > Site > "Device Authentication". If you have not altered your USG from default, the username and password will be 'ubnt'.
Step 4: Create the Pseudo Interface
Once you have logged in, copy the below text and paste it into putty and run it. On windows, you can simply right click in putty to paste copied text and run it at the same time. If you have changed your Vigor's default IP from 192.168.2.1, update it here accordingly.
set interfaces pseudo-ethernet peth0 link eth0
set interfaces pseudo-ethernet peth0 address 192.168.2.100/24
set interfaces pseudo-ethernet peth0 description "Access to modem"
Next copy and paste in (again change the IP if your DrayTek's modem is not the default 2.1):
set service nat rule 5000 type masquerade
set service nat rule 5000 destination address 192.168.2.1
set service nat rule 5000 outbound-interface peth0
Assuming you do not get any error messages, you can now close putty.
Step 5 : Log in to your DrayTek Vigor 130 admin from the USG
Open a browser and go to 192.168.2.1 (your DrayTek Vigor 130 modem's IP). This should then redirect you to http://192.168.2.1/weblogin.htm where you can then log into your modem's admin. By default, the login username is admin and the password is admin (if you haven't already changed this then I would suggest changing it).
You can now see your VDSL line stats via "Online Status" > "Physical Connection". As you can see in the below picture, the download speed is 79995(Kbps) and the upload is 15493Kbps.
You can also do a firmware upgrade if required via "System Maintenance" > "Firmware Upgrade". It's worth noting that if you are a BT customer (or like me an EE customer who in turn uses BT's lines), DrayTek have a BT firmware version specifically for the DrayTek Vigor 130. It can be downloaded from https://www.draytek.co.uk/support/downloads/vigor-130.
Hope this helps.
Please note, if you re-provision your USG, it will forget the above. You can re-do the above to add it back in but to get around this, you can create a config.gateway.json in /srv/unifi/data/sites/default/config.gateway.json (1st Gen cloud key) with the below in it.
"description": "Access to Modem",
If this guide has helped you or if you feel it could be improved, please let us know in the comments below.