Next-in-Thread Next Message Previous Message Next Thread

More: Re: Which options for 'make config'

Forum: Linux IP NAT Forum
Re: Question options in make config ? (Clement)
Date: Wed, 30 Jul 1997 07:46:40 GMT
From: Michael Hasenstein <hasenstein@yahoo.com>

Fabrice.Clement@ceram.fr asked:

> Which options must be set to make NAT running, when
> recompiling the kernel ?

I've added the following line to linux/net/ipv4/Config.in:
bool 'IP: network address translation' CONFIG_IP_NAT

If you say yes here, the stubs for calling the functions in the nat-module will be called for each incoming and outgoing IP packet, but only if the module has been inserted. If that is not the case, your kernel behaves just as if there was no NAT.

The lines that call NAT in ip_input.c and net/core/dev.c look like this (so that you can see that the overhead if you don't use NAT is negligible):

---- in ip_input.c: ----
#ifdef CONFIG_IP_NAT
        if (ip_nat_fnct)
                ip_nat_fnct(IN_NAT,skb);
#endif

---- in dev.c ----
#ifdef CONFIG_IP_NAT
       /* call for IP-frames only */
       if ((ip_nat_fnct) && (skb->ip_hdr))
               ip_nat_fnct(OUT_NAT,skb);
#endif

(dev.c handles all kinds of packets, not just IP, that's why I had to make sure the module gets called only for IP packets)

Next-in-Thread Next Message Previous Message Next Thread

to: "Re: Which options for 'make config'"

Subscribe Membership Move/Remove Admin Mode Help for HyperNews 1.9.5