Routing Table Ethernet and PPP

I have following problem. My application connects to a ISP (active connection mode) via a GSM modem. The device gets a public ip address. But i cannot ping it. The problem is that the device routes the packets to the ethernet plug. For Example: Ethernet is configured as 192.168.2.244. I want my application to route all packets to ehternet if it is 192.168.2.x ( 255.255.255.0 ), all other packets received from ppp should be routed trough ppp (com1). As I have only PPPAddRoute function I am not able todo this. Knows someone how to solve this problem.

If you want all packets routed to the PPP channel you should change the default route to be the PPP interface instead of the ethernet. You can use the following two functions: extern int ip_add_static_route(char *devname, u32 daddress, u32 subnet, u32 gateway, int cost); extern int ip_del_static_route(u32 ip_address, u32 ip_mask); First delete the existing default route that is directed to the ethernet interface, you do this by deleting static route with destination 0.0.0.0 & mask 0.0.0.0. Then add a new static route to device name “ppp0”, destination 0.0.0.0, mask 0.0.0.0 and set gateway to the assigned ip address (PPPGetPeerAssignedAddresse()), the cost is 1. Note, I belive you should do this after the link us up. Best regards, Thomas Maltesen Prolon Control Systems

Chris, I had this same type of problem. Make sure you call NAIpSetIpForwarding(TRUE) in your app. You can call it sometime at the beginning of the app. You will also need to have your routing table correct on your PC (on the ethernet) to default route to the ethernet interface on the NetSilicon board. You should also add a default route using the PPPAddRoute to route everything except the ethernet subnet out the ppp interface. Use the PPPGetPeerAssignedAddress to get the address for the default route. When the ethernet interface comes up, a route will be added for it that will automatically do what you want on the ethernet link, provided the netmask is correct. Hope that helps.

HiI am dialing my ISP, and can get the “PPPGetPeerAssignedAddress”, but how can I get the Public IP assigned from the ISP? Thanks Felix

HiThanks I will try that :slight_smile: btw. Where is the documentation for the “ip_add_*” functions, I can’t find it in the API Reference. So the PPP public IP and gateway adress is the same? - normally there is a gateway and a public ip adress assigned from the ISP right? I working on a GPRS modem, and for starters I am dialing analog, when using GPRS the dial string is a little different. Thanks Felix

HiThere is success :slight_smile: Thanks a million Meaning that I can ping the Public IP (PPPGetPeerAssignedAddress) from my PC Felix

Hi,(I am not able to ping) I connect to internet using dial-up connection via GSM modem (Wavecom) and the ISP is Vodafone. It gets connected fine and I am able to browse the internet as well. But, I am not able to ping a website. Though, when I ping, I am able to resolve the domain name. I don’t know whether it is a latency problem or the routing problem. Cheers! Sameer