Several websites such as file hosters track users and limit access (for example the amount of request within a certain time period) by logging the user IP. If you have a direct connection to the internet you won’t have any problems reconnecting and getting a new IP (unless you have a static IP). This can quite easily be done programmatically.
But in some cases you are probably connected to a router (maybe even by WLAN) and don’t have that comfort. In those cases it it necessary to connect to your router. In Germany the AVM FritzBox is quite common and therefore this entry focuses only on that router. Other routers don’t work much different and you will probably be able to find similar solutions.
Basically the router is a small computer, which runs its own operating systems ( BusyBox Linux ). So all you basically have to do is open a telnet connection and execute certain commands. In order to log into your router you first will have to enable telnet access. Here you can find more information on how to enable telnet on your FritzBox.
Dim FritzboxIP as String = "0.0.0.0"
Dim TelnetClient As New ScriptingTelnet(FritzboxIP, 23, 7000)
TelnetClient.Connect()
TelnetClient.WaitFor("Console Ausgaben auf dieses Terminal umgelenkt")
TelnetClient.SendMessage("dsld -s")
TelnetClient.SendMessage("dsld -n")
TelnetClient.WaitFor("voip: ppptarget voip disabled, ignored")
TelnetClient.Disconnect()
This piece of code opens a telnet connection and restarts the DSL daemon which results in reconnecting to your ISP and retrieving a new IP. Since there are no built-in telnet classes in the .NET framework, I used this telnet library.