NET: Implementation in C# - networking

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.

Related

Why is my public IP address the same as my private IP address?

It should be impossible right? But I used ipconfig and it is exactly the same as when I use a website to check my public IP address. They both start with 76.
It is possible to have public IP the same as your private one of course.
It seems like you are plugged directly into your ISP's network, without any NAT or other router in your way.

How do port forwarding work in big video games with a lot of traffic?

Please consider the following scenario,
Let's suppose there are two roommates having the same game installed. For the sake of this question let's assume that the game is DoTA2.
Both the roommates are connected to the same router and thus have the same public IP essentially. (router's IP)
Now, let's assume that someone else on the outside i.e. public internet outside of the router wants to connect to the roommate1, then the router will have a simple port forwarding within the NAT rule that may go like follows,
If the request comes from outside on port ABC(game owned port) forward it to roommate1.
Now, if we assume that the roommate2 is also online in the game and another public computer wants to connect to them, then how would the port forwarding work?
How will the router know which private computer(roommate) the connection request be forwarded to?
Please do not give answers like, DoTA has multiple ports allotted or any game-specific answer, use of DoTA is just an example.
You can even consider a scenario where there are two private computers running a simple HTTP server on port number 80, how would an outside computer know which one to connect?
I have googled DMZ, and port forwarding but do not clearly understand the solution.
It's kinda rude to tell us on what kind of answers we can give, specially when you have asked an off topic question yourself.
Getting to the answer to your question, port forwarding is done based on the combination of private IP and port; roomate1 and roommate2 have different private IP addresses but using the same port, on your router(assuming it's a generic one) only one forwarding rule can be used at any point.
A possible solution is to use a proxy server like HAProxy after your router on the private network side and use TCP association based policy to forward packets to roomates.
In short, NO is not possible. You can only NAT from 1 public address to an internal IP on X port.
In long, companies does this, but they have 2 or 3 public address then you can map to a different internal IP.
Public IP 1 > Internal IP:port
Public IP 2 > Internal IP:port
You can map from an external IP to multiple internal IP addresses but since you are using the same service(game) they probably use the same port or ports.

Can public IP range be used as private IP?

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.

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).

Why is my IP adress different when displayed by different methods

I am new to all this, so I am sorry if the question is stupid. I am learning about networking and I want to find out IP address of my own computer.
When I try to display it through ipconfig, my router's configuration page and by simply googling, I see different IP-address
Thank you in advance for help
in ip-config it starts with 10. ...
in router's conf page 192.168.1. ...
when googling 213. ...
ipconfig will give you the address of your machine. This will be some private IP address. Your router will have two IP address - One public and one private. All machines in your local network (house probably) will talk to the router via its private address, while everything out in the Internet talk to your router via its public address.
So, ipconfig provides the address of your computer, your router's config page shows its private address, and Google will show you your router's public address.
Some terms to look up: Look up Public vs Private IP addresses and how NAT works and this will all make more sense.

Resources