Bekijk de volledige versie : Reload port forwarding rules without reseting router?
I'm using Oleg's custom firmware version 1.9.2.7-6b. I'm wondering if there's a way to reload the router's port forwarding rules without reseting it. I want to avoid re-requesting a lease from the DHCP server (not within my control), since for some reason it's sluggish and usually takes ~1 min for me to acquire a lease.
Since the router uses iptables, it should be possible to update the settings without resetting the router. On regular Linux boxes (RH at least), "/sbin/service iptables restart" would do the trick, but that doesn't work.
Any ideas? :confused:
I'm using Oleg's custom firmware version 1.9.2.7-6b. I'm wondering if there's a way to reload the router's port forwarding rules without reseting it. I want to avoid re-requesting a lease from the DHCP server (not within my control), since for some reason it's sluggish and usually takes ~1 min for me to acquire a lease.
Since the router uses iptables, it should be possible to update the settings without resetting the router. On regular Linux boxes (RH at least), "/sbin/service iptables restart" would do the trick, but that doesn't work.
Any ideas? :confused:
I am also interested in this one. Realy there is noone who knows how to reload the iptables settings?
Well, some people (they have all the luck ?) do know that.
But that knowledge wasn't built into their brains at their birth,
no, they managed to learn it in some way.
You could do that too, you know.
For instance, read the man, or some faq on iptables, and
perhaps you will find something called iptables-restore.
This command is useful for loading a comlete set of rules
into iptables and activate them. It is available in the mentioned
firmware-versoin, and it is used at boottime to load the rules
that are generated in some /tmp/*_rules files.
Copy the contents of /tmp/nat_rules and /tmp/filter_rules (in that
order) into a new file (e.g. /usr/local/etc/iptables), see for yourself
what you want to do with the contents of /tmp/nat_forward_rules
(they are still unclear to me), and execute
#!/bin/sh
iptables-restore</usr/local/etc/iptables
You could also clear all rules and rebuild them with a bunch of
individual iptables-commands, using the options to flush all rules,
to set default behaviour for chains and to add rules to chains.
Really, if you take some time to search the web, you will find
hundreds of examples. But yes, you do have to invest some
time to do all that, and on top of all take the risk that you will
actually learn something...
Sancho, in case you missed the point: the way you asked this
is not very polite. A simple "please" can do wonders, and it
won't hurt you. Considering the fact that we are all volunteers
on this forum, there is nothing wrong with being less offensive.
Now, if you opt for the iptables-restore, you should know that
there is also an iptables-save, which will save the current ruleset
in the format as used in the *_rules-files, so it's ready to reload it with
iptables-restore. Unfortunately, this command is not available in the
current firmware-release. You may be interested in this, because with
this command you are able to save the counters of each rule
(in the generated files they are zero, represented by the [0:0]
at the beginning of almost every line), and thus you can preserve
those counters over reboots. Those counters can give you nice
statistical information, on a very detailed level.
Since most people will probably not be interested in this, I think Oleg
made a wise decision in leaving this program out of the firmware.
But if you are interested in it, you can always try to get a mipsel-version
of it and install it on your Asus. You can also see the values of those
counters when you execute
iptables -L -v -n
Good luck, and regards, Jaap.
Sorry for beeing inpolite.
Didn't mean to.
I was only a little disappointed that noone get us at elast a hit, wich, usualy, is a matter of hours at this forum.
Once again sorry and thanks for the answer - helped a lot.
Regards
I'm still trying to teach myself to count to ten first, as a result of all this...
The moment I saw other posts from your hand I realized you never would
have had the intention of being impolite.
Forgive and forget?
Regards, Jaap,