Re: Natd sehr langsam

From: Fabian Keil <freebsd-listen(at)fabiankeil.de>
Date: Sat, 16 Aug 2008 12:00:45 +0200

Michael Gusek <michael.gusek(at)web.de> wrote:

> Bernd Walter schrieb:
> > On Fri, Aug 15, 2008 at 03:25:30PM +0200, Michael Gusek wrote:

> >> Gibs noch andere Möglichkeiten, ohne natd ? Warum ist natd unter
> >> 7.0-STABLE amd64 so inperformant ?

> > Nimm ipfw nat.
> > Funktioniert fast genauso, wie natd.
> > Du leitest die Packete per ipfw halt an eine nat Instanz und nicht
> > an einen divert.
> > Ist auch im Kern der gleiche Code, aber geht nicht dauernd zwischen
> > Userland und Kernel hin und her.
> > Warum natd auf amd64 langsammer ist kann ich nciht sagen, aber es ist
> > so oder so lahm.
> > Einzige Einschränkung von ipfw nat ist, dass du eine Stringberenzung
> > für die Konfiguration hast, womit sich vor allem die Anzahl der
> > redirects einschränkt, was man aber vermutlich irgendwo hochcompilieren
> > kann.
> >
> > ipfw nat 123 config if em0 log reset same_ports \
> > redirect_port tcp 192.168.0.3:22 9021
> >
> > ipfw add nat 123 all from any to any in via em0
> > ipfw add nat 123 all from any to any out via em0
  
> Ok, das probier ich mal. Wie sieht das ganze eigentlich mit pf aus ? Wie
> ist das dort gelöst ?

Ähnlich:

nat on $ext_if from <jails> to any -> ($ext_if)
rdr on $ext_if inet proto tcp from any to $external_addr port 9001 -> $zwiebelsuppen_jail
rdr on $ext_if inet proto tcp from any to $external_addr port 443 -> $zwiebelkuchen_jail port 9001

Ich habe ipfw nie für NAT genutzt, aber auf einem System
wo natd etwa 30% der CPU-Last verursachte, ist bei "NAT über pf"
praktisch keine zusätzliche Last messbar.

Fabian


To Unsubscribe: send mail to majordomo(at)de.FreeBSD.org
with "unsubscribe de-bsd-questions" in the body of the message
Received on Sat 16 Aug 2008 - 12:01:01 CEST

search this site