Using the NAT functionality

Hardware: Q2687h
Firmware: 7.73
WIP Plugin: 5.10.2020

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!!

still not available in

Yes i noticed that too. I tried installing the new M2M release with firmware 7.4a to check if it was defined there, but still no luck.

did you already notify your distributor?
they will be able to raise an issue with wavecom.


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…

ciao, Dave

Yes - and i referenced to this topic.

The IP routing functions are implemented in wip library. Just declare them somewhere:

s8 wip_ipRouteAdd(wip_in_addr_t addr, wip_in_addr_t mask, wip_in_addr_t gateway); 
s8 wip_ipRouteDel(wip_in_addr_t dest);

They both work for me.


That’s good to know - thanks. I’ll also try this trick for the missing drvBufIsrXXX functions.

But why aren’t they declared in the supplied WIP headers? This is a bug that Wavecom needs to fix.

ciao, Dave

Thanks, i never thought about that :slight_smile:

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

  1. While initializing TCP/IP stack, set WIP_NET_OPT_IP_FORWARD to TRUE
    i.e. wip_netInitOpts(…,WIP_NET_OPT_IP_FORWARD, TRUE,…);
  2. 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,…);

Hope this helps…