par tomtom » 23 Août 2003 18:16
Il faut faire du statiq nat..
<BR>
<BR>En clair, tu ne dois plus utiliser la cinle MASQUERADE mais la cible SNAT.
<BR>
<BR>extrait du man iptables :
<BR>
<BR> SNAT
<BR> This target is only valid in the nat table, in the POSTROUTING chain. It specifies that the source
<BR> address of the packet should be modified (and all future packets in this connection will also be man
<BR> gled), and rules should cease being examined. It takes one type of option:
<BR>
<BR> --to-source ipaddr[-ipaddr][:port-port]
<BR> which can specify a single new source IP address, an inclusive range of IP addresses, and option
<BR> ally, a port range (which is only valid if the rule also specifies -p tcp or -p udp). If no port
<BR> range is specified, then source ports below 512 will be mapped to other ports below 512: those
<BR> between 512 and 1023 inclusive will be mapped to ports below 1024, and other ports will be mapped
<BR> to 1024 or above. Where possible, no port alteration will occur.
<BR>
<BR> You can add several --to-source options. If you specify more
<BR> than one source address, either via an address range or multiple --to-source options, a simple
<BR> round-robin (one after another in cycle) takes place between these adresses.
<BR>
<BR>
<BR>
<BR>Voila, en clair tu ajoutes une règle du genre :
<BR>
<BR>iptables -t nat -A POSTROUTING -s @privee_server -j SNAT --to-source @ip_bublique_que_tu_veux
<BR>
<BR>
<BR>Ainsi, le serveur utilisera toujours cette ip pour sortir <IMG SRC="images/smiles/icon_wink.gif">
<BR>
<BR>
<BR>T.
One hundred thousand lemmings can't be wrong...