I am in the situation where i need the NAT functionality, which is provided with WIP 5.10.2020 ( page 68 in the WIP Plug-in Development Guide). However, they provide no examples at all how to use this NAT.
Heres’ what i need todo:
I’ve setup a PPP server in the modem listening on UART1. This works fine, i can connect to it from my client PC and i also get assigned an IP. I also have the GPRS bearer up and running, which also works fine. I can start a TCP client or server and connect to it through GPRS (i use sim cards with public IP). Now what i need is to connect those two interfaces with NAT so that the GPRS interface is public and the UART1 PPP interface is private.
So the question can be boiled down to this: How do one “connect” two interfaces through the NAT functionality?
EDIT: Where is the definition of wip_ipRouteAdd, which is documented in the WIP Plug-in Development Guide 5.10 PDF?? I cannot find it in any of the WIP header files for WIP-Plugin 5.10.2020!!
I’ve raised this with my distributor today as a matter of urgency.
I’ve also raised the fact that the wip_drvBufIsr[i]XXX/i functions are also not available either - and these functions are required for use inside ehternet interrupt functions…
However, even with these functions i am not able to get my idea to work as stated in my first post.
I need to somehow provide a ppp server in the modem, which acts as a router so that if a client PC connects to the ppp server, then it has internet access through the modem.
I think “wip_ipRouteAdd” and “wip_ipRouteDel” is not required for ur scenario.
To enable NAT functionality, the following options needs to be included
While initializing TCP/IP stack, set WIP_NET_OPT_IP_FORWARD to TRUE
i.e. wip_netInitOpts(…,WIP_NET_OPT_IP_FORWARD, TRUE,…);
and finally make one of the bearer as the public interface. For example, if you want GPRS to be the “public interface”, during “wip_bearerSetOpts” for “GPRS” bearer peform the following
wip_bearerSetOpts(…,WIP_BOPT_EXTNAT/GPRS is public interface/, TRUE,…);