shrewdgamer
Posts: 4
Joined: Fri Dec 07, 2018 3:32 pm

Can I use Raspberry Pi to make router get a new IP?

Fri Dec 07, 2018 3:42 pm

Can I use Raspberry Pi to make router get a new IP?

We have a DSL connection through land line phone, sometimes the IP addresses assigned to the router have problems. Is there a way I can use Raspberry Pi to make the router refresh if it gets certain IP addresses?

Andyroo
Posts: 689
Joined: Sat Jun 16, 2018 12:49 am

Re: Can I use Raspberry Pi to make router get a new IP?

Fri Dec 07, 2018 7:56 pm

Normally ISPs will only issue a new IP address at router reboot / power on.

You may be able to get to the router reboot control screen and use a post command to set the reboot off or put a power control switch on the router mains plug.

There are major problems with this though:

1) You may loose local network connection that the Pi may not recover from.
2) WiFi link may not come back to turn the plug back on.
3) You stand a chance that the speed of the line will lower after time as the exchange DSLAM will think you have a line error and go into recovery mode by dropping the speed till it’s stable. At some point it may go into an error state and not let you connect till it is restarted by a watchdog system.
4) Devices on the LAN may not get the same IP address as these could be issued in a different sequence. You would have to look at lease time on the router.
5) Repeated power cycles will shorten the life of any electronics.

I’ve not seen a circuit to cut the phone line off though it would not be hard to make one up and in the U.K. it would be illegal to make or fit one unless it came certified by BT or Openreach.

Out of interest have you spoken to your ISP over the issue? The only reason I can think of some IP addresses giving issues is for email where that address is blacklisted. If so, you should be using a static addressed server ASAP outside your house as more and more mail carriers will not take mail from dynamic addresses.
Need Pi spray - these things are breeding in my house...

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Fri Dec 07, 2018 8:20 pm

When your modem (which may be part of a combined modem/router) connects, the equipment in the Central Office (CO) connects you to the next available port on *their* router, and you get the next available IP address from the pool of IP addresses that your line is associated with.

If you renew the IP lease on the WAN side of your router, you will *probably* get the same IP address. If you drop the connection, wait anywhere from a few seconds to a minute or so for someone else to grab that IP address, you'll get a different one.

You should be able to reset or reboot your router or modem/router from any attached device through a web interface these days. Whether or not you can disconnect, wait and reconnect is another matter. You may have to turn off the modem (either with a power switch...if it has one, or by pulling the plug if it doesn't) in order to wait to reconnect.

If there is a persistently bad IP address (which probably translates to a persistently bad port on their router), report that to your ISP. Their router may have a bad card in it and it is moderately likely they won't know unless someone reports trouble. Not all card failures give useful feedback through the administrative software for that level of equipment.

shrewdgamer
Posts: 4
Joined: Fri Dec 07, 2018 3:32 pm

Re: Can I use Raspberry Pi to make router get a new IP?

Sat Dec 08, 2018 11:09 pm

I presently change the IP of the router/modem by rebooting through it's web interface. But it's getting tiring. So I wondered if it could be automated by Raspberry Pi.

Andyroo
Posts: 689
Joined: Sat Jun 16, 2018 12:49 am

Re: Can I use Raspberry Pi to make router get a new IP?

Sat Dec 08, 2018 11:19 pm

shrewdgamer wrote:
Sat Dec 08, 2018 11:09 pm
I presently change the IP of the router/modem by rebooting through it's web interface. But it's getting tiring. So I wondered if it could be automated by Raspberry Pi.
If its that often I would jump up and down on the ISP as they must be failing their contract to you.

I've run dynamic at home for over 5 years and cannot remember any IP address issues
Need Pi spray - these things are breeding in my house...

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Sun Dec 09, 2018 5:48 am

Andyroo wrote:
Sat Dec 08, 2018 11:19 pm
shrewdgamer wrote:
Sat Dec 08, 2018 11:09 pm
I presently change the IP of the router/modem by rebooting through it's web interface. But it's getting tiring. So I wondered if it could be automated by Raspberry Pi.
If its that often I would jump up and down on the ISP as they must be failing their contract to you.

I've run dynamic at home for over 5 years and cannot remember any IP address issues
I spent about 18 months doing Tier 2 DSL support. Yes, bad port cards in the CO happen. Not a lot, but if you're the one that hits it, it can be a royal pain. Letting the ISP know they've got a bad port is the way to get a tech out to fix it, but the help center is going to want to make sure it isn't the customer end first.

User avatar
neilgl
Posts: 250
Joined: Sun Jan 26, 2014 8:36 pm
Location: Near Aston Martin factory

Re: Can I use Raspberry Pi to make router get a new IP?

Sun Dec 09, 2018 11:39 am

With “...sometimes the IP addresses assigned to the router have problems....”, what problems are they
? e.g certain IP address is banned from gaming servers

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Sun Dec 09, 2018 6:07 pm

neilgl wrote:
Sun Dec 09, 2018 11:39 am
With “...sometimes the IP addresses assigned to the router have problems....”, what problems are they
? e.g certain IP address is banned from gaming servers
Two steps that will frequently help to determine if the ISPs router has a problem...
1. Run ping to a known good IP address, such as 8.8.8.8.
2. Run traceroute to that address to see where nodes stop responding.

In traceroute, the first node you see will be your own router. The next one will be your ISP's router. If you don't get a response from your ISP's router, you can double check that by pinging your upstream IP address (which your router will show you). It you can't ping that successfully, it's time to call the ISP's support line. Bear in mind that the first tier of support people are minimally trained and are expected to strictly follow a set of scripts. This is because most end users have no clue about how networks function...or even their own PC...and are, therefore, fairly likely to have a problem that is easily fixed at home. Things like a bad CAT-5 cable between their PC and their own router.

If you can get to second tier support, you will be dealing with people that are more knowledgeable and better trained. If you get to the point that you can explain what tests you run, they can ping and traceroute *to* your router from the ISP side. A failure that way should convince them to put a ticket in with the physical plant folks to get a tech out there to fix (or, more likely, replace) a failed or failing port card.

shrewdgamer
Posts: 4
Joined: Fri Dec 07, 2018 3:32 pm

Re: Can I use Raspberry Pi to make router get a new IP?

Mon Dec 10, 2018 3:59 am

neilgl wrote:
Sun Dec 09, 2018 11:39 am
With “...sometimes the IP addresses assigned to the router have problems....”, what problems are they
? e.g certain IP address is banned from gaming servers
Yes, something like that.

Andyroo
Posts: 689
Joined: Sat Jun 16, 2018 12:49 am

Re: Can I use Raspberry Pi to make router get a new IP?

Mon Dec 10, 2018 7:17 pm

If its your doing at some point they will track down your account rather than IP address and then you are well stuffed (just ask a few lads I know - one lost a fair amount of game credit for cheating).

If its not and you are playing by the rules then connect the game provider and get it freed up - they are normally happy if its dynamic to do that.

If they will not then Tor / VPN may be better than bouncing the router.

Tis alway best to play by the rules
Need Pi spray - these things are breeding in my house...

shrewdgamer
Posts: 4
Joined: Fri Dec 07, 2018 3:32 pm

Re: Can I use Raspberry Pi to make router get a new IP?

Tue Dec 11, 2018 6:54 pm

Is it absolutely impossible to make Raspberry Pi automatically reboot the router?

Ernst
Posts: 717
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Can I use Raspberry Pi to make router get a new IP?

Tue Dec 11, 2018 8:23 pm

shrewdgamer wrote:
Tue Dec 11, 2018 6:54 pm
Is it absolutely impossible to make Raspberry Pi automatically reboot the router?
No, it is not impossible.

There are many ways to obtain the intended result but it is for you to find the most usable solution.

Your problem is not related to booting the router, this is only a workaround for the real point of objection which is that the public interface has been allocated an IP-address with a bad reputation. An IP-address change can be forced by disconnecting the external connection (aka pull the plug) which could be done with a simple relay. Or you could use a bigger relay to pull the router power to force a power cycle. Another possible solution could be to find a way to talk to the router with ssh so that commands can be used to reset the external interface (ifconfig down,ifconfig up). If the router does not allow access with ssh then it might be possible to use http to get into the router admin interface. (screen scraping).

There could be many ways to "solve" your problem, but it is difficult to provide a working solution because we do not know anything about your router and your network interface. Even if we did know something it would be difficult for most of us because there are many variables. I have given a few ideas as inspiration and google can be a great help to find more information.
The road to insanity is paved with static ip addresses

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Tue Dec 11, 2018 9:37 pm

Ernst wrote:
Tue Dec 11, 2018 8:23 pm
shrewdgamer wrote:
Tue Dec 11, 2018 6:54 pm
Is it absolutely impossible to make Raspberry Pi automatically reboot the router?
No, it is not impossible.

There are many ways to obtain the intended result but it is for you to find the most usable solution.

Your problem is not related to booting the router, this is only a workaround for the real point of objection which is that the public interface has been allocated an IP-address with a bad reputation. An IP-address change can be forced by disconnecting the external connection (aka pull the plug) which could be done with a simple relay. Or you could use a bigger relay to pull the router power to force a power cycle. Another possible solution could be to find a way to talk to the router with ssh so that commands can be used to reset the external interface (ifconfig down,ifconfig up). If the router does not allow access with ssh then it might be possible to use http to get into the router admin interface. (screen scraping).

There could be many ways to "solve" your problem, but it is difficult to provide a working solution because we do not know anything about your router and your network interface. Even if we did know something it would be difficult for most of us because there are many variables. I have given a few ideas as inspiration and google can be a great help to find more information.
Even those solutions may not do what the OP wants. Assignment of the publicly routable IP address is determined by the ISP's equipment no amount of reset or power cycling of the OP's router will guarantee that a different IP address will be assigned.

To truly address the problem depends on the actual cause. If it is bad hardware at the ISP end, the OP needs to talk to his ISP. If--as has been speculated--it is a locked out IP address on the part of some service (game, web site, whatever), then the OP needs to contact that provider to get the IP range he will fall in unblocked. An alternative in this case is to use a VPN so that he is hitting the relevant target from a completely different IP block.

In neither of cases will a Pi be of any use in getting it resolved, save that a Pi can be used to help diagnose a bad port at the ISP...but tht can be done from any computer.

Ultimately, the only way to be sure of getting a different IP address is to change ISP. However, depending on the underlying nature of the problem, the issue may occur again, anyway.

Ernst
Posts: 717
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Can I use Raspberry Pi to make router get a new IP?

Tue Dec 11, 2018 10:24 pm

W. H. Heydt wrote:
Tue Dec 11, 2018 9:37 pm
Ernst wrote:
Tue Dec 11, 2018 8:23 pm
shrewdgamer wrote:
Tue Dec 11, 2018 6:54 pm
Is it absolutely impossible to make Raspberry Pi automatically reboot the router?
Even those solutions may not do what the OP wants. Assignment of the publicly routable IP address is determined by the ISP's equipment no amount of reset or power cycling of the OP's router will guarantee that a different IP address will be assigned.
If you the read the first post you should come to the conclusion that you have misunderstood the problem.

from the initial post:
We have a DSL connection through land line phone, sometimes the IP addresses assigned to the router have problems. Is there a way I can use Raspberry Pi to make the router refresh if it gets certain IP addresses?
There are historic financial reasons why a new address is assigned on reconnect/reboot ....
There are spam abuse reasons why some addresses are problematic ...
There are script kiddie reasons why some addresses are problematic ...

I know what I am talking about because I have one of those DSL connections that changes IP every time the line is disconnected, and I pay an extra fee so that the line is not disconnected every night which would cause the external IP-address to change.
The road to insanity is paved with static ip addresses

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Wed Dec 12, 2018 1:55 am

Ernst wrote:
Tue Dec 11, 2018 10:24 pm
I know what I am talking about because I have one of those DSL connections that changes IP every time the line is disconnected, and I pay an extra fee so that the line is not disconnected every night which would cause the external IP-address to change.
I know what I'm talking about because I spent 18 months doing Tier 2 DSL support for AT&T. I've seen it from the other side.

Ernst
Posts: 717
Joined: Sat Feb 04, 2017 9:39 am
Location: Germany

Re: Can I use Raspberry Pi to make router get a new IP?

Wed Dec 12, 2018 6:46 am

W. H. Heydt wrote:
Wed Dec 12, 2018 1:55 am
Ernst wrote:
Tue Dec 11, 2018 10:24 pm
I know what I am talking about because I have one of those DSL connections that changes IP every time the line is disconnected, and I pay an extra fee so that the line is not disconnected every night which would cause the external IP-address to change.
I know what I'm talking about because I spent 18 months doing Tier 2 DSL support for AT&T. I've seen it from the other side.
Don't worry, the US is only a small part of the world, there are other regions that have different policies when it comes to operating and marketing [A]DSL. You should be able to understand this article https://de.wikipedia.org/wiki/Zwangstrennung
The road to insanity is paved with static ip addresses

W. H. Heydt
Posts: 9240
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Can I use Raspberry Pi to make router get a new IP?

Wed Dec 12, 2018 4:19 pm

Ernst wrote:
Wed Dec 12, 2018 6:46 am
W. H. Heydt wrote:
Wed Dec 12, 2018 1:55 am
Ernst wrote:
Tue Dec 11, 2018 10:24 pm
I know what I am talking about because I have one of those DSL connections that changes IP every time the line is disconnected, and I pay an extra fee so that the line is not disconnected every night which would cause the external IP-address to change.
I know what I'm talking about because I spent 18 months doing Tier 2 DSL support for AT&T. I've seen it from the other side.
Don't worry, the US is only a small part of the world, there are other regions that have different policies when it comes to operating and marketing [A]DSL. You should be able to understand this article https://de.wikipedia.org/wiki/Zwangstrennung
The last time I had to read German was over 50 years ago. And it wasn't technical German at that time.

PhatFil
Posts: 614
Joined: Thu Apr 13, 2017 3:55 pm

Re: Can I use Raspberry Pi to make router get a new IP?

Wed Dec 12, 2018 6:21 pm

shrewdgamer wrote:
Tue Dec 11, 2018 6:54 pm
Is it absolutely impossible to make Raspberry Pi automatically reboot the router?
depends on the router.. if its running openwrt or a similar *nix os then this should guide you to a solution..
http://www.jfwhome.com/2012/06/18/reboo ... matically/

BeauSlim
Posts: 11
Joined: Mon Jul 31, 2017 10:02 am

Re: Can I use Raspberry Pi to make router get a new IP?

Thu Dec 13, 2018 1:30 am

Talk to your ISP.

DHCP policies very widely. A DHCP server can be set to give a customer prem device a new IP on reset, on request, every X hours, after it's been offline for X hours, or never (i.e. static IP). You'll need to talk to your ISP to be sure.

If the ISP aren't cooperative in resolving this, since it appears that a new IP can allocated using the modem's user interface, a script could be written that will use this function automatically. Use curl or similar in scripts, or go with a web browser automation tool like Selenium.

Return to “Beginners”