4

enter image description here

Description :

I created a Dial-Up Connection Programatically to commnunicate with my device and the Laptop. And once the connection is established with the Dial-Up connection Created, My internet connection which is connected via LAN is not working and the status of my LAN connection ( used for internet connection remains ) connected.

To over come this I need to un-check the "Use Defualt Gate Way on Remote Network", option by, right click my dial-up connection -> properties -> Netwroking TAB -> Select Internet Protocol (TCP/IP) -> Properties -> Advanced -> I get Advanced TCP/IP settings -> Unchek "Use Default Gate Way on Remote Network".

I am using RAS functions to create a Phonebook for my dial-up connection. Is there any structures available to make this as an option. I didnd found any structure parameters to make this as an option. Please advice..

How to to this programatically? Can I use any APIs.

1
  • 1
    Have you checked out route add command? It can be used to add static routes to ip addresses through a gateway ip.
    – Prasanth
    Aug 8, 2012 at 18:26

3 Answers 3

3
+50

I haven't tested to verify it, but I'd guess this corresponds to the ForwardingEnabled element of the MIB_IPINTERFACE_ROW structure. If so, you can change it with SetIpInterfaceEntry.

You'd normally want to call GetIpInterfaceTable to get the current information for each interface, then modify the ForwardingEnabled member for the correct one, then call SetIpInterfaceEntry with that modified MIB_IPINTERFACE_ROW.

2
  • Thanks for your answer, How to check, "this corresponds to the ForwardingEnabled element of the MIB_IPINTERFACE_ROW structure".?
    – 2vision2
    Jul 31, 2012 at 15:09
  • I will make a study on what you said, but still cant I make this option posibble using RAS functions?
    – 2vision2
    Jul 31, 2012 at 15:21
1

By unsetting the RASEO_RemoteDefaultGateway flag while creating phone book will disable this option.

This flag can be Unset using RASENTRY structure dwoptions member.

Content from Microsoft SDK:

RASEO_RemoteDefaultGateway - If this flag is set, the default route for IP packets is through the dial-up adapter when the connection is active. If this flag is clear, the default route is not modified.This flag corresponds to the Use default gateway on remote network check box in the TCP/IP settings dialog box.

0

I'd place my bets on AdvertiseDefaultRoute and DisableDefaultRoutes flags. The use default gateway option simply overrides the current gateway and changes the default route (check route print before and after the connection).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.