Gargoyle CLI

Report problems and success stories with Gargoyle on various hardware platforms.

Moderator: Moderators

Lantis
Moderator
Posts: 6721
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Gargoyle CLI

Post by Lantis »

When something goes wrong, usually the first thing someone will ask you to troubleshoot is, "we need a system log".
They might ask you, "can we see your config files?"
Or maybe they'll ask you to modify, add or remove files from the file system on the router.

We are going to cover the basics of logging in to the router via the command line and executing common commands, and we are going to cover logging in with a GUI to edit the file system.

You will need:
- PuTTY.exe OR Terminal.app on Mac or Linux.
- Your routers IP address
- Your router password

Logging in to the command line
Using PuTTY.exe, select an SSH connection type, leave the port at default 22, and enter "root@ROUTERIP", substituting ROUTERIP for the IP address of your router.
Then click Open.
Image
You will be asked for the password for your router. Type it in and press ENTER. Note that when you type your password, the cursor won't move and no characters will appear on screen. This is normal.
Image
On successful login you will be greeted with the Gargoyle logo and a prompt to enter a command.
Congrats, you're in!
Image

Common commands you may be asked to enter are:

Code: Select all

logread
used to get the system log from the router. just copy and paste this to the person requesting it from you

Code: Select all

cat
used to display the contents of a file, usually asked for when we want to see what is in a config file. e.g. cat /etc/config/wireless

Code: Select all

wifi
used to restart the wifi after making a change

Code: Select all

uci get config.section.option
we use this if we are specifically only interested in a particular setting. e.g. uci get wireless.radio0.hwmode

Code: Select all

uci set config.section.option=setting
we use this to change a specific setting in the config. e.g. uci set wireless.radio0.hwmode=11g

Code: Select all

uci commit
we use this to save any changes we have made to configs

Any commands that work on Openwrt should work on Gargoyle. That means that the wiki pages at openwrt.org are a great resource if you need help. E.g. https://wiki.openwrt.org/doc/uci/wireless is good for self checking a wireless configuration file for problems.

NOTE: If asked for a config file, before sending it to the person make sure you have a quick flick through it to make sure that there is no sensitive information in it e.g. passwords. This is commonly the case in the wireless config file. If there is, just blank them out with something like "REMOVEDPASSWORD" so that we know you changed it.



If the command line looks too scary for you, and you're more of a point and click kind of person, then i recommend WinSCP.
Logging in to the file system
Using WinSCP, set up a "new site".
Make the protocol SCP, the host name is the ip address of your router, and the port number is 22. Username is "root" and the password is the password for your router.
Image
Click Login and you will be greeted with the file system for the router.
If you are asked about remembering passwords, it is generally a good idea otherwise you will be constantly reentering the password to do anything.
Image
Now you can navigate the file system just like you would on a computer. If you need to show us something, just double click to open it, and copy paste. If you need to edit something, double click to open, make the changes, hit save and close.

Common directories you might get asked to go to are:
/etc/config - where we keep all of our config files
/tmp - where some relevant temporary config files are kept
/usr/data/bwmon - where graph data is stored (and can occasionally cause boot loops)
/www - where the GUI files are kept


Putting a router into failsafe recovery mode
Watch how to do it here
Note: As of Gargoyle 1.10.0, use SSH, not Telnet, to access Failsafe


Caution should be used when poking around in either the command line or the file system. Poking and prodding the wrong files or commands can cause an unstable router. 99 times in 100, its recoverable, but you'll be frustrated with yourself. :D
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

danymarc
Posts: 104
Joined: Mon Nov 18, 2013 5:51 pm

Re: Gargoyle CLI

Post by danymarc »

thank you, nice info. for CLI newbies

larcy
Posts: 16
Joined: Fri Aug 23, 2013 2:43 am

Re: Gargoyle CLI

Post by larcy »

Are there any instructions on how to reflash a router from the CLI, useful for situations where you can get into the CLI, but not the GUI

ispyisail
Moderator
Posts: 5180
Joined: Mon Apr 06, 2009 3:15 am
Location: New Zealand

Re: Gargoyle CLI

Post by ispyisail »

larcy wrote:Are there any instructions on how to reflash a router from the CLI, useful for situations where you can get into the CLI, but not the GUI
depends on router make/model

see openwrt wiki for your router

Lantis
Moderator
Posts: 6721
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Gargoyle CLI

Post by Lantis »

Added a video for how to drop a router into failsafe recovery mode.
also as a big friendly reminder...

:!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!:
30/30/30 DOES NOTHING ON GARGOYLE
:!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!:
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

tapper
Moderator
Posts: 1076
Joined: Sun Oct 13, 2013 5:49 pm
Location: Stoke-on-trent UK

Re: Gargoyle CLI

Post by tapper »

Lantis wrote:Added a video for how to drop a router into failsafe recovery mode.
also as a big friendly reminder...

:!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!:
30/30/30 DOES NOTHING ON GARGOYLE
:!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: :!:
hahaha was thinking the same thing lol.
Linksys WRT3200ACM
NETGEAR Nighthawk R7800
NETGEAR R6260

GhostYou
Posts: 3
Joined: Sat Sep 03, 2016 3:54 am

Re: Gargoyle CLI

Post by GhostYou »

hi,

I can't get into my router even when its in fail safe mode. followed your video (https://www.youtube.com/watch?v=_NqHpRHl8gQ) for fail safe mode and used putty telnet 192.168.1.1 and ssh root@192.168.1.1 . have the light flashing faster and every thing. but even when if i ping the ip it just times out. I could still see it broadcasting the wireless network i set up but it will not give out ip address so i can't log in with phone. NOTED that it doesn't broad cast in fail safe mode.

model: Tl wr941nd v5.1 got a tl-wr941nd_v5.0factory from 1 of your forums. viewtopic.php?f=8&t=5690

It was working then I was poking around in lan settings and think i left it on pppoe (like a NOOB) and saved changes. this has stopped me logging back in to it for the past 6 hours :evil: .

ANY and all help is most appreciated.

Lantis
Moderator
Posts: 6721
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: Gargoyle CLI

Post by Lantis »

Try different ports on the router.
When in failsafe, only use telnet. I'm not even sure it will respond to a ping.
And ensure you're in the right subnet with a static IP in your machine.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

GhostYou
Posts: 3
Joined: Sat Sep 03, 2016 3:54 am

Re: Gargoyle CLI

Post by GhostYou »

Thx will do as I have a tl wr941nd v2 router as well with gargoyle on it and its working fine.... BUT I can't access that one in failsafe mode as well.

Think i must be missing a step. I hard set my ip to 192.168.1.2 subnet 255.255.255.0 then useing putty with telnet selected at 192.168.1.1 it auto fills port as 23 but i have tried 24 and 22. no luck.

I can how ever use putty and telnet to access the working router when it is NOT in failsafe mode fine.
Last edited by GhostYou on Tue Sep 06, 2016 7:41 pm, edited 1 time in total.

tapper
Moderator
Posts: 1076
Joined: Sun Oct 13, 2013 5:49 pm
Location: Stoke-on-trent UK

Re: Gargoyle CLI

Post by tapper »

GhostYou wrote:Thx will do as I have a tl wr941nd v2 router as well with gargoyle on it and its working fine.... BUT I can access that one in failsafe mode as well.

Think i must be missing a step. I hard set my ip to 192.168.1.2 subnet 255.255.255.0 then useing putty with telnet selected at 192.168.1.1 it auto fills port as 23 but i have tried 24 and 22. no luck.

I can how ever use putty and telnet to access the working router when it is NOT in failsafe mode fine.
Hi mate I had this one time with a wrd3600 try the wan port when in failsafe .
Linksys WRT3200ACM
NETGEAR Nighthawk R7800
NETGEAR R6260

Post Reply