[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: iptables related query

On 2005-07-03 @ 10:04:20 (week 26) Yuriy Kuznetsov wrote:

> Hi,
> I'm new to iptables therefor I need your help with some basic operation. 
> I have installed Debian with 2.6 kernel and now trying to set some
> iptables rules. From what I have found in some nice examples in google
> I understood that I need to start iptables by running
> /etc/init.d/iptables. But I can not see   'iptables' in
> /etc/init.d. Although I have installed 'iptables' and 'iptables-dev' I
> still can not find /etc/init.d/iptables on the system. There is
> /sbin/iptables but I think it's something different. Could you advice
> me on what I'm missing

Hi Yuriy,

Here's an excerpt from a webpage I wrote a few years ago. It is was intended
for people that didn't have "alway on" Internet, but it works just as well if
you do.

Make sure iptables is activated immediately before the networkinterface comes
up and that it is deactivated after the interface goes down. To achieve that
edit the file /etc/network/interfaces and add pre-up and post-down instructions
for the intended interface:

iface eth0 inet static
        address xxx.xxx.xxx.xxx
        netmask xxx.xxx.xxx.xxx
        network xxx.xxx.xxx.xxx
        broadcast xxx.xxx.xxx.xxx
        gateway xxx.xxx.xxx.xxx
        pre-up <preferred iptables start command>
        post-down <preferred iptables stop command>

Activate the new ruleset by re-initializing the networkinterface with "ifdown
eth0" followed by "ifup eth0".

Check the active ruleset with the command iptables -L to verify all went well.


Grx HdV

Reply to: