Re: Dynamic IP address in a rule?

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

 



2009/4/26 Jorge Bastos <mysql.jorge@xxxxxxxxxx>
>
> > Hi,
> >
> > My IP is dynamically assigned and I want a rule like this one:
> >
> > iptables -I INPUT 1 -d my_ip_address  -m state --state NEW -j ULOG
> >
> > Can a rule work out the IP address of its host?
>
> That's a nice question, instead of the dynamic IP on the rule, having a
> dynamic host on it like:
>
> Iptables -I INPUT -I eth0 -d myhost.dyndns.org -p tcp --dport 80 -j ACCEPT
>
> When this run's, the rule will stay with the IP address that was grabbed
> from the dynamic host, and when the IP changes, the rule won't work
> anymore.

Just because of that I don't like dynamic IPs. But, are you using more
than one IP on that interface?? So, if you use more than one, there
are only one you don't know(probably), specify the rules for the ones
you know first!!
If you have only one IP address, try simply doing the rule for the
incoming interface and be happy ;)

Another way is to set your after-dhcp script to reload your firewall!!

> My question is, there's no way to make iptables to check always the host
> instead of translation the host do IP on the rule apply stage?
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- Bruno M. Guedes
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux