none
If network cable is plugged route command fails to add gateway

    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