Can public IP range be used as private IP? - networking

As per IANA standards, below is the range for private IP,
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
Can IP addresse outside the range(above) used as private IP to communicate packets within a specific network?

Basically, you can use ever IP-Address-Range you want in your private network. There is no reglementation against this.
But you have to take precautions to avoid routing-trouble when a machine with an IP-Address that actually belongs to a public range wants to access the internet. Here you have to have a Router or Firewall that is able to NAT your internal address bidirectionally.

Sure, there is nothing preventing you from setting your static IP to anything you want. It's up to the router to decide where packets are routed. On your internal network, since you own the router, you can decide to use an IP range normally used for public traffic if you are OK with those public servers being inaccessible to you.
Note that this may cause unusual side effects with DNS if your server is running on an IP address to which another domain name resolves. The server would appear to be running on that domain. Maybe this is what you want, although with SSL you would get a warning that the server fingerprint does not match.

Related

Why can't I access a local file from my public ip address if I can from my private ip address?

I'm able to open the website being served on port 4568 on 127.0.0.1 (localhost) and my private ip address, but I can't seem to do so on my public ip address. I've tried to access the website by typing :4568 after my public ip like I did for my localhost and private ip.
Is it possible to open a site running locally on my computer through my public IP? If so, how? If not, why not?
NOTE: I'm not exactly clear what tags are appropriate. Feel free to add or remove any you deem inappropriate.
You are likly behind a NAT. What this means is that your public IP address and private IP address are not necessarily mapped to each other fully. To explicitly map your application to your public address, try the following:
Go to your modems management page
Look for a 'Port Forwarding' tab (might be under an advanced or
router menu)
There will probably be two or three field to enter:
The port on the public ip address to forward traffic from
The IP address to forward traffic to (your private IP)
(might be there) The port to send it to on the private IP
Assuming this works, all traffic going to your public IP address on that port will now go to your private IP address.
WARNING This is a simple rule and everyone on the internet can now access that port
Also make sure your web server is listening on 0.0.0.0 (all IP addresses) and your local firewall is allowing remote connections on the port in question.

Is my public IP really unique?

I'm asking about if the IP address of my router (my "public" IP address) is actually unique, i.e. it is not shared with other routers/hosts over the Internet.
If it is the case, I imagine that there will be some NAT policies applied by my ISP, which translates my "public" IP address and the port of my connection in some other IP:port pair (just like happens in local NAT).
Many operators use a version of NAT which is called by several names: Carrier Grade NAT, NAT 44, Large Scale NAT.
Essentially the operators use private addressing between the network core and the edge devices (i.e. your router) and then translate the private addresses to public addresses at the core of their network before traffic goes to another network.
There is not a one to one mapping between the private addresses and the public addresses, and even port numbers can be reused over time.
So to identify a given private address and hence user from the operator logs, you need to look at the public IP address, the public port and the timestamp (as the same public IP and port may be mapped to a different private IP at a different time).
Things start to get even more complex when you try to make the network devices as optimised as possible - there are mechanisms to try to assign to same public IP and port to a private IP that it has used previously for efficiency. This can give the impression to an end device that it has a static IP mapping in the NAT, but often this is not actually the case.
Finally, all the above is independent of any locate NAT you may have in your home or business - i.e. you can and probably will have a NAT translation on you local router for your locals devices also.
Unlike IP addresses, public IP addresses are not used in a local network but only on the internet. The routers (iphone: your box) IP address to internet, it that rent your box visible on the internet (it will respond to the ping). But also, when you use a website you use the public address of the web server.
A public IP address is unique in the world, which is not the case for private addresses which must be unique in the same local network but not at the global level since these addresses can not be routed on the internet.
Public IP addresses that list all IP addresses of classes A, B, and C that are part of the list of private addresses for those classes or class A exceptions.

where to get address like 10.0.2.0 in android?

I am trying to get IP address of Android Phone and it shows something like 192.168.0.0.But i need some thing like 10.0.2.0.Are both same?.Can anyone tell me what is the difference and How to get that address?
Thank you
Are you using AVD?
The AVD receives its network address and configuration on the private network from a DHCP server that is integrated into Virtual. The address which the virtual Device receives is usually on a completely different network to the host. As more than one card of a virtual device can be set up to use NAT networking, the first card is connected to the private network 10.0.2.0, the second card to the network 10.0.3.0 and so on.
It is highly unlikely that you have an IP with a 0 at the end because they are mostly used as the Network ID, especially with the 192.168.0.0 adress. The 10.0.2.0 and the 192.168.0.0 Adress are both IP Adresses that are in the private Range, so they are not public. I assume that you get your IP via DHCP so it depends on that DHCP Server what IP you will get. In the end of the day it doesn't really matter if you have an 10.0.xx.xx or a 192.168.0.xx Adress. Maybe I could help you a little more if you tell me why you need a 10.0.2.0 adress?
10.0.0.2 is an IP address found on many local computer networks, particularly business networks.Internet Protocol (IP) version 4 defines certain sets of IP addresses as restricted for private use (not available to be assigned to Web servers or other Internet hosts).

NET: Implementation in C#

I have a router that runs on two VM. The second VM has IP address of 9.1.2.2
I have look IP address overview,
Private networks should use private network addresses like 192.168.x or 10.x. It is not a good idea to use a public IP address that has not been assigned to you. At this moment reverse DNS seems to say that 9.1.2.2 is unassigned but that doesn't make it safe to use.

TURN server XOR-RELAYED-ADDRESS IP different from its own public IP

Suppose I am running a TURN server bound to a public IP (say 100.0.0.1). When the server creates a relay port for a create allocation request, is it ever the case that the server would send back an IP address that is different from whatever it is bound to (100.0.0.1 in this case) in the XOR-RELAYED-ADDRESS attribute? I'm not familiar enough with networking to know all possible scenarios, and the RFC 5766 doesn't really say anything specific (as far as I can tell).
Phrased another way, is the IP address in the XOR-RELAYED-ADDRESS redundant? In all cases I have considered, the client only needs to know the port allocated, and could completely ignore the IP of XOR-RELAYED-ADDRESS. As long as the client knows the relay port, it can always send relay data to the TURN server public IP (it already knows the IP since it had to connect initially...) at the relay port.
Any comments?
If you server is not behind a NAT (on the public internet with a public IP address assigned to it), then the IP address returned in XOR-RELAYED-ADDRESS will be the same. (It will always be the same as the IP address assigned to its NIC).
I assume the reason you are considering ignoring XOR-RELAYED-ADDRESS is related to you other question suggesting the TURN server will actually be behind a NAT/firewall. I think you'll find that the IP address is predictable. But the Firewall/NAT your server sits behind has the possibility of messing up the port allocations. Make sure you understand how the TURN server does port assignments, and that your firewall does port forwarding correctly.
One bit of nomenclature clarification. Your server isn't "bound" to a public or a private IP. Your server socket binds to an interface that has an IP address assigned and associated to it.
Actually, you guys both overlooked a situation when the relay IP address and different from listening IP address, on the TURN server. The TURN Server may be listening on, say, address 1.2.3.4, but it may be allocating the relayed endpoint on two other public addresses - like 2.3.4.5 and 3.4.5.6. The real relayed IP address is returned in XOR-RELAYED-ADDRESS and it may be very different from the listening address.

Resources