Is there a way in OpenVPN to change the VPN server ip or location and this can be done on my system using OPENVPN - c

So I am in need to some info about openVPN that allows to change VPN server Ip or location.
The idea basically is if there is a way to change VPN server location and restart openVPN in my system so the IP gets changed of connecting VPN server so the website will see the updated IP address in my HTTPS request. May some commands that I can use in bash script and run the script from my program so Ip gets updated of VPN server. Is it doable in C and Linux,OpenVPN. if there is any pure C solution then that will be awesome, Is there a way of doing it?

Related

All but one Windows 11 Surface Tablet can make remote connection to SQL Server

I have SQL Server Express 2017 running on Windows Server 2016 Standard (default instance, not named). It has remote connections enabled and is listening on port 1433 and has TCP/IP and Named Pipes enabled. I have several Surface Tablets running Windows 10 and Windows 11. These tablets make a VPN connection to the server to connect to SQL Server. All of the tablets, except one of them, can connect to SQL Server. All tablets connect using the server's IP address and with SQL Server Authentication. All tablets are connected to the same WiFi router - both the ones that CAN connect and the one that CANNOT, so I believe router settings are not the problem.
The tablet that fails to connect can ping the server successfully. It cannot, however, telnet to port 1433 on the server - this times out. All other tablets can make the telnet connection. Also, using sqlcmd to connect (sqlcmd -S ip-address -U user-name -P password) works on all tablets except the one. This returns error 53. Checking the SQL Server logs after attempting to connect using sqlcmd shows no errors. So this tablet is definitely not even reaching SQL Server.
I have disabled all Windows Firewall options on the tablet with no change - still cannot telnet or connect via sqlcmd.
I have walked through multiple remote connection troubleshooting guides step by step, but most of them assume that NO remote systems can connect to SQL Server. In this case, it is just one system. So I know that the server is configured properly to allow remote connections. I just cannot determine what is different about this one tablet that is preventing it from making a connection.
What might be preventing this one system from making this connection? Any settings or other options I should be looking at?
SOLVED: After performing tracert on multiple systems that connect to this server including the problem tablet as well as attempting to telnet to various ports at the server's IP address, I discovered that the WiFi network that the tablet was on had a conflicting IP address with the server. The previous tablets that tested fine were, unbeknownst to me, on different wifi networks that did not have this conflict. As a result, this tablet was attempting to connect to a completely different device despite being properly connected to the server's network via VPN.
So the additional piece of advice to add to this troubleshooting process would be to very closely scrutinize the output of ipconfig /all. Even though you may be connected to the network of the SQL Server system you are trying to connect to remotely, if the IP of the SQL Server system is duplicated on your local network, it can be very difficult to see that all of your connection attempts are actually routing to a different system - that is why the connection is failing.
What to look for in ipconfig /all... check the client system's IP address and the default gateway that it is using. If these are using private IP addresses (as most do) most commonly starting with 192.168.x.x, and you are trying to connect to SQL Server over VPN via which the server also has a private IP address, check if your local subnet is matching the server's subnet. For instance, both the client (tablet) subnet and the server subnet were 192.168.20.x There's a chance for an IP address conflict in these conditions.
Another check that I found was helpful was, on the client, to DISCONNECT from the remote server and then try to ping the SQL Server IP address. If the ping succeeds, the server's IP address is being duplicated by another system.

Error connecting to workgroup Remote Desktop client printer from domain host computer

I'm connecting remotely from home (Workgroup) Win7 PC to an office (Domain) Win7 PC using VPN and Remote Desktop. Remote Desktop connects fine but doesn't share my local resources no matter what I do. So to print from host (office) to client (home) I've set up printer network sharing (it's an HP printer connected at home via USB) and created a separate regular user without login privileges. Every several weeks something happens and the connection stops working.
Most recently, connection attempts to the remote printer return error 0x00000709.
Troubleshooting I've done:
Turned off firewall on both RDP client (home) and host (office) computers
Confirmed \\x.x.x.x\c$ is accessible from host to client
Cleared all connections using "net use" in command prompt (\\x.x.x.x\IPC$ usually appears after I open explorer to the client machine IP address and authenticate with the workgroup user account)
Confirmed the client VPN IP address is the same (when it changes, I have to reconnect the printer via explorer)
On client, tried to connect to printer via \\localhost in explorer and got the same error.
It drives me crazy that this works for a while and then stops with no apparent rhyme or reason. Windows updates might be the cause but the last update since this last happened was Microsoft Removal Tool (this morning) and it doesn't make sense this would cause the problem.
Any ideas what to try next?
Thanks
Ultimately, disabling IPv6 on the home PC's Local Connection adapter resolved the issue.
During troubleshooting, I was able to connect the office PC to another home PC (connected over AnyConnect VPN client) for file and print sharing, further complicating root cause analysis. I used WireShark to check outgoing packets from the office PC but was unable to check incoming packets on either home PC due to encryption on the VPN interface. WireShark revealed SMB connections were being successfully requested, opened AFAIK, and closed.
The issue was temporarily resolved when I rebooted both the target home PC and the Cisco ASA. This resulted in a new VPN IP address being assigned to the home PC. The issue returned 1-2 days later. Logging into the office PC with a different domain account did not resolve the issue. Disabling IPv6 on the home PC's Local Connection adapter did resolve it. I thought to do this after noticing the public IP address given on whatismyip.net was an IPv6 address, where in the past I've always seen an IPv4 address.
I hope this helps someone.

Connecting to Volttron Central server from Windows PC on device LAN

I have a RPi running an instance of volttron-central. I can VNC into the RPi and view the Web UI from a browser pointed to localhost, so I know that it is running. However, when I attempt to connect from a PC connected to the same LAN using the RPi's IP address, I get "refused to connect" error.
Is this a security feature? If so, is there any-way of viewing the WEB UI from a different machine, or does it need to be running an instance of volttron-central locally?
Edit your config file to use an external address (e.g. not 127.0.0.1). In VOLTTRON_HOME (~/.volttron) edit the config file. Change the bind-web-address setting to equal (what you have above as 192.168.1.4) to http://192.168.1.4:8080. Then restart the platform.
Note: you should also make sure your /etc/hosts file has a mapping from the 192.168.1.4 onto your hostname, then you could goto https://foo:8080 rather than using the address. This will work with the bind-web-address, but not the vip-address.

How can I connect to my server without outside ip adress from another network?

I want to connect to my server from another network, my server hasn't got an outside ip adress. I want to reach the sql server from where I host my website. I host my website somewhere else (not in my network).
Your SQL Server will have to be visible to the server from which you host your website.
I'm assuming you want to access the data in SQL Server to generate some content for your website.
There are 2 simple ways to do this:
Static IP - Ask your ISP for a static IP address for your local
network, you can use this in the connection string. This is preferable & more stable, since it will always be in sync.
Dynamic DNS - If your ISP won't give you a static address or you don't want to pay for it. You sign up with a DDNS service provider, they give you a domain name, like ferrysqlserver.ddns.org, and your network is visible to the internet via that name. Some routers support DDNS, otherwise you may have to run a service application that keeps your external ip address in sync with your DDNS provider.
Once you have either of those working, your network is now available to the internet, but nothing is likely accessible.
What you have done so far is to create a path from an internet name to your local router.
To make SQL Server accessible, you need to find out which ports your SQL Server uses (default is 1433). It's possible you may need to open other ports as well if you connect to SQL in a different way.
On your router, find the port forwarding options, and enable port forwarding to the local network ip address of your SQL Server, for port 1433.
This step maps connections from the internet to port 1433 of your router, and forwards those connections to port 1433 of your SQL Server.
Good luck.

How to prevent having to add ip to remotely connect to the database

In my java program, I connect to a mysql database on my server, but I have to go into my cpanel and add my ip address to be able to remotely access it.
Is there a way to allow all connections or add a mac address instead?
Thanks to Rugal, I got it to work.
I used %.%.%.% as the access host to allow any connections and it worked.

Resources