Networking

How to set a static wireless connection on Ubuntu Touch

Jack Wallen walks you through the rather cumbersome steps of setting up a static wireless network connection in the Ubuntu Touch mobile platform.

BQ Aquaris M10 tablet
Image: Aloysius Low/CNET

I will state this right out of the gate: The process of setting a static wireless connection on Ubuntu Touch should be much easier. Yes, you can add a static IP address through the Ubuntu Touch GUI, but it only allows you to enter the address (no DNS, no gateway). Thankfully, this is Linux, so even though there isn't a handy entry in the GUI configuration for setting up a complete static wireless network connection, it can still be done.

Why all the build up? What does this mean? The bad news is you're going to have to use the command line. The good news is that you don't have to root the device to pull this off.

SEE: 10 things you should know about the BQ Aquaris M10 tablet

What you'll need

Out of the box, Ubuntu Touch has everything it needs, minus the Terminal application. You will, however, need the information required to set the static IP address (DNS, available IP address, netmask, gateway address).

Before we continue, let's install the Terminal app.
  1. Open the Scopes app.
  2. Swipe to the left until you see the Apps scope.
  3. Locate and tap the Ubuntu Store launcher.
  4. Search for Terminal.
  5. Locate and tap the entry by Ubuntu Core App Developers.
  6. Tap Install.
  7. Allow the installation to complete.

You should now see a launcher for Terminal in the Apps scope. Tap that launcher and, when prompted, enter your user PIN (the same PIN you use for your lock screen). You're ready to work.

Editing the connection

As you've probably surmised at this point, you have to manually edit the wireless connection information. From the Terminal app, change into the correct folder with the command cd /etc/NetworkManager/system-connections folder. Issue the command ls, and you should see a listing for the wireless connection you wish to modify. In order to modify this connection, you first need to change to the root user by issuing the command sudo su. Enter your lock screen PIN to continue.

To edit the file, issue the command nano NAME_OF_CONNECTION (where NAME_OF_CONNECTION is the actual name of the connection you want to edit). This file should look something like this (I X'd out the secret bits of information for my wireless connection):

[connection]
id=XXXXXXX
uuid=XXXXXXX
type=802-11-wireless
timestamp=1449414384
[802-11-wireless]
ssid=WIRELESS SSID
mode=infrastructure
bssid=XXXXXXXXXX
mac-address=XXXXXXXXX
seen-bssids=XXXXXXXX;
security=802-11-wireless-security
[802-11-wireless-security]
key-mgmt=wpa-psk
psk=XXXXXXX
[ipv4]
method=auto
[ipv6]
method=auto

Move your cursor down to the [ipv4] section and change that to reflect the following:

method=manual
dns=208.67.220.220;208.67.222.222;8.8.8.8;8.8.4.4;
address1=192.168.1.198/24,192.168.1.254

Make sure to plug in the information specific to your network in the form. In the above example I used both OpenDNS and Google servers for DNS. Once you've edited the file, save it with [Ctrl+[x] and then click y and hit Enter to save.

You can attempt to disconnect and reconnect to wireless, but I've found it doesn't always work; instead, reboot the device. Once the Ubuntu Touch device has rebooted, you can open the terminal and issue the command ifconfig to see your newly configured IP address in action (Figure A).

Figure A

Figure A
The newly configured static IP address on your Ubuntu Touch device.
Image: Jack Wallen

Your Ubuntu Touch device can now enjoy a static IP address. If something changes on your network, you'll have to manually edit the connection to make a change.

Hopefully, the developers will very soon add the ability to fully configure a static IP address on the platform. Until then, you'll have to settle for the manual option.

Also see

About Jack Wallen

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website jackwallen.com.

Editor's Picks

Free Newsletters, In your Inbox