|
Fabrice.Clement@ceram.fr asked:
> Which options must be set to make NAT running, when
I've added the following line to linux/net/ipv4/Config.in: 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)
|