Hi all,
I'm trying the NAT feature of NDK on C6657.
What I have in mind is:
1. add two IP address of two different subnets on the same interface and use NAT to link the subnets each other.
2. associate two VLAN to the two addresses
Analyzing the natsrv.c file I understood that the Virtual IP has not to be added to the configuration; so I've tried to enable NAT without XGCONF modifying the client example with this code:
CI_SERVICE_NAT nat;
bzero( &nat, sizeof(nat) );
nat.cisargs.Mode = CIS_FLG_IFIDXVALID | CIS_FLG_RESOLVEIP | CIS_FLG_RESTARTIPTERM;
nat.cisargs.IfIdx = 1;
nat.cisargs.pCbSrv = &ServiceReport;
nat.param.IPVirt = inet_addr("192.168.1.254");
nat.param.IPMask = inet_addr("255.255.255.0");
nat.param.MTU = 1492;
CfgAddEntry( hCfg, CFGTAG_SERVICE, CFGITEM_SERVICE_NAT, 0, sizeof(nat), (UINT8 *)&nat, 0 );
rc = 1;
CfgAddEntry( hCfg, CFGTAG_IP, CFGITEM_IP_IPNATENABLE, CFG_ADDMODE_UNIQUE, sizeof(uint), (UINT8 *)&rc, 0 );
The service report routine print on console "NAT Failed".
Configuring NDK with XGCONF the service seems to work(console shows NAT Enabled) but if I try to ping the virtual IP it doesn't work.
Any idea?