0

I want to know if it's possible to refresh dynamic IP in Python? In this case I want to get a new IP from my internet provider.

each time I reset my modem, the IP is changed, so I know there is a lot of IPs available. The IP is assigned to my ADSL modem. I want to do this to access to a website with different IPs from my country. Is there any way?
ADSL router brand is: Cisco Linksys And my another ADSL Router is Trendnet TEW-719BRM

ehsan shirzadi
  • 4,709
  • 16
  • 69
  • 112
  • 2
    I would see if your Router/gateway/modem allows for shell access. If so you can test logging in with Telnet or SSH, and see if you can discern the WAN IP (your public IP) from the command line. Then it's a matter of scripting this in Python. If not, you can script it in Python using HTTP or CURL. Find the page that shows the new IP and call it via your script. Might have to add in authentication depending on your device. – Twisty Nov 02 '15 at 20:18
  • Yes, first you need to see if your router/modem allows you to change IP without reset. If it does then it can be a scripting problem. – augre Nov 02 '15 at 20:25
  • @Twisty has given a solid approach. However, you are not guaranteed to get a new IP address every time your router resets. My ISP keeps assigning me the same one, for example. Have you researched using an anonymizing proxy service? – RobertB Nov 02 '15 at 20:25
  • Most ADSL Providers I have seen do not update the WAN IP that often. If you can tell us what type of device you have, we can maybe give more detailed advice. Your device might even offer WAN DDNS *(Dynamic Domain Name System) is a service that allows network clients to connect to the wireless router, even with a dynamic public IP address, through its registered domain name.* Then you can use a Dynamic DNS Host to track it. – Twisty Nov 02 '15 at 20:44
  • Normally, the ADSL modem shouldn't have an IP address at all. It is the PPPoE client (which often is combined with modem and router in one box). – glglgl Nov 04 '15 at 10:41

1 Answers1

0
  1. Disconnect and reconnect PPOE at ISP (The easiest and fastest way to do this is to restart your modem, there is no workaround because new IP is assigned from the ISP)
  2. Re-use Selenium in Python
Sezer BOZKIR
  • 534
  • 2
  • 13
mehti ra
  • 1
  • 2