Page 1 of 2

Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 5:15 am
by rockyd
I added a static ip address to the DHCP section, saved the config.
Then my internet stopped working.
I went to the diagnostics section in Gargoyle, and tried ping that worked, then In tried Name serve lookup that failed with following result

nslookup: write to '127.0.0.1': Connection refused
nslookup: write to '::1': Connection refused
;; connection timed out; no servers could be reached

Thankfully I had a backup I could restore which I did, and everything worked again. I tried adding the static IP again and again DNS stopped working. I tried changing the DNS servers thinking it might fix things, but no.

This has happened in the past with other changes, but I was able to do a restore, and eventually able to complete the change I wanted to make. But this time I cannot seem to do it.

Any idea what's going on, I am guessing something is getting corrupted.

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 5:46 am
by rockyd
I have done a bit of research, and learnt that it may be related to resolve.conf.
I have searched for resolve.conf on the router and found two versions one in /etc/ppp and one in /etc
The one in etc has 127.0.0.1 in it and the the one in etc/ppp has the isp dns servers.
As I don't want to kill my internet right now, I have downloaded a copy of the one in etc/ppp. When I try this again, I''l take a look at resolve.conf to see if it has changed.

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 6:56 am
by Lantis
What are you adding to your Static IPs?
Does the hostname contain any special characters by any chance?
By special characters, anything that is not A-Z, 0-9 or a dash "-"?

This bug sounds (on the surface) like an invalid hostname causing dnsmasq to crash which breaks your DNS resolving.

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 6:54 pm
by rockyd
I think that will be it, I had a space in the host name, and you just triggered my memory of running into this in the past with spaces in the host name.

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 7:05 pm
by rockyd
If you haven't done so already.
Can I suggest maybe a note on the static IP screen saying
"Use only A-Z, 0-9 or a dash "-" for host name."

EDIT:Underscore "_" works as well, most of my host names, have underscore instead of spaces, I should have picked up on that.

Haven't tried looking yet, but is there a file I can edit to add such note for myself?

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 8:01 pm
by Lantis
I fixed this is May last year, you must be running an older version?
https://github.com/ericpaulbishop/gargo ... 1de5a57980

If you don’t want to upgrade you can manually apply the above patch if you wish.

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 10:02 pm
by rockyd
Lantis wrote:
Wed Jun 18, 2025 8:01 pm
If you don’t want to upgrade you can manually apply the above patch if you wish.
How does one apply a patch manually?

EdIt: Will underscore still work?

Re: Weird issue Gargoyle 1.15.X

Posted: Wed Jun 18, 2025 11:42 pm
by Lantis
Underscore will probably not cause the underlying issue, but it will be blocked by the GUI once you apply the patch.
Strictly speaking RFC1123 does not appear to permit underscores. In practice they are used globally in DNS but this is undefined behaviour I suppose.

If you want to apply the patch you need to login to the router using WinSCP and manually edit the /www/templates/static_ip_template and /www/js/dhcp.js files.
The template file change is trivial to do by hand.
The JS file needs two new functions inserted and then the extra check referenced in 4 different lines (all next to each other thankfully). Again this change is reasonably trivial to do by hand except you need to un-minimise your JS file first. It would probably the faster to just download the new file and replace it on your router (keep the old as a backup).

cp /www/js/dhcp.js /www/js/dhcp.js.bak
wget -O /www/js/dhcp.js https://raw.githubusercontent.com/ericp ... js/dhcp.js

I suppose you could do the same thing with the template file if you want to.
Refresh GUI (potentially need to clear cache) and the new change should be live.

Re: Weird issue Gargoyle 1.15.X

Posted: Thu Jun 19, 2025 7:41 pm
by rockyd
Thanks for the information. Will give that go, when I have some more spare time.
Out of curiosity I was looking around in the files, just to see if I could do my idea of adding a note to the webpage.
It all seems very well obfuscated, and difficult to work out where things are coming from.
Example i was trying to find the text "Add Static IP Address:" so I could tack a note onto the end of it, still have no idea where it is. Have to work how to do searches within files, WInSCP does not seem to do it.

Re: Weird issue Gargoyle 1.15.X

Posted: Thu Jun 19, 2025 8:17 pm
by Lantis
Search on the command line with grep is probably easier to find things.
grep -r “Add Static IP Address” /www

A lot of the strings are in the /www/i18n/ directory so that the GUI can support translation to other languages.
The SH files in /www drive the display of data. Language strings are referenced from here using the <%~ StringName %> syntax.
The JS files in /www/js/ control the logic behind the pages. The JS files are minimised to save space which makes them unreadable (or at least difficult). If you are going to make changes I would replace the minimised content with its full counterpart from the git repository.

If all you wanted to do was add a warning, I would just edit the SH files directly and not worry about the translations.

Code: Select all

root@Gargoyle:~# grep -r "Add Static IP Address" /www
/www/i18n/English-EN/dhcp.js:dhcpS.AdSIP="Add Static IP Address";