patch iptables v1.4.2 to support CIDR notation for SNAT rules.

Pågår Lagt ut Aug 18, 2013 Betales ved levering
Pågår Betales ved levering

Hello,

I would like to have the source code to iptables version 1.4.12 modified to support the CIDR notation for Source NAT rules. I will explain what I am trying to accomplish.

I have one server with 32,000 IPs. I have a network of a dozen virtual machines. I would like to assign non-routeable internal IP addresses to the virtual machines and have those IP addresses be mapped using Source NAT to an external IP. The virtual machines will use the single server with the IPs configured on it as a gateway. The server with the external IPs will forward the traffic to the internet.

For example:

internal IP: [login to view URL] external IP: [login to view URL]

internal IP: [login to view URL] external IP: [login to view URL]

internal IP: [login to view URL] external IP: [login to view URL]

Currently I have to create a separate rule for each internal and external IP source nat rule. This means I will end up with over 30,000 rules in iptables.

The current iptables rule I use is:

iptables -t nat -A POSTROUTING -s [login to view URL] -j SNAT --to [login to view URL]

iptables -t nat -A POSTROUTING -s [login to view URL] -j SNAT --to [login to view URL]

iptables -t nat -A POSTROUTING -s [login to view URL] -j SNAT --to [login to view URL]

and on and on.

With the patch I would like to be able to create 1 rule using the CIDR notation in place of single IPs:

iptables -t nat -A POSTROUTING -s [login to view URL] -j SNAT --to [login to view URL]

This way when a packet comes on the wire from [login to view URL] the rule should translate it to 24.247.0.2.

or if a packet comes from [login to view URL] it would translate to [login to view URL]

I will provide two virtual machines to test from, with ubuntu 13.10 x64 and a /19 worth of IP space to test with.

C-programmering C++ Programmering Linux Programvarearkitektur

Prosjekt-ID: #4838932

Om prosjektet

1 bud Eksternt prosjekt Aktiv Aug 18, 2013