-
For years I've used Freetz (not Freetz-NG) with the addition of a script using /bin/pcplisten The script was a bit comprehensive and probably unnecessary complex, but it turned out to be rock solid. I do not want to revisit that script anymore, so I went to a simple cronjob like this:
I noticed this resulted in only 2 entries in the firewall
and this turned out to be working for all 3 entries. I assume most do not have the need to open 3 ports, but even if it's 2 it's probably more reliable to give the 2nd one a delay. If so, I can finally start using 7.8+ |
Beta Was this translation helpful? Give feedback.
Replies: 11 comments 7 replies
-
This needs more examination... I will come back later. |
Beta Was this translation helpful? Give feedback.
-
Mmmmm, the 127.0.0.1 is incorrect.
As the LAN-IP can be different for each box I tried 169.254.1.1 and that worked too.
|
Beta Was this translation helpful? Give feedback.
-
There was a thread about the same a short time ago To avoid timing problems you could use 119 .. read there!
You could use a script and then you dont need "sleep" |
Beta Was this translation helpful? Give feedback.
-
By using 119 seconds you will make sure that you don't invoke the command too early. If you do, The port will be closed for 2 minutes. For most things it's not a problem, but I have 1 service which does have a problem with it. With this approach I have yet to encounter a missing open port. In the script I was using for classic Freetz I monitored if the opening was succesful and if not, it would retry until it was. If this is working (also under stress) then there may be no need for it. |
Beta Was this translation helpful? Give feedback.
-
Instead "cron" you could try to "sleep". But for multiple ports it could cause delays too... |
Beta Was this translation helpful? Give feedback.
-
I've done some testing and came to the conclusion that the "119 seconds" is safe. So, I'm back at:
Still, I did find some way to expand upon it. I do this by waiting until the box has connected to a timeserver and then I calculate how many seconds there are until the next 2 minutes. I monitored the opening and it was spot on. I logged in using the box from the LAN-interface, but pulled the WAN.
So I will see the time and the port forwards. It apparently opened the ports 65 seconds before 17:42
In my /etc/init.d/rc.xxxxxx script where I fill the cronjob with these values I also have this:
cat /sbin/openports
The moment the FB knows what time it is it starts to open up the ports for the amount of seconds left until the next even minute. |
Beta Was this translation helpful? Give feedback.
-
It's done on purpose, so it doesn't halt the rc.xxx script. |
Beta Was this translation helpful? Give feedback.
-
Some 5 years ago I tested it extensively and ended up using a script which persistently tries pcplisten until it knows it renewed the session. When I switched to freetz-ng I noticed that it was possible again the set it in the Freetz WebIF. Now I like the simplicity of using cron. The above script is merely added to open the ports a bit earlier than the cronjob does for the first time. I think that's covered with:
I don't see it as a downside to use cron. |
Beta Was this translation helpful? Give feedback.
-
When I did my test the box was already running for some time, but the WAN was unplugged. So those "up to 2 minutes" come on top of that. I do agree it may not be worth the effort, but it was a nice programming exercise. |
Beta Was this translation helpful? Give feedback.
-
Not even the port you set for the external AVM-WebIF will have an entry. |
Beta Was this translation helpful? Give feedback.
-
I know that it will be opened at a certain stage and |
Beta Was this translation helpful? Give feedback.
Some 5 years ago I tested it extensively and ended up using a script which persistently tries pcplisten until it knows it renewed the session.
When I switched to freetz-ng I noticed that it was possible again the set it in the Freetz WebIF.
Now that's gone again in 7.8x I need to go back doing it myself.
Now I like the simplicity of using cron.
I am now also more sure there is no problem if the session expired a few seconds.
I was unnecessary afraid of that.
The above script is merely added to open the ports a bit earlier than the cronjob does for the …