I have tried to put the Interface and got problem. However, I need IP
address instead interface in the script.
"Art Garret" <(E-Mail Removed)> wrote in message news:<3f104fc4$0$48983$(E-Mail Removed)>...
> Instead of using -d and specifying the IP address of the external interface,
> you should use -i and specify the external interface by name, example:
>
> IPTABLES -A INPUT -s 0/0 -i eth1 -p tcp.... bla..bla
>
> If your external interface is eth1.
>
> However, based on your statement of wanting to "protect" your "external IP,"
> it seems to me that your approach is upside down. Instead of making specific
> rules to prevent or "protect" access to the machine, you should deny all
> traffic and then make specific rules to allow the traffic you want.
>
> for example:
>
> # default policy drop ALL packets to the INPUT chain
> iptables -P INPUT DROP
>
> #expressly allow all traffic from my internal network:
> iptables -A INPUT -s 10.0.0.0/8 -j ACCEPT
>
> #expressly allow web traffic:
> iptables -A INPUT -p tcp --dport 80 -J ACCEPT
>
> and so on.... That way you don't need to worry about what your external IP
> address is. The only time you should need to worry about what your current
> external IP address is is with SNAT targets.
>
> Note that the above doesn't include rules for the OUTPUT and FORWARD chains.
>
> Hope this helps.
>
>
> "Awie" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed) om...
> > All,
> >
> > Is there a command to capture IP address of interface?
> >
> > For example:
> >
> > External_IP="the_command_to_capture eth0"
> >
> > IPTABLES -A INPUT -s 0/0 -d $External_IP -p tcp.... bla..bla
> >
> > It will be helpful for me to put in the F/W script. If I change the IP
> > address (and re-start machine), the script will automatically protect the
> > new IP address.
> >
> > Thx & Rgds,
> >
> > Awie
|