# Road Warrior Portable Router

**URL:** <https://forum.gl-inet.com/t/road-warrior-portable-router/1447>\
**Category:** Router\
**Created:** [May 25, 2016, 10:24pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447 "2016-05-25T22:24:11Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 25, 2016, 10:24pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/1 "2016-05-25T22:24:11Z")

</div>

Hi,

I have heavily customised my AR150 to be a road warrior. The only mode it works is Natting.

On boot, it will wait for 10 seconds on WAN (ethernet/eth0) for an connecting. If this is successful local lan (ethernet/eth1) and wifi becomes access point.

If the WAN ethernet/eth0 connection is unsuccessful, it will scan the airwave and try to match a list of wifi connection profiles you have setup.When one is matched, it will try and connect. Should the connection failed or no matching profile is found, it will default to failsafe mode by becoming an Access Point (AP+STA problem). The local lan (ethernet/eth1) also serves local connections.

The scripts does not use gui to configure the wifi profiles and I’ve used my own iptable rules. It also saves wear on the flash by limiting writes once the wifi profiles are setup

I would be happy to post my script if anyone is interested.

Thanks

&nbsp;

---

<div class="post-metadata">

**Author:** ![rangerz](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@rangerz](https://forum.gl-inet.com/u/rangerz)\
**Post date:** [May 26, 2016, 1:56am UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/2 "2016-05-26T01:56:39Z")

</div>

Yes, Please post!

When you say failsafe, I assume you mean just set the Option Disabled to 1.

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 26, 2016, 4:34am UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/3 "2016-05-26T04:34:30Z")

</div>

RangerZ,

The failsafe revert AP+STA problem to AP, so you can always login via wifi.

I have also done similar configures for TP 703N which have only 1 physical ethernet, where the ethernet becomes either WAN or LAN.

&nbsp;

Flash with openwrt-clean-gl-ar150-1.0.bin

Copy all 4 .ipk files to /tmp  
Copy the gl.tar files to /etc/config

Then run the following commands: -

opkg install /tmp/ip\_4.0.0-1\_ar71xx.ipk  
opkg install /tmp/iwinfo\_2015-06-01-ade8b1b299cbd5748db1acf80dd3e9f567938371\_ar71xx.ipk  
opkg install /tmp/kmod-macvlan\_3.18.23-1\_ar71xx.ipk  
opkg install /tmp/wireless-tools\_29-5\_ar71xx.ipk

cd /etc/config/  
tar xvf gl.tar  
chmod u+x \*.sh  
rm wireless  
ln –s /tmp/wireless wireless

vi /etc/rc.local so it looks like this: -

# Put your custom commands here that should be executed once

# the system init finished. By default this file does nothing.

[-x /etc/config/wifi.sh] && /etc/config/wifi.sh  
[-x /etc/config/routes.sh] && /etc/config/routes.sh  
[-x /etc/config/cleanupWifi.sh] && ((/etc/config/cleanupWifi.sh)&)&

exit 0

Then disable the firewall/luci: -

/etc/init.d/firewall stop  
/etc/init.d/firewall disable  
/etc/init.d/uhttp stop  
/etc/init.d/uhttp disable

edit  
/etc/config/wirelessAP to change your AP wireless name/password  
Run /etc/config/confWifi.sh to setup your wireless connections to your home network or hotspot

reboot

=========================================

The symbolic link /etc/config/wireless to /tmp/wireless saves the wear on the flash as /tmp is ramdisk/swap  
wifi.sh - this scans the airwave and connects to your profiles in /etc/config/wireless\<number\>.\* if it’s is found. If none are found/cannot connect, your wifi becomes an AP. This is called in /etc/rc.local. You do not need to run this manually

On boot, it will wait for 10 seconds on WAN (ethernet/eth0) for a connecting. If this is successful local lan (ethernet/eth1) and wifi becomes access point.

If the WAN ethernet/eth0 connection is unsuccessful, it will scan the airwave and try to match a list of wifi connection profiles you have setup.When one is matched, it will try and connect. Should the connection failed or no matching profile is found, it will default to failsafe mode by becoming an Access Point (AP+STA problem). The local lan (ethernet/eth1) also serves local connections.  
confWifi.sh – this scans the airwave and allows you to setup wireless profiles to connect to. The last option is for manual setup.

chgNetwork.sh – this changes your network so it does not clash on 192.168.6.x to 192.168.7.x. It will switch between 192.168.x.x. to 10.10.x.x. Will need a reboot after this

routes.sh – this defines the ipfilter rules for NAT and blocking rules. This is call in /etc/rc.local. There are 3 modes

routes.sh 0 – stricter using drop rules - default

routes.sh 1 – relax rules using accept.

routes.sh 2 – accept rules, no natting

regenMac.sh – regenerates random mac for wifi (mac spoofing). Use this if the cafe hotspot limits you to 30mins a day. There are 3 modes

regenMac.sh – kill off loop process

regenMac.sh 0 – regen once

regenMac.sh \<number\> - regen every X minutes

cleanupWifi.sh - cleanup wifi profile specify in days during confWifi.sh. This is call in /etc/rc.local

I have use android apps  
Juicessh (xterm) and ssh hot button to config these on the go

Enjoy!

Let me know if you have any questions

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 26, 2016, 4:41am UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/4 "2016-05-26T04:41:36Z")

</div>

Due to the upload file size - I have to gzip the package. You have to gunzip the gl.tar.gz first before untarring

---

<div class="post-metadata">

**Author:** ![alzhao](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@alzhao](https://forum.gl-inet.com/u/alzhao)\
**Post date:** [May 27, 2016, 4:29pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/5 "2016-05-27T16:29:36Z")

</div>

thanks for posting. Will have a close check. Seems it is necessary to implement this in the default firmware.

BTW, for the ipk files, you can just do a opkg update, the opkg install each one. Doesn’t it?

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 27, 2016, 5:09pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/6 "2016-05-27T17:09:16Z")

</div>

alzhao

That’s correct for the 4 ipk packages. Use the official repository. I was making life easier for installer.

I think you can rework wifi.sh to make it work if your system has wlan0 (AP) and wlan1 (Connect to upper router).

Let me know if you need any help

---

<div class="post-metadata">

**Author:** ![rangerz](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@rangerz](https://forum.gl-inet.com/u/rangerz)\
**Post date:** [May 27, 2016, 9:38pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/7 "2016-05-27T21:38:39Z")

</div>

I am using WinRAR on Windows. I have both RAR and GZip associated with archives. It reports that the file is corrupt. Can you please check the archive.

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 27, 2016, 9:48pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/8 "2016-05-27T21:48:23Z")

</div>

Hi

I have download the link and it looks ok with 7zip

[http://www.7-zip.org/download.html](http://www.7-zip.org/download.html)

I have also attached my scripts only without the 4 ipk packages.

You must download the 4 packages from the offical repository.

&nbsp;

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![rangerz](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/r/839c29/32.png) [@rangerz](https://forum.gl-inet.com/u/rangerz)\
**Post date:** [May 27, 2016, 10:08pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/9 "2016-05-27T22:08:24Z")

</div>

Thanks, I can open this archive.

After a quick review I think this is way to complex for my skill set. I also have some concerns about how it will play with other packages. I have OpenVPN installed on the GLI GUI, and not keep about redoing all this.

Do you have any idea if this is portable to other devices\platforms with the proper substitution of the relevant 4 packages?

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 27, 2016, 10:31pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/10 "2016-05-27T22:31:29Z")

</div>

I think it would work with openvpn if your wlan0 is AP and wlan1 (connect to router).

you will need to install iwinfo and wireless-tools minimum

opkg update

opkg install iwinfo

opkg install wireless-tools.

You will need these scripts in /etc/config

wifi.sh, confWifi.sh and wirelessAP

Then run

cd /etc/config

chmod u+x \*sh

rm wireless  
ln –s /tmp/wireless wireless

Add to your /etc/rc.local

[-x /etc/config/wifi.sh] && /etc/config/wifi.sh

Change your SSID/password in

/etc/config/wirelessAP

&nbsp;

If you are worry about messing up your configs backup rootfs/rootfs\_data first

cat /dev/mtd5 \>/tmp/backup.bin  
Download that file to your computer.

To restore. Transfer it to /tmp in router.  
sysupgrade -v -n backup.bin

&nbsp;

&nbsp;

---

<div class="post-metadata">

**Author:** ![sammo](https://forum-assets.gl-inet.com/letter_avatar_proxy/v4/letter/s/c37758/32.png) [@sammo](https://forum.gl-inet.com/u/sammo)\
**Post date:** [May 27, 2016, 11:00pm UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/11 "2016-05-27T23:00:16Z")

</div>

Second thought, your dhcp/network file might not align to my wirelessAP (interface name) etc or confWifi.sh. So it will not work.

You will need full scripts. You can backup your good image as indicated above before trying it

&nbsp;

---

<div class="post-metadata">

**Author:** ![bruce](https://forum-assets.gl-inet.com/user_avatar/forum.gl-inet.com/bruce/32/35649_2.png) [@bruce](https://forum.gl-inet.com/u/bruce)\
**Post date:** [October 29, 2025, 2:35am UTC](https://forum.gl-inet.com/t/road-warrior-portable-router/1447/12 "2025-10-29T02:35:12Z")

</div>


