How to activate SWAP on Asus RT-AC68U router

To enable linux SWAP on your Asus RT-AC68U router you need the following:

  • Custom firmware with jffs partition enabled (I recommend Asuswrt-Merlin build);
  • an USB HDD or USB flash drive to mount on one of your router’s USB ports.

Using a swap file

To enable swapping using a swap file you need to first create the file, prepare it for swapping and then enable the swapping on it. First of, make sure the file system the disk you wish to swap on is properly mounted. If you chose labels for the partitions, use them instead of sda1, sda2, sdb1, etc.

#check how the disk was mounted
ls -l /tmp/mnt

For the purposes of this tutorial we will assume the disk is mounted as /tmp/mnt/sda1/ and we want to use the file /tmp/mnt/sda1/myswap.swp for swapping.

#create a 256MB swap file ("count" is in Kilobytes)
dd if=/dev/zero of=/tmp/mnt/sda1/myswap.swp bs=1k count=262144

#set up the swap file
mkswap /tmp/mnt/sda1/myswap.swp

#enable swap
swapon /tmp/mnt/sda1/myswap.swp

#check if swap is on

If you reboot your router, the swap will be inactive until you swapon again. To do this automatically you have to create the file /jffs/scripts/post-mount, or edit it if exists and add the line:

swapon /tmp/mnt/sda1/myswap.swp

Now every time the router reboots, it will turn on swap.

Using a swap partition

This method is not recommended if using USB storage with multiple partitions.

  1. Using your computer, create a linux-swap partition on your disk that will be mounted on the router. You can use GParted for linux, MiniTool Partition Wizard Home Edition for Windows or Disk Utility for MacOS;
  2. Connect the formatted drive to router and in PuTTY terminal use command fdisk -l to see how it was mounted. Let’s asume it is mounted as sda1;
  3. Again in PuTTY terminal use command swapon /dev/sda1 and then free to see if swap is correctly activated;
  4. If swap is correctly activated, use the script /jffs/scripts/post-mount with the command swapon /dev/sda1 as mentioned above.
swapon /dev/sda1


Do not use SWAP (partition or file) on a device which goes to hibernation or does spin-down. You might make the router more unstable than without using SWAP.

Be sure you deactivate spin-down on the device which you want to use for SWAP.

Spin-down settings on ASUS router powered by Asuswrt-Merlin

Spin-down settings on ASUS router powered by Asuswrt-Merlin

There are some devices, like the Western Digital USB HDDs WD Elements, My Book or My Passport which have their own power management and will not be affected by the settings on the router and they will spin-down if data is not read or written for some time. I recommend to avoid this kind of devices for SWAP.

Info source:


Useful applications and Optware packages that I run on my Asus RT-AC68U router

This is a list of scripts and Optware packages I am currently running on my Asus RT-AC68U router:

  • nano – pico like text editor (ipkg install nano)
  • vim – text editor (ipkg install  vim)nano is easier to use
  • htop – an interactive process viewer (ipkg install htop)
  • atop – a better top with history monitoring (ipkg install atop)htop works better and offers more information
  • mc – Midnight Commander File Manager (ipkg install mc)
  • transmission – Lightweight BitTorrent client and daemon, with web interface bundled (How to install transmission for Optware on Asus RT-AC68U router)

These scripts and Optware packages I am planning to install:

  • Adblocking script
  • P2Partisan mass IP blocking script
  • Ipkg-web utility too much of a mess to set it up. It will break more then it will fix.
  • Syslog-ng utility (+ libol support library) + logrotate; cannot be used with RT-AC68U, as the default syslogd cannot be deactivated.
  • metalog – Modern, highly configurable syslogd replacement; cannot be used with RT-AC68U, as the default syslogd cannot be deactivated.

A list of all Optware packages, sources and dependencies (not all of them are useful or compatible with RT-AC68U).

How to configure the BBox-2 modem (Sagem F@st 3464) in bridge mode

If you are living in Belgium and you have internet from Belgacom, Scarlet or EDPNET, you might be the (un)happy user of their VDSL2 modem called BBox-2, which is actually a Sagem F@st 3464 in a different case.
It is using a PPPoE connection to get the dynamic WAN IP. Belgacom is usually updating the IP once every 3 days.

BBox-2 VDSL2 modemSagem F@st 3464 VDSL2 modem

If you have your own router, or you are planning to buy one and you need features like Dynamic DNS, port forwardingVPN server, FTP or other types of home-hosted servers, you need to bypass the modem’s wan connection by putting it in bridge mode and make the PPPoE connection directly on your router. In this post I will refer to BBox-2 as “the modem” and your own router as “the router”.

Preparatory steps:

  1. Connect your router’s WAN port to the BBox-2 modem’s 1st LAN port (PC1);
  2. The modem’s DHCP server starts to assign IPs starting with, so you need to check the configuration of your router’s LAN DHCP server to be different (for example set IP Pool Starting Address to and IP Pool Ending Address to;
  3. Set your router to have a static WAN ip and set it to At this moment if you try to connect to the web interface through your browser, at will be the modem and at will be your router. This way you will be able to have access to the modem after you set it up as bridge;
  4. [Optional] Deactivate your BBox2’s WiFi if you don’t need it;
  5. Keep your PPPoE internet connection credentials close. (ex: un1234@BELGACOM).

Steps to make the modem work in bridge mode:

  1. Connect to your BBox-2 through your browser (;
  2. Go to Advanced Settings and then select Network Interfaces;
  3. Select Wan PPPoE, click on Disable button, then OK;
  4. Select Wan PPPoE again, go to Settings > Underlying Connection and select LAN Bridge;
  5. Delete the username (Login User Name (case sensitive)) to stop the modem retry to connect every 30 seconds;
  6. Uncheck “Internet Connection Firewall” and click Apply; (the modem might reboot)
  7. Connect to your router through your browser (;
  8. Change the WAN connection type from Static IP to PPPoE and write the username and password provided by your internet provider. The router will connect to internet and will get the IP provided by your ISP.

You are now able to set-up dynamic DNS directly on your router (BBox-2 modem works only with DynDNS which is not free any more) and forward ports to your self-hosted services.
Other services like Belgacom TV and I-Talk should continue to work.

Here are two schemas of “before” and “after” setting the modem in bridge mode:

BBox-2 in bridge mode schema

BBox-2 in bridge mode schema

Info sources:

How to install transmission for Optware on Asus RT-AC68U router

This method can be used for other Asus routers, but I tested it only on my Asus RT-AC68U.


  • [optional, but highly recommended] Custom firmware to get extended router functionality and better stability (I recommend asuswrt-merlin);
    • [optional] jffs partition enabled – if you want to access transmission from WAN using custom firewall scripts or to mount a network shared drive to router;
  • Optware installed on your router. Entware is not yet compatible with Asus RT-AC68U. Link for New Generation Optware method at the end of the article;
  • Be sure Optware is installed on a linux partition system (check if your router supports ext4. If not, ext3 or ext2 can be used. The Asus RT-AC68U supports ext4). NTFS and FAT32 are unstable for Optware. I used MiniTool Partition Wizard to format the drive before connecting it to the router.
  • Be sure Download Master is uninstalled (it is incompatible with transmission);
  • libiconv library (converts between character encodings) installed on Optware;
  • nano text editor installed on Optware;
  • You need to enable SSH connection to your router;
  • PuTTY installed on your computer;
  • [optional] Transmission Remote GUI for PC; Torrnado for Android.
  • [optional, but recommended] SWAP activated on the router.

Installing transmission

To install transmission, you need to login to router with PuTTY terminal. Use the username and password required to login to the router’s web interface and run each of the following lines.

ipkg update
ipkg upgrade
ipkg install libiconv
ipkg install nano
ipkg install transmission
wget -c -O /opt/etc/init.d/S95transmission
chmod 777 /opt/etc/init.d/S95transmission
/opt/etc/init.d/S95transmission start
/opt/etc/init.d/S95transmission stop
chmod 777 /opt/etc/transmission-daemon/settings.json
rm -r /opt/etc/transmission-daemon/settings.json
wget -c -O /opt/etc/transmission-daemon/settings.json transmission yes

If you receive a 5xx error on wget, it might be because of high traffic on the Dropbox server which hosts the files and you have to try again later or try using the Google cache. If you received no error, transmission should be available at your router’s LAN IP on port 9091 (usualy or The default username and password are admin / password.

Now you have to stop the transmission-daemon and edit the settings file to customize it to fit your needs (don’t forget to change the default username and password). If you don’t stop the daemon first, the settings will not be saved.

/opt/etc/init.d/S95transmission stop
nano /opt/etc/transmission-daemon/settings.json

For a better understanding of the parameters, check the official transmission documentation (old version of same file here). Now start transmission-daemon again and you can use Transmission Remote GUI / Torrnado to connect to it if you want more features than what the web interface offers. Both apps offer a better way to change the main settings, manage the downloads and they can register to be the default applications for .torrent files and magnet links.

/opt/etc/init.d/S95transmission start

IMPORTANT ISSUE I had with transmission running on Optware

The partition I use to download files to has a label, so instead of using /tmp/mnt/sda1/Torrents I had to use /tmp/mnt/Downloads/Torrents, where “Downloads” is the label of my partition. In my case, if I don’t include the label, Transmission would use /root/tmp as download path which has only a couple of MB free on the disk and transmission-daemon would crash when downloading a torrent.

To check how your drive was mounted and if it has to be used with a label or not, run the following command in PuTTY terminal:

ls -l /tmp/mnt

Download torrents on NAS drives

If you don’t want to download torrents on a disk mounted on the USB port of your router, here are the steps to download on a network shared drive (ex: from a NAS)

#create a directory where you will mount the network shared drive
mkdir /mnt/sda1/nasdrive
chmod 777 /mnt/sda1/nasdrive

#mount drive
mount \\\\\\MyNetworkSharedDrive /mnt/sda1/nasdrive -t cifs -o "username=shareUser,password=sharePassword"

Replace “\\\\\\MyNetworkSharedDrive” with the path of your network drive you want to mount on the router.
Backslashes should be escaped or else the shell will misinterpret them.
The effect of the mount command is not persisting after a reboot.

To automatically mount the shared drive on your router after reboot, follow these steps:

  • Activate jffs on your router. You might have to reboot a couple of times for the jffs to be created and formatted;
  • Create/update file “/jffs/scripts/post-mount” with these lines:
#Create/update script
nano /jffs/scripts/post-mount
mount \\\\\\MyNetworkSharedDrive /mnt/sda1/nasdrive -t cifs -o "username=shareUser,password=sharePassword"
#Give execute rights to the script
chmod a+rx /jffs/scripts/post-mount

WARNING! Anyone with access to post-mount script can see the user name and password of your network shared drive.

Access transmission from WAN

If you want to be able to connect from WAN to transmission, you have to open the port 9091 in you firewall.

If you cannot open it using the router’s web interface you can do it by using a firewall script in jffs. For this you need custom firmware with jffs partition enabled (I recommend asuswrt merlin build). If you don’t have a firewall-start script, run the following commands.

wget -c -O /jffs/scripts/firewall-start
chmod a+rx /jffs/scripts/firewall-start
nano /jffs/scripts/firewall-start

If you already have the script, skip line 1 and 2 and just add the following rules to your existing script.

#transmission web interface
iptables -I INPUT -p tcp --destination-port 9091 -j ACCEPT

#transmission listening port
iptables -I INPUT -p tcp --destination-port 51413 -j ACCEPT
iptables -I INPUT -p udp --destination-port 51413 -j ACCEPT

Email notifications from transmission

If you are interested in having email notifications, check merlin’s tutorial to email notifications.

Uninstall transmission

ipkg remove transmission

New Generation Optware

If this tutorial doesn’t work for you, you can also try to install Transmission Download Manager through New Generation Optware.

Info sources:

Latest updates

On 8th of January 2017 this tutorial was still working and the files to be downloaded were available. Let me know in the comments if you encounter any issues.

ASUS RT-AC68U router

How to install Optware on Asus RT-AC68U router

ASUS RT-AC68U router
Optware is a package manager to allow you to easily install and uninstall cross-compiled Linux applications on your device (router, NAS, etc.) over the internet.
An alternative to Optware is Entware, but despite being newer and more modern, Entware is not compatible yet with ARM-based devices so please check compatibility before trying to install.

The router ASUS RT-AC68U is compatible, for the moment, only with Optware.


To install Optware on your RT-AC68U you have to follow three simple steps:

  1. Mount the ext4 formatted disk;
  2. Go to router’s web interface ( -> USB Application and install Download Master;
  3. Once successfully installed, uninstall it (not disable). The Optware package will remain installed, but just the Download Master will be removed.

You have to uninstall the Download Master because it is incompatible with transmission for Optware, a better alternative for the torrent client.

As you might run multiple applications on Optware, it is recommended that you activate SWAP on your Asus RT-AC68U router.

This is my list of useful Optware applications that I run on my ASUS RT-AC68U.

Info source: