locked
If network cable is plugged route command fails to add gateway RRS feed

  • Question

  • Network cable is plugged and connection is established.

    In the above state, i am setting the IP address using below commands:

    netsh interface ip set address "Local Area Connection" static address=10.0.5.99 mask=255.255.255.0 gateway=10.0.5.1
    netsh interface ip set dnsservers name="Local Area Connection" static 10.0.5.1 primary no
    route delete 0.0.0.0
    route -p add 0.0.0.0 mask 0.0.0.0 10.0.5.1

    After the executing above commands, gateway field is blank and internet connection is gone.

    However the above mentioned commands work properly in network cable unplugged state.

    Please let me know why "route" command is not able set gateway in case of network cable plugged state.

    Monday, January 11, 2016 2:44 PM

Answers

All replies

  • What does this have to do with VC++?
    Monday, January 11, 2016 2:51 PM
  • Hi,

    Please suggest the right forum to post my query (to understand the "route" command behavior in network cable plugged state and unplugged state)

    Monday, January 11, 2016 3:41 PM
  • Hi,

    Please suggest the right forum to post my query (to understand the "route" command behavior in network cable plugged state and unplugged state)


    You've already cross posted this question in several forums.
    Monday, January 11, 2016 3:52 PM
  • Hi murali_m

    You can put your post to the place :https://social.msdn.microsoft.com/Forums/en-US/home?forum=whatforum

    Best Regards,

    Hart Cheng

    Wednesday, January 13, 2016 7:57 AM
  • They'll help you over here.

    https://social.technet.microsoft.com/Forums/en-US/home?forum=w7itpronetworking%2Cwin10itpronetworking&filter=alltypes&sort=lastpostdesc

     

     

     


    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

    • Proposed as answer by Mike Laughlin Monday, January 25, 2016 1:05 PM
    • Marked as answer by Just Karl Monday, February 1, 2016 11:11 PM
    • Unmarked as answer by murali_m Monday, March 7, 2016 1:01 AM
    • Unproposed as answer by murali_m Monday, March 7, 2016 1:02 AM
    • Marked as answer by murali_m Monday, March 7, 2016 1:03 AM
    Saturday, January 23, 2016 6:03 PM