11

I am trying to make my router work in such a way that every device attached to it receives their own unique public IP address, so that any computer would be able to use a direct P2P connection. I would have thought this was impossible until I found out that every device connected to my schools WiFi receives their own public IP, starting with 199.80.254.70, and ending with 199.83.254.70, meaning over 3000 devices can receive their own unique public IP address. For my schools ISP on speedtest.net, it just shows "Palo Alto Unified School District", and judging by that, they are not registered with any major tier-2 ISP.

I am pretty sure this would be impossible with Xfinity or TWC, but I was wondering how my school does it, and if it would be possible for me to somehow do the same.

  • 3
    This is available on xfinity through business class service. Routers manufactured for consumer use don't support it tho. Fee's for multiple IP's can vary greatly. Basically it's a matter of correct equipment and paying additional for additional service. – Tyson Sep 11 '14 at 1:03
  • Do you pay for multiple public IP addresses from your ISP? If you don't, the'll only give you one. – lzam Sep 11 '14 at 1:10
24

Q: How do they get that many publicly-routable IPs?

Your school could possibly have a static IP address range assigned to them by their Internet Service Provider (ISP), by virtue of the fact that a school district is a fairly large customer (orders of magnitude larger in terms of money than a single family home, to be sure). Note that you can't simply change a setting in your router to enable additional IP addresses; you must specifically have them assigned to you, by your ISP.

Since IPv4 space is limited, and is becoming more limited by the day -- see IPv4 Exhaustion -- end users are the first "victims" of having more limited access to IPv4 addresses, since (ISPs think that) most end users don't have many use cases for exposing "listening" services to the public Internet. In fact, many residential ISPs write into their Terms of Service (ToS) that you are forbidden from hosting any Web or Email servers on your home internet connection.

This ToS policy is at least consistent with the fact that you may be granted an extremely limited number of publicly-routable IPv4 addresses uniquely assigned to your household, since the only real use case that is "blocked" by having few or no unique IPs is hosting services.

Therefore, many home ISPs are limiting end-users to 1 or even 0 unique public IP addresses per household. "Wait, 0?!" you may ask. Well, yes. Thanks to Carrier-grade NAT, an ISP can assign multiple customers a single public IPv4 address. You then, in turn, have a Local Area Network (LAN) set up by your router which provides a local IP address, providing two layers of indirection between your home router equipment and the public Internet. So you'd have the LAN, the CGN, then finally the Internet.

One unfortunate downside of not having a unique IPv4 address to your name is that, if a website, such as SuperUser or Wikipedia, decides to block someone else who happens to have your same publicly-routable IPv4 address -- for example, due to that user's bad behavior, or spamming -- you can be affected, too, because the website is unable to distinguish between different hosts behind the CGN. This is also true of large LANs, which are sometimes manifested in college campuses sharing one large pipe among several dormitories.

You may or may not have a CGN on your home Internet connection, and this isn't all that relevant to the point of my answer. The point is, if millions of people in the world now live with the reality of being under a CGN and therefore don't have any unique publicly-routable IPv4 address to their name, the likelihood of you being able to get additional licenses for IPv4 addresses from a home ISP -- at least, without paying a pretty penny for them -- is fairly low. That's not to say it's impossible, just that it would take a phone call and possibly an addition to your monthly bill (this would vary greatly depending on where you live and your exact ISP).

My observation is that large customers such as businesses, retail dedicated server hosting companies, etc. are getting the lion's share of the remaining IPv4 addresses allocated to them. This makes sense: the likelihood of a school wanting to host a website (run by technically-inclined kids, for instance) is much greater, in the minds of those people in control of these limited IPv4 addresses, than, say, the need of a home user to set up an HTTP server on their home computer and expose it to the public Internet. Similarly for dedicated hosting providers: almost every dedicated server has a very specific need to host several services on the public Internet, so this is almost a hard requirement for most use cases, or you may as well not even have a server. So it isn't unheard of to be able to get an additional IPv4 address for, say, $1 per month from a dedicated hosting provider for a server.


Be wary of pitfalls!

EDIT: I wrote this section under the incorrect assumption that the OP meant "Peer to Peer file sharing" by "P2P". Instead he means peer to peer hosted PC games, an entirely different thing. Leaving this here for posterity's sake anyway.

I will add that "Peer to Peer" transfer of content which violates copyright could possibly endanger your sustained access to your Internet connection in a number of ways:

  • Your ISP may become aware that you are transferring content that infringes copyrights, and slow down your connection as a result;
  • Your ISP may notice that you are sending a disproportionately high amount of traffic compared to the average, and slow you down as a result;
  • Your ISP may send you threatening notices (as, for example, Comcast does) if they can specifically determine that the nature of the content infringes copyright or trademark laws, and eventually disconnect your service if you ignore these notices;
  • Your ISP may consider that the "listening" part of your peer-to-peer protocol counts as hosting a "service", and consider this a violation of their Terms of Service, and threaten to disconnect your service if you persist.

So, even if you did get access to a small pool of IPv4 publicly-routable internet addresses, whether statically or dynamically allocated, you would be potentially facing some legal hot water for your actions if your ISP is specifically designated as a "residential" or "home" internet solution. You would encounter fewer barriers if you upgraded to "business-class" service -- at least in the United States -- but you would still have to deal with the legal ramifications of transmitting content that infringes copyright laws, if that is what you plan on doing.


Sharing a Single IP

In case you don't want to pay lots more money to host your games, you can employ the following technique to share a single publicly-routable IP for quite a few games simultaneously:

Assuming (and this may not hold true for every game, unfortunately) that you can somehow change the port(s) that the game expects to use, and you only have one unique, publicly-routable IP address assigned to your router, you can do the following:

  1. For each separate "instance" of each game that needs to share "the same" port number, change all the port numbers in the game's configuration to be different ports. You can pick anything from port 1 to 65535, but I would highly recommend that you stick to the range 1024 to 64000 for technical reasons. You can of course try ports outside that range if you really want to, but YMMV.

  2. Once you have, e.g., Computer "A" configured to listen on ports 1234 and 5678, and Computer "B" listening on ports 2345 and 3456, go into your router or modem's Port Forwarding settings and tell it to forward these ports to the local IP addresses of your machines. I recommend that you assign static LAN IPs to each of the computers on your LAN for this purpose. Just pick any IP address within the subnet. So if it's 192.168.0.0/24 (a pretty common subnet by default), you could pick anything from 192.168.0.2 through 192.168.0.254, assuming your modem/router is on 192.168.0.1. The exact click-by-click steps to set this up will vary widely depending on your exact equipment make and model, and will be significantly more complicated if you have multiple layers of NAT (e.g. a modem+router NAT, and another router behind that).

  3. When having peer to peer matchups in your games, simply tell your opponent(s) the port numbers you chose for the game.

You can repeat these steps for many thousands of simultaneous game instances, so that should be enough (hopefully).


IPv6

Lastly, a word on IPv6. Unfortunately, native IPv6 is still not available to a great many people. It is our hope that we can deploy IPv6 on a wide enough scale that the importance of IPv4 can start to take a nose-dive, eventually becoming irrelevant, as a critical mass of people are able to connect to services (such as websites, email servers, DNS servers, etc.) using IPv6. IPv6 has so many more addresses than IPv4 that the current plan is to assign each residential customer a /64 class address space, which provides you with 18,446,744,073,709,551,616 publicly-routable IP addresses. If you have more computers and smart devices than that in your house, I don't know what to tell you. ;-))

  • 4
    I don't mean using BitTorrent as P2P, I don't need a public IP for that. I need it to play games such as 0AD, AOE, and host my own server without setting port forwarding or a default DMZ. Thanks anyways :) Also, I found this: business.comcast.com/internet/business-internet/static-ip. – Kirill2485 Sep 11 '14 at 1:20
  • 2
    @kirill2485 - Your question is suffering from the XY Problem. There's probably a much more feasible answer for your desired usecase that doesn't involve having a bunch of public IP addresses. I suggest asking a new question on hosting multiple servers on multiple computers behind the same router. – Bobson Sep 11 '14 at 13:05
  • 1
    @kirill2485 Hamachi used to be a fairly common way to host private game services (not sure if it still is). Every player needs to run it, though. It basically sets up a VPN between players. – Bob Sep 12 '14 at 1:38
0

In order to technically assign an address to a device, you first have to have someone upstream assign that address to you, both technically and legally. For end-user DSL connections and similar, this is almost never done for IPv4, since addresses there are a precious commodity. Talk to your ISP, see whether they are willing to sell you additional IP addresses, but don't hope for too much.

Next alternative would be IPv6. If your ISP has IPv6 connectivity, then chances are fairly good that they will assign not only a single IPv6 address to your connection, but a whole subnet. I don't know how wide-spread IPv6 support from ISPs is, but I figure it depends a lot on where you are geographically. To my knowledge, Asia has far more advanced IPv6 infrastructure than the rest of the world simply due to the fact that they have a more dire shortage of IPv4 addresses.

But let's assume the worst case, namely that you are still stuck with a single IPv4 address only. In that case, I'd suggest you try 6to4. In that setup, you configure your router to transport local IPv6 packets over the IPv4 link from your ISP. The IPv6 subnet associated with your IPv4 address is 2002:aabb:ccdd::/48 where aabb:ccdd is the hexadecimal notation of your IPv4 address. So at that point you have 280 addresses under your control, to assign as you see fit. I've done this in the past, and at least for me it worked reasonably well. Of course, your router has to support 6to4, which might be easy if it were a Linux box under your control, harder if you'd have to patch some embedded open source Linux firmware, and impossible if the firmware is closed source. There are other ways to transport IPv6 within IPv4, and some of them might give you a decent range of addresses as well, but I don't have any experience with any of them.

Of course, all this nice IPv6 addressing will not be of any use if your P2P software lacks IPv6 support, or if the peers you want to connect with don't have any IPv6 connectivity established. Which brings you back to the first option as the only choice. If you can't find an ISP selling additional addresses to consumers, you might start feeling like a small business. There certainly are contracts for those which come with more than one address. And sometimes other goodies like symmetric DSL so that transfers from you to your peers won't congest the too-narrow upload link of a typical ADSL connection. But be prepared to pay a lot more for this kind of contract, since most small businesses can afford to pay more than consumers are willing to pay, so that's what market prices will be.

0

Twc will do this if you bridge the modem, most other providers only allow for a single ip address regardless how modem is configured if you have a dhcp connection, your only option with other providers is use a proxy for each other device (may not work for your need) or change to business class service and buy a block of static ip address (could be expensive)

-1

I think assigning private IPs or public IPs for clients of a router are basically the same.

You set up a DHCP daemon, configuring it, and that should be done.

What matters is that you must own the IPs you are assigning, so that they can communicate with the Internet.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.