Skip to contentSkip to conversation

iptables and SPI...

DISCUSSION dimitri borjac 2 participants 2 messages Oct 31, 2003 netfilter

lore
Share & tools
lore
#0 lore raw
Quoted 9 lines

-----Message d'origine-----
De : Henrik Nordstrom [mailto:[email protected]] Envoyé : vendredi 31 octobre 2003 18:42
À : dimitri borjac
Cc : [email protected]; [email protected] Objet : RE: iptables and SPI...

Quoted 1 line · dimitri borjac

what i'm trying to do is to perform NAT based on

Quoted 8 lines

IP_addresses/Ports/SPIs.
Why not simply using a IP-Sec implementation supporting the
NAT-Transversal standard?
IP-Sec is generally not very happy about being NAT:ed. For examle AH is
totally incompatible with NAT (unless using the NAT-Transversal
standard).
Regards
Henrik

Just because I don't want to be compelled to use NAT-Traversal :)

And the only solution in this case is to NAT using the SPI... indeed by default AH is not compatible with NAT, and neither is ESP in transport mode, but ESP in tunnel mode supports the NAT (since the whole encrypted IP packet is encapsulated in a new IP header).

The only problem then (with ESP in tunnel mode) is for the local gateway : it has to know who the encrypted packet coming back to the local network is destinated to... that's where the SPI is helpful.

So the problem is still there... is it possible to extend the NAT functions of iptables in order to make the local gateway read and use the SPI for NATting packets ?

Regards,
dimo

_________________________________________________________________
Trouvez l'âme soeur sur MSN Rencontres ! http://g.msn.fr/FR1000/9551

#1 lore raw
Quoted 3 lines · dimitri borjac

So the problem is still there... is it possible to extend the NAT functions of iptables in order to make the local gateway read and use the SPI for NATting packets ?

You will need to write a ESP protocol conntrack module, similar to the UDP or ICMP conntrack modules. Note however that this will only work assuming it is the NAT:ed endpoint which sends the initial packet ESP per SPI. For situations where it is the other endpoint who sends the initial ESP packet for this SPI then you need to somehow decode IKE to know that the SPI has been negotiated. Unless my memory is wrong this may be a little hard due to encryption of the IKE protocol..

Regards
Henrik