* Double stack IPv4&&IPv6 for a firewall @ 2012-08-24 10:40 Arturo Borrero 2012-08-24 14:29 ` John A. Sullivan III 0 siblings, 1 reply; 10+ messages in thread From: Arturo Borrero @ 2012-08-24 10:40 UTC (permalink / raw) To: netfilter [-- Attachment #1: Type: text/plain, Size: 1018 bytes --] Hi there! The way is recommended to implement IPv6 in a network while IPv4 is still alive is double stack. In a network where all have DNS records, double stack means that each FQDN has an A reg. and an AAAA reg. So, deploying a DNS-based firewall takes you to duplicate the ruleset, first for iptables/ip6tables and then for ipset family inet/ipset family inet6 The question is: Do anyone knows a program, framework, script, method or whatever to face this situation? I'm talking of an 'abstraction' method that hides the differences between iptables/ip6tables, as long as is using almost always FQDNs with both DNS regs to configure the ruleset. Best regards. -- Arturo Borrero González Departamento de Seguridad Informática, @NIS_CICA (twitter) Centro Informático Científico de Andalucía (CICA) Avda. Reina Mercedes s/n - 41012 - Sevilla (Spain) Tfno.: +34 955 056 600 / FAX: +34 955 056 650 Consejería de Economía, Innovación, Ciencia y Empleo Junta de Andalucía [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 4238 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-24 10:40 Double stack IPv4&&IPv6 for a firewall Arturo Borrero @ 2012-08-24 14:29 ` John A. Sullivan III 2012-08-24 14:41 ` Jan Engelhardt 0 siblings, 1 reply; 10+ messages in thread From: John A. Sullivan III @ 2012-08-24 14:29 UTC (permalink / raw) To: Arturo Borrero; +Cc: netfilter On Fri, 2012-08-24 at 12:40 +0200, Arturo Borrero wrote: > Hi there! > > The way is recommended to implement IPv6 in a network while IPv4 is > still alive is double stack. > In a network where all have DNS records, double stack means that each > FQDN has an A reg. and an AAAA reg. > > So, deploying a DNS-based firewall takes you to duplicate the ruleset, > first for iptables/ip6tables and then for ipset family inet/ipset family > inet6 > > The question is: > > Do anyone knows a program, framework, script, method or whatever to face > this situation? > > I'm talking of an 'abstraction' method that hides the differences > between iptables/ip6tables, as long as is using almost always FQDNs with > both DNS regs to configure the ruleset. > > Best regards. > > Hmm . . . perhaps it has changed but, when I investigated it years ago, using FQDNs for iptables rules was problematic in that the names were only resolved at the time the rules were loaded. If any of the addresses change, the firewall is completely unaware of the change as it does not resolve the name on each query. Is that still the case? - John ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-24 14:29 ` John A. Sullivan III @ 2012-08-24 14:41 ` Jan Engelhardt [not found] ` <CAPfcJatemcsT5PK+m8__xhB7gBRinAuq2wNX_g93CQrSmvtDhQ@mail.gmail.com> 0 siblings, 1 reply; 10+ messages in thread From: Jan Engelhardt @ 2012-08-24 14:41 UTC (permalink / raw) To: John A. Sullivan III; +Cc: Arturo Borrero, netfilter On Friday 2012-08-24 16:29, John A. Sullivan III wrote: >On Fri, 2012-08-24 at 12:40 +0200, Arturo Borrero wrote: >> Hi there! >> >> The way is recommended to implement IPv6 in a network while IPv4 is >> still alive is double stack. >> In a network where all have DNS records, double stack means that each >> FQDN has an A reg. and an AAAA reg. >> >> So, deploying a DNS-based firewall takes you to duplicate the ruleset, >> first for iptables/ip6tables and then for ipset family inet/ipset family >> inet6 >> >> The question is: >> >> Do anyone knows a program, framework, script, method or whatever to face >> this situation? >> >> I'm talking of an 'abstraction' method that hides the differences >> between iptables/ip6tables, as long as is using almost always FQDNs with >> both DNS regs to configure the ruleset. >> >> Best regards. >> >> >Hmm . . . perhaps it has changed but, when I investigated it years ago, >using FQDNs for iptables rules was problematic in that the names were >only resolved at the time the rules were loaded. If any of the >addresses change, the firewall is completely unaware of the change as it >does not resolve the name on each query. Is that still the case? - John Naturally, since DNS lookups will introduce a shitload of latency and error potential (like, when DNS itself fails) were it done for every packet. ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <CAPfcJatemcsT5PK+m8__xhB7gBRinAuq2wNX_g93CQrSmvtDhQ@mail.gmail.com>]
* Re: Double stack IPv4&&IPv6 for a firewall [not found] ` <CAPfcJatemcsT5PK+m8__xhB7gBRinAuq2wNX_g93CQrSmvtDhQ@mail.gmail.com> @ 2012-08-24 23:46 ` Jan Engelhardt 2012-08-26 3:38 ` Julien Vehent [not found] ` <CAPfcJaugwb5DboUYGAfEktHCDZX0KxdCWdS9CyAu3rh94P8inQ@mail.gmail.com> 0 siblings, 2 replies; 10+ messages in thread From: Jan Engelhardt @ 2012-08-24 23:46 UTC (permalink / raw) To: Arturo Borrero; +Cc: netfilter, John A. Sullivan III On Friday 2012-08-24 23:12, Arturo Borrero wrote: > >DNS lookups are a problem in a big ruleset (~10.000) rules, so the point is >to do some kind of local cache. So run a local BIND server, lwresd, dnsmasq, nscd, or whatever. >As I supposed, the doble stack method is not being well aproached yet. What isn't? >The code (bash) is here: >https://github.com/aborrero/fw-admin sh is amongst the *slowest* of all. Your README.md says >You usally set your ruleset in this way: > >$IPT -A INPUT -i $IF -s $INTERNET -d $MYSERVER -p tcp --sport 1024: --dport >$SSH_PORT -j ACCEPT If you begin with something like this, no wonder it's all going slow, because you are needlessy reloading all the damn rules. That's why smart people use iptables-restore. Also, the --sport 1024: is pretty dull, because there is no RFC that forbids the use of numbers lower than that. >Also, fw-admin is just a complex bash script Its greatest problem, btw. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-24 23:46 ` Jan Engelhardt @ 2012-08-26 3:38 ` Julien Vehent [not found] ` <CAPfcJaugwb5DboUYGAfEktHCDZX0KxdCWdS9CyAu3rh94P8inQ@mail.gmail.com> 1 sibling, 0 replies; 10+ messages in thread From: Julien Vehent @ 2012-08-26 3:38 UTC (permalink / raw) To: netfilter On 2012-08-24 19:46, Jan Engelhardt wrote: > On Friday 2012-08-24 23:12, Arturo Borrero wrote: >>You usally set your ruleset in this way: >> >>$IPT -A INPUT -i $IF -s $INTERNET -d $MYSERVER -p tcp --sport 1024: >> --dport >>$SSH_PORT -j ACCEPT > > If you begin with something like this, no wonder it's all going slow, > because you are needlessy reloading all the damn rules. > That's why smart people use iptables-restore. > Oh, only about ~2000 times faster in my tests :p http://www.slideshare.net/slideshow/embed_code/14051936?startSlide=22 -- Julien Vehent - http://jve.linuxwal.info ^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <CAPfcJaugwb5DboUYGAfEktHCDZX0KxdCWdS9CyAu3rh94P8inQ@mail.gmail.com>]
* Re: Double stack IPv4&&IPv6 for a firewall [not found] ` <CAPfcJaugwb5DboUYGAfEktHCDZX0KxdCWdS9CyAu3rh94P8inQ@mail.gmail.com> @ 2012-08-28 8:55 ` Arturo Borrero 2012-08-28 11:43 ` Julien Vehent 2012-08-28 11:45 ` Amos Jeffries 0 siblings, 2 replies; 10+ messages in thread From: Arturo Borrero @ 2012-08-28 8:55 UTC (permalink / raw) To: julien; +Cc: netfilter > On 2012-08-24 19:46, Jan Engelhardt wrote: > > On Friday 2012-08-24 23:12, Arturo Borrero wrote: > > >>You usally set your ruleset in this way: > >> > >>$IPT -A INPUT -i $IF -s $INTERNET -d $MYSERVER -p tcp --sport 1024: > >> --dport > >>$SSH_PORT -j ACCEPT > > > > If you begin with something like this, no wonder it's all going slow, > > because you are needlessy reloading all the damn rules. > > That's why smart people use iptables-restore. > > > > Oh, only about ~2000 times faster in my tests :p > http://www.slideshare.net/slideshow/embed_code/14051936?startSlide=22 Well, but the problem of writting two different rulesets with the same info is still unsolved. And If you permit my point of view, I think it's harder to solve using iptables-restore than using bash and iptables/ip6tables (because variables, additional flexibility of bash, etc...) Maybe the point would be to generate with Bash a iptables-restore ruleset to load to kernel, but not load the ruleset directly from Bash... -- Arturo Borrero González Departamento de Seguridad Informática, @NIS_CICA (twitter) Centro Informatico Cientifico de Andalucia (CICA) Avda. Reina Mercedes s/n - 41012 - Sevilla (Spain) Tfno.: +34 955 056 600 / FAX: +34 955 056 650 Consejería de Economía, Innovación, Ciencia y Empleo Junta de Andalucía ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-28 8:55 ` Arturo Borrero @ 2012-08-28 11:43 ` Julien Vehent 2012-08-28 11:45 ` Amos Jeffries 1 sibling, 0 replies; 10+ messages in thread From: Julien Vehent @ 2012-08-28 11:43 UTC (permalink / raw) To: Arturo Borrero; +Cc: netfilter On 2012-08-28 04:55, Arturo Borrero wrote: > Maybe the point would be to generate with Bash a iptables-restore > ruleset to load to kernel, but not load the ruleset directly from > Bash... > > Correct. The syntax of iptables-restore is similar to the one of iptables, with the addition of the ordering that needs to be respected. Then, simply issue `iptables-restore < /path/to/ruleset`. - Julien ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-28 8:55 ` Arturo Borrero 2012-08-28 11:43 ` Julien Vehent @ 2012-08-28 11:45 ` Amos Jeffries 2012-08-28 12:08 ` Arturo Borrero 1 sibling, 1 reply; 10+ messages in thread From: Amos Jeffries @ 2012-08-28 11:45 UTC (permalink / raw) To: Arturo Borrero; +Cc: julien, netfilter On 28/08/2012 8:55 p.m., Arturo Borrero wrote: >> On 2012-08-24 19:46, Jan Engelhardt wrote: >>> On Friday 2012-08-24 23:12, Arturo Borrero wrote: >>>> You usally set your ruleset in this way: >>>> >>>> $IPT -A INPUT -i $IF -s $INTERNET -d $MYSERVER -p tcp --sport 1024: >>>> --dport >>>> $SSH_PORT -j ACCEPT >>> If you begin with something like this, no wonder it's all going slow, >>> because you are needlessy reloading all the damn rules. >>> That's why smart people use iptables-restore. >>> >> Oh, only about ~2000 times faster in my tests :p >> http://www.slideshare.net/slideshow/embed_code/14051936?startSlide=22 > Well, but the problem of writting two different rulesets with the same > info is still unsolved. > > And If you permit my point of view, I think it's harder to solve using > iptables-restore than using bash and iptables/ip6tables (because > variables, additional flexibility of bash, etc...) > > Maybe the point would be to generate with Bash a iptables-restore > ruleset to load to kernel, but not load the ruleset directly from > Bash... I use a wrapper generator called "ferm". It generates the iptables/ip6tables once with a lot of flexibility, then uses iptables-save/restore to operate the system. AYJ ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-28 11:45 ` Amos Jeffries @ 2012-08-28 12:08 ` Arturo Borrero 2012-08-28 12:21 ` Amos Jeffries 0 siblings, 1 reply; 10+ messages in thread From: Arturo Borrero @ 2012-08-28 12:08 UTC (permalink / raw) To: Amos Jeffries; +Cc: julien, netfilter [-- Attachment #1: Type: text/plain, Size: 751 bytes --] On 28/08/12 13:45, Amos Jeffries wrote: > I use a wrapper generator called "ferm". It generates the > iptables/ip6tables once with a lot of flexibility, then uses > iptables-save/restore to operate the system. Reading `ferm' documentation, it seems that the original issue is still latent: domain [ip|ip6] You have yo choose one of the two keywords, what forces you to write the firewall twice. Or i'm wrong? -- Arturo Borrero González Departamento de Seguridad Informática, @NIS_CICA (twitter) Centro Informático Científico de Andalucía (CICA) Avda. Reina Mercedes s/n - 41012 - Sevilla (Spain) Tfno.: +34 955 056 600 / FAX: +34 955 056 650 Consejería de Economía, Innovación, Ciencia y Empleo Junta de Andalucía [-- Attachment #2: S/MIME Cryptographic Signature --] [-- Type: application/pkcs7-signature, Size: 4238 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: Double stack IPv4&&IPv6 for a firewall 2012-08-28 12:08 ` Arturo Borrero @ 2012-08-28 12:21 ` Amos Jeffries 0 siblings, 0 replies; 10+ messages in thread From: Amos Jeffries @ 2012-08-28 12:21 UTC (permalink / raw) To: Arturo Borrero; +Cc: julien, netfilter On 29/08/2012 12:08 a.m., Arturo Borrero wrote: > On 28/08/12 13:45, Amos Jeffries wrote: >> I use a wrapper generator called "ferm". It generates the >> iptables/ip6tables once with a lot of flexibility, then uses >> iptables-save/restore to operate the system. > > Reading `ferm' documentation, it seems that the original issue is > still latent: > > domain [ip|ip6] > > You have yo choose one of the two keywords, what forces you to write > the firewall twice. > > Or i'm wrong? > If you wish you can write "domain (ip ip6) { .. } ". which expands the .. rules list for both. AYJ ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-08-28 12:21 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-24 10:40 Double stack IPv4&&IPv6 for a firewall Arturo Borrero
2012-08-24 14:29 ` John A. Sullivan III
2012-08-24 14:41 ` Jan Engelhardt
[not found] ` <CAPfcJatemcsT5PK+m8__xhB7gBRinAuq2wNX_g93CQrSmvtDhQ@mail.gmail.com>
2012-08-24 23:46 ` Jan Engelhardt
2012-08-26 3:38 ` Julien Vehent
[not found] ` <CAPfcJaugwb5DboUYGAfEktHCDZX0KxdCWdS9CyAu3rh94P8inQ@mail.gmail.com>
2012-08-28 8:55 ` Arturo Borrero
2012-08-28 11:43 ` Julien Vehent
2012-08-28 11:45 ` Amos Jeffries
2012-08-28 12:08 ` Arturo Borrero
2012-08-28 12:21 ` Amos Jeffries
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.