Skip to content

Testing on Mobile

Mike Kasprzak edited this page Jun 18, 2016 · 20 revisions

Step 1.

Open up Vagrantfile in your DairyBox root folder.

Uncomment this line (i.e. remove the #).

# "public_network"

Shut down and start the VM.

vagrant halt
vagrant up

When prompted, select the 1st interface (wlan0 ?).

Now use the info script to check what the IP address of the public interface is.


This is typically Eth2.

You can punch the IP address in to either your local browser or the browser of your mobile device to see the website. Do note, it may take some time before it resolves, so be patient.

More Details:

In some cases, it may be possible to use a real domain name from your remote devices.


If you have a current ASUS brand router, then you may have an ASUSWRT based firmware installed. If that's the case, you can temporarily modify the /etc/hosts file of the router to include some fake domain names that we will use for testing.

Go to Administration->System and enable Telnet access.

Use either vi or cat > to create a shell script /etc/


if [[ $# -eq 0 ]] ; then
    echo "Usage: $0 ip-address-of-server"
    exit 0

# Copy original /etc/hosts, but only if the copy doesn't exist
[ ! -e "/etc/hosts.original" ] && cp /etc/hosts /etc/hosts.original

# Overwrite Hosts file
cp /etc/hosts.original /etc/hosts

# Our Additions
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts

echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts
echo "$1">>/etc/hosts

# Restart DNSMasq (to reload hosts file)
killall -HUP dnsmasq

Pass the IP address you want to associate the and domains to the script.

TODO: Figure out if there's something that should be run as the asusware/.asusrouter script on a USB key to make this nicer. Some sort of RPC?

Alternatively, set up a custom script in the repos that Telnet's in to the router (given the router IP, username, password, and desired server IP) and runs this script or these commands. Then set it up as a startup script for the Vagrant box, so any time a vagrant box with a public interface goes up, it runs this script (assuming you have an ASUS router, and configure a config file for it).


DD-WRT Router

  • dnsmasq
You can’t perform that action at this time.