Translate

Monday, September 26, 2016

Gain Access to your OpenWRT Router


The first step after we Upgrade our router to OpenWRT, is to gain access to the it. In this tutorial, today I will teach you how to access it using even with ethernet/LAN Cable or Wifi.

Here are the steps:

1. Download Winscp and Putty. Or JuiceSSH for Android OS.

2. Connect the LAN Cable, from the Router to the PC.

3. Open Browser and type 192.168.1.1 you can try 192.168.0.1 if it is failed. Then login.

4. In the upper click Network -> Wifi.

5. In the second row of Wireless Overview, choose enable (this is to activate the Router’s Wifi).

6. Don’t forget to setup the Wifi Password, so that other people cannot access. You can do this by selecting the Security Tab in the below section. If you already set it up, press “Save & Apply”.

7. Now, in the upper section, click Network -> Interface. If there is no LAN interface, then click Add Interface. Name the interface with “LAN”, then set the Protocol to “static Address”. Checklist “Create a bridge over multiple interfaces”, then checklick “Cover the following interfaces”. Checklist “VLAN interface: ‘eth0.1 (lan)'” and “Wireless Network: Master ‘OpenWrt (lan)'” then press Submit. Insert ipv4 addess: 192.168.1.44 (you can change 44 with others, but make sure it will not used by other router if you will use it pairing with other router), subnet mask: 255.255.255.0 then ipv4 gateway: 192.168.1.1. Click Save & Apply.

8. In this step, your Router now can be access using LAN Cable or Wifi. Connect your device through LAN Cable to port 1 or through Wifi.

9. pen Putty or JuiceSSH and Set the ip address 192.168.1.44 (look at step 7, use that ip), port 23, Connection: telnet. Save Configuration for future usage. Then Click Open.

10. If it success then will appear “root@openwrt:”

11. Now we set openwrt to be access via SSH. Type passwd in the commandline and press Enter, now type the password you want for the SSH (it will not show asterixs or character you type) press Enter then type the password again for confirmation then press Enter.

12. Now you router cannot be access via telnet, but we can access via SSH or SCP.

13. If you’re using PC, run WinSCP. If you’re using Android, re-run JuiceSSH. Create new Configuration with ip address 192.168.1.44 (make sure this is the ipv4 address that you set on step 7). Port 22, username root, and password is the password that you set in putty. Connection type: SCP if you’re using WinSCP, SSH if you use JuiceSSH.Save the configuration and then Open.

14. If it success then the application will alert you about SSH Fingerprint. Choose Update or Open. If it prompt for username and password, fill it again. If it success it will show “root@openwrt:” and in WinScp it will show you the folders. Congratulation, now you can access your Router Via SSH / SCP for transfer files. Note: in JuiceSSH, you need to do “cd /” after you login, then you can ‘ls’.

StarPrint + OpenWRT + Printer Sharing


Before i start the tutorial, i want to say thanks to Hamam Jafar from OpenWrt Indonesia Facebook group, to point to this great android application called “Star Print”.
Now lets start.

First of all, i want to tell you the device that i use:

1. Samsung galaxy Note II with DN4 v2.1.
2. Vodafone HG553 with OpenWrt Barrier Breaker version 14.07.
3. CANON Pixma MP237.

Here are the steps:

1. Connect to your modem via ssh or putty. Type in “opkg update” to update the list of packages. Then you need to install the usb driver, i’m using this command “opkg install luci-app-p910nd kmod-usb-printer p910nd”.

2. After the installation complete and there is no error, now connect the printer usb port to the router, turn it on. Back to putty, and type “dmesg”, if you find something similar like this:

printer.c: usblp0: USB Bidirectional printer 2 if 0 alt 0 proto 2 vid 0x04A9 pid 0x1094 usb.c: USB disconnect on ice 01:02.0-1 address 2 hub.c: new USB ice 01:02.0-1, assigned address 3 printer.c: usblp1: USB Bidirectional printer 3 if 0 alt 0 proto 2 vid 0x04A9 pid 0x1094

then your printer already installed.

3. Now we go to luci interface. For me it is 192.168.1.1 in the browser. Then login, choose the Services -> p910nd – Printer Server. Check the enable checklist then in the interface, choose LAN. Port: 9100. Checklist the bidirectional mode. Then press Save & Apply.

4. Now. Go to System -> Startup. Look at p910nd. To make sure the service is started. Press the start button beside the p910nd.
5. Now. To make sure the printer service is really ready. Go to putty again then type “netstat -an”

If you see;
Tcp 0 *.*.*.*:9100
Then the service is running.

6. Open your android device. Install Star Print here: StarPrint

Then open it. Slide it to Print Preview. On the printer option, click on “[No printer Selected]”. Press the Shared Printer in the middle bottom side. Type the Printer name to anything you like. Click on the IPP in the type options, Change it to “AppSocket(JetDirect)”. Type the Host to 192.168.1.1 and the port to 9100. Type the Shared name (i type mp237). Next click the select driver in the driver Options. Choose the manufacture of the printer. Then choose the type of printer that you got. After that press Ok.

7. Now connect your android device to the router via Wifi. Then open again the Star Print application. Choose the document you want to print. Then press print.