Setup: Linux host running a slightly modified version of the LwiP test example code. PPPoS to uBlux W132 Wifi module Wifi module attached to home network with internet access
Problem: I cannot open a TCP socket to echo.u-blox.com. The error is always "No Route To Host". I think the problem is my limited understanding of networking! I believe that LwIP, PPP and my module are working correctly, but I don't know how to open a socket to the outside world! It is also possible I have not configured LwIP correctly for the gateway although the IP addresses and gateway for PPP are auto configured over PPP. There is very little that can be configured on the WiFi module itself.
Further Info: Network topology is shown below. I can ping 192.168.1.121 from other PCs on my home network, but only while the LwIP code is running (shows LwIP is handling the ping). I can open a UDP socket to 172.30.0.251:23 from LwIP to the WiFi module and use it to send AT commands to configure the module. I can call lwip_gethostbyname("echo.u-blox.com") to get the correct IP address (195.34.89.241) so DNS is working.
Linux Host
Running LWiP W132 WiFi Module Home Network Destination
172.30.0.252 <-- PPPoS --> 172.30.0.251 <> 192.168.1.121 <-- WiFi --> 192.168.1.XXX <> ext ip <-- Internet --> 195.34.89.241
Netmask Netmask
255.255.255.255 255.255.255.0
Gateway Gateway
172.30.0.251 192.168.1.1
DNS
172.30.0.251
When I step through the LWiP code it fails on the call to ip_route as the target IP address does not match the subnet and mask or the gateway IP address. I am not sure how to open a socket that meets these criteria but also has the correct destination address specified.
Thanks in advance, I can provide further info if required.