Change Internet Gateway IP from within a Harbour program

101 views
Skip to first unread message

Jayadev U

unread,
Feb 11, 2021, 1:35:02 AM2/11/21
to harbou...@googlegroups.com

Hi,

 

In a company, there are multiple gateways viz. 192.168.1.1 ( abc service provider for internet), 192.168.1.100 (xyz service provider internet). The user has to switch between the different gateways based on if the internet is working or not for a particular service provider.

 

Presently, the user has to go network settings ->change adapter settings->Choose adapter properties->go to IPv4 properties and change the gateway manually.  (Please note adding multiple gateways to the network adapter is not switching the gateways automatically).

 

Users are demanding a software so that they are saved from the hassle. Can we change the gateway from within a Harbour program ?

 

Kindly note that more than 1 adapter may be present, viz: wifi and lan in a laptop and only lan in Desktops.

 

Warm regards,

 

Jayadev

 

Bernard Mouille

unread,
Feb 11, 2021, 3:58:43 AM2/11/21
to Harbour Users
Hello Jayadev,

I remember that you works with Windows.
Maybe you can find a way with my attached basic sample.

Regards,
Bernard.
Test.txt

Jayadev U

unread,
Feb 11, 2021, 5:10:33 AM2/11/21
to harbou...@googlegroups.com

Thanks Bernard, Helpful as always.

 

The SetGateways method of the Win32_NetworkAdapterConfiguration class should allow me to assign a gateway.  I will investigate further and revert.

Thanks for your immediate response my friend.

Warm regards,

Jayadev U

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/ee32c042-76fb-453b-8f30-d2091a11462an%40googlegroups.com.

jgt

unread,
Feb 11, 2021, 10:47:37 AM2/11/21
to Harbour Users
Wouldn't a load balancing router be a simpler solution? https://www.amazon.ca/TP-Link-TL-R470T-Broadband-Changeable-Ethernet/dp/B005SYQBN8

Jayadev U

unread,
Feb 11, 2021, 11:40:39 AM2/11/21
to harbou...@googlegroups.com

Hi,

 

Thanks for the info.  Yes that is already under consideration.  However, since the orgainzation is very small ( only 3 users) an easier approach was being looked into.

 

Thanks for the help anyways.

 

Warm regards,

 

Jayadev

Reply all
Reply to author
Forward
0 new messages