What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

The firewall-start script is not running

ungureanub

New Around Here
Hi,

I have the RT-AC66U and I've installed Merlin's version "RT-AC66U_3.0.0.4_266.23b". I'm trying to open the port 9091 so I can access the transmission client from WAN.

On the router UI I've enabled "jffs partition" and "Format JFFS partition at next boot" and I've rebooted the router.
then
Code:
mkdir /jffs/scripts
said that nothing is created since its already there

next...
Code:
wget -c -O /jffs/scripts/firewall-start http://tinyurl.com/firewall-start
chmod a+rx /jffs/scripts/firewall-start

Then I've rebooted and tried to see if my port 9091 is now opened.
It was not!!! :mad:
I've disabled the firewall and checked again. Now it was opened.

I've tried several times the entire procedure but as long as the firewall is active, the port is not opened.

If I run manually the command:
Code:
iptables -I INPUT -p tcp --destination-port 9091 -j ACCEPT
then everything starts to work, even when the firewall is activated.

Then TeHashX suggested to add the following line in the firewall-start script:
Code:
logger -t "$0" "Hey, I'm working!"
and after reboot I've checked the log and I could not found my test log message. So it looks like the script is not executed at all.



I also tried to execute manually the script with
Code:
sh firewall-start
and I get the following result
Code:
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
'ptables v1.3.8: Invalid target name `ACCEPT
Try `iptables -h' or 'iptables --help' for more information.
plus my test log entry in the log file.
:mad::mad::mad:

So, any idea what I could do next?
 
I've spent many hours trying different things before I decided to create a thread about my problem.

Ten minutes after I created the thread, I've also found the solution.
The problem was in the file I was downloading with wget: http://dl.dropbox.com/u/47669650/RT-N66U/Transmission/firewall-start. It was probably written in windows and contains some ^M characters. Thus it was started but stopped after the first ^M.

I've wrote it manually with nano and voila ... everything works fine now!
I'll be able to sleep tonight.

So sorry for bothering for such a stupid mistake!:o
 
Hello guys! Maybe it's a little bit late, but I have this problem as well. Everyday my router restarts at 3 am then when I get to work and I try to access transmission I can unless I connect via putty and run this lines:

chmod a+rx /jffs/scripts/*
sh /jffs/scripts/firewall-start

Any ideas?

Router: RT-AC56U
FW: 380-59

Thanks.
 
Hello guys! Maybe it's a little bit late, but I have this problem as well. Everyday my router restarts at 3 am then when I get to work and I try to access transmission I can unless I connect via putty and run this lines:

chmod a+rx /jffs/scripts/*
sh /jffs/scripts/firewall-start

Any ideas?

Router: RT-AC56U
FW: 380-59

Thanks.

Look at your system log, check for any reference to "custom script".
 
Hello I did it and there is something like this:


Jul 31 21:00:34 custom script: Running /jffs/scripts/post-mount
Jul 31 21:00:20 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
Jul 31 21:00:36 custom script: Running /jffs/scripts/post-mount (args: /tmp/mnt/sda)
Jul 31 21:00:58 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 03:02:23 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 16:08:35 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
Jun 6 16:08:36 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 16:11:47 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
Jun 6 16:11:48 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 16:59:58 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
Jun 6 17:00:26 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 17:00:37 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 17:05:16 custom script: Running /jffs/scripts/dnsmasq.postconf (args: /etc/dnsmasq.conf)
Jun 6 17:05:43 custom script: Running /jffs/scripts/firewall-start (args: eth0)
Jun 6 17:05:55 custom script: Running /jffs/scripts/firewall-start (args: eth0)

And repeats a lot of time, I'll attached the entire file .

Thanks again.
 

Attachments

So it confirms that the script does get executed. The problem is probably with what's inside your script then, not with the firmware itself.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top