Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
My ifconfig configuration is inet addr:192.168.1.3 and when I try to get know the router ip by executing ip route show | grep -i 'default via'| awk '{print $3 }' i get 192.168.1.1
I remember this ipv4 addresses from provider handbook, so they are roughly the same for all ethernet and routers config in my district.
The questions are:
How can I get know my real ip address?
Who and where assigns me unique ip?
Why do provider assign this standard ip for everyone?
If I get know my unique id will I be able to establish TCP | UDP connection? How does transmission works unique_ip -> 'router_ip' -> 'ethernet_ip' will not it be passed to my friend why share with me router?
I'm not completely following your question. Any IP address assigned to your computer is a real IP address which your computer uses. It may be a private IP address which can be reused in different networks, or it may be a public address which is supposed to be unique in the world (I think this is what you mean). IP addresses are assigned to your computer either by being statically assigned, or being assigned through DHCP.
If you want to know the public IP address assigned to your router, then you can look in your router, or browse one of the websites which will tell you what your public IP address is.
The ISP owns one or more blocks of public IP addresses, and it will assign your router an address via DHCP or PPP. Since some RIRs no longer have nay blocks of public IPv4 addresses to assign to the ISPs, many ISP have started using CGN which will assign private IP addresses to your router. This causes a double-NAT, which causes all kinds of problems.
The ISP does not assign your private IP addresses, you do that. There are three blocks of private IP addresses (10.0.0.0/8, 172.16.0.0/12, and 192.168.0.0/16) which you can use to assign your private IP addressing. The router manufacturers all used to use 192.168.0.0/24, but in recent years, they have mostly moved to using 192.168.1.0/24. It doesn't matter which block of private addresses you use.
Your router is running NAT which translates all your private addresses to a single public address (assuming your ISP isn't using CGN). In order to reach your LAN from the public Internet, you will need to set up NAT forwarding rules to be able to translate from the public IP address to one of your private IP addresses. This is known as port forwarding, and it is done by TCP or UDP port number, and you can only have one TCP or UDP port reach one private IP address inside your LAN. For instance, if you run a web server (nominally port 80), you can configure your router to forward any traffic arriving on the public address using port 80 to the web server inside your LAN.
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
I'm trying to enable port forwarding in my router (ZTE F660) but for some reason it is not working at all. First I started my server application in my ubuntu machine and I fixed its ip address to 192.168.1.2. Then, I set the rules as following:
It did not work. So, I've tried to disabled the firewall on my router settings:
It did not work as well, then I've disabled the firewall of my host machine by typing:
sudo ufw disable
And it did not work. Then, I tried to use many different ports and it did not work! :(
I've tried to use some port forwarding testers (like this one: https://hidemy.name/en/port-scanner/) and it always says that the state of the port is "filtered". I called the provider of my internet and they said that the port forwarding should be running but they did not offer technical help. Can anyone help me with this? Can't think about anything else to do.
Your ISP is using CGN (Carrier-Grade NAT) because your WAN address is in the Shared address space (100.64.0.0/10). That is not public address space, and it is defined by RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space:
Abstract
This document requests the allocation of an IPv4 /10 address block to
be used as Shared Address Space to accommodate the needs of Carrier-
Grade NAT (CGN) devices. It is anticipated that Service Providers will
use this Shared Address Space to number the interfaces that connect
CGN devices to Customer Premises Equipment (CPE).
Shared Address Space is distinct from RFC 1918 private address space
because it is intended for use on Service Provider networks. However,
it may be used in a manner similar to RFC 1918 private address space
on routing equipment that is able to do address translation across
router interfaces when the addresses are identical on two different
interfaces. Details are provided in the text of this document.
This document details the allocation of an additional special-use IPv4
address block and updates RFC 5735.
The address block is detailed in Section 7:
7. IANA
Considerations
IANA has recorded the allocation of an IPv4 /10 for use as Shared
Address Space.
The Shared Address Space address range is 100.64.0.0/10.
That address space is also found in the IANA IPv4 Special-Purpose Address Registry.
What that means is that you have a home/residential ISP agreement. The ISPs are using CGN to save their precious public addresses for businesses willing to pay for them. The ISP NAT would also need to be configured to forward the port to your WAN addressing the Shared space, but the ISP cannot do that because others behind the CGN may also want that port forwarded to them.
The ISP does not really care that this breaks what you want to do because your residential ISP contract contains a clause forbidding you from running services from your network to the public Internet. You will need a public address and ISP permission to do what you want, and that probably means a business contract. The proliferation of CGN is a big driver for hosting companies, and that is an alternative way to do it.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
This questions is hypothetical, this situation would most likely never happen nor could any router handle it
Situation 1
Lets say for example you (somehow) managed to put 255 devices onto your network. Lets refer to the 255th device as D255 and, just for later reference, the router's IP address is 192.168.0.1. If I am correct D255's local IP address should be 192.168.1.255. So what if we buy a new device (D256) and connect it to my home internet along with the other 255 devices. What would D256's local IP address become? I thought about it and I assume that it would be 192.168.2.1. Am I correct?
Situation 2
After thinking about situation 1 I came up with another situation. What if you had 65025 (255 * 255 = 65025, if you see where I'm going with this.) devices connected to the your internet? The last device's (I will refer to as D65025) local IP adress should be 192.168.255.255 (That is assuming that situation1's solution is correct.). So what if I go out and buy a another device (D65026) what would it's local IP address be? It can't become 192.168.256.1 because the numbers can not exceed 255 and it can't become 192.169.1.1 because 192.168.x.x is the local IP reserve and 192.169.1.1 exceeds the local IP limit and (correct me if I'm wrong) would be a external IP address. So what would happen?
I appreciate your feedback!
A local network will typically be configured with a DHCP server to hand out IPv4 address leases along with name server addresses and a gateway address.
Residential and small commercial routers are usually configured to do Network Address Translation and have a DHCP server configured to hand out Private IPv4 addresses and the router's private IP as the gateway and nameserver. The size of the local subnet is determined by the router's configuration.
A typical configuration is 192.168.0.0/24 which provides 254 host addresses.
The DHCP server has configuration that specifies the address pool it can hand out leases for, how a DHCP server behaves if it is asked for a lease when all addresses in the pool are currently assigned depends on the configuration, but in most situations it will just not respond as there are "no free leases".
In this situation a host will likely select a link-local zero-configuration address from 169.254.0.0/16 and not have any Internet access or any other hosts on the network except those with Zero Conf addresses. It may retry DHCP at a later point.
The RFC1918 private address block 192.168.0.0/16 actually has capacity for 65534 uniquely addressed hosts. Ignoring the issues of having a layer 2 broadcast domain of this size, the same constraints apply: when there are no leases left to assign, none are assigned.
If these private addresses are to have Internet access they will be Network Address Translated to one or more public IP addresses (usually one) by the router. One public address is unlikely to be sufficient for a large number of private network hosts, constrained by the availability of local TCP / UDP port numbers.
I suggest you read up on IP networking to fill in basic knowledge.
If you are using DHCP, when you run out of addresses, it will kick one of the other devices off the network, probably the one which connected first. There are only so many devices which can connect to a network, but that number depends on the router configuration.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
There is a Static NAT rule that achieves the following.
(for the question, let's assume the WAN subnet has a subnet of 1.1.1.1/24)
Inbound traffic to the WAN interface on port X to 1.1.1.6 gets NAT'ted to LAN IP 192.168.0.1.
Now this isn't a 1-1 NAT rule, just a Static NAT for the inbound traffic. When return traffic is sent back to the client, does the firewall know to NAT traffic back to the client with the source IP of 1.1.1.6 ?
I'm assuming it has to? As TCP is a two-way protocol, if the client received traffic back on a different IP to the IP it sent the traffic to, it would drop it?
A static 1:1 NAT defines which inside address translates to which outside address, so there is nothing for the NAT router to figure out; it is already given to the router in the configuration. It merely has to translate the destination address on outside sourced packets, and the source address on inside sourced packets; a simple, static, table lookup.
It gets more complex when the NAT isn't static or 1:1. Then the NAT router then needs to build tables on the fly, and create timeouts for the table entries.
It depends on the type of NAT.
If it's many-to-one NAT, then that's correct. Outbound packets establish a record that is used to know what to do with inbound packets. This is the most common type of NAT and the type used in typical home networks.
It it's one-to-one NAT, then any inbound packet received that is addressed to 1.1.1.6 (in your example) would be NATted to 192.168.0.1.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
I have a modem that is connected to a router. There are two computers connected to this router. I want to set a domain for one of those computers so that I can access the web deployment server running in that computer from Internet. I used freedns.afraid.org to get a free subdomain. But when I set it up, the domain is getting mapped to my external IP address. So, the problem is that when I try to access the set domain, I am only accessing the modem's configuration page i.e. EXTERNAL_IP:80
In my local network, my modem's IP address is 192.168.0.1 , my router's IP address is 192.168.1.1 and my computers take IP addresses anywhere between 192.168.1.100 and 192.168.1.148
Also, my router is Linksys WRT54G and is only capable of default DDNS configuration to dyndns and TZO. Since both have become paid services, I opted for free DDNS and I'll use some DDNS update client to update the dynamic IP.
I don't know how to search specifically for this problem in google. Also, I came across port forwarding which was used under similar topics. I am new to this, so can anyone suggest me how to redirect my domain to the particular host or is there any reference page I can learn the procedure from? SOLVED
UPDATE ON THE QUESTION (NEW ISSUE)
Since I didn't have port forwarding option in my modem and also my modem didn't by default forward everything to the router, I had to set up my modem as a bridge to my router. I disabled the modem's DHCP server and enabled only the router's DHCP server. This allowed me to configure port forwarding in the router alone and is working good.
But the problem now is, I am not able to access the modem's configuration page (192.168.1.1). My router is at 192.168.1.2 . Subnet mask is 255.255.255.0 . I tried changing the router to a different subnet say 192.168.0.1, but then the internet connectivity didn't even establish. I tried connecting my computer directly to the modem to access it's configuration page, but that also failed.
If you want to redirect my domain to the particular host you need to setup NAT-Virtual Server Setup .
here you need to map remote port to internal map.
In above image IP address is my IP of my host and Default address is my router's IP address
Now you have configure NAT in you router as bellow.
in above image server IP is you host IP address.
I am using D-Link router so this Image is according to that if you are using some different router then you might have different view.
After configuring this when you type EXTERNAL_IP:80 your request will be forwarded to application that is running on you host with that port
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 12 years ago.
Improve this question
(1) What is my and others real IP address on same lan? Can we still have a unique IP despite the fact that we share the same router/LAN? and how does the IPs are assigned?
Thanks!
If you use a router to access the internet you probably have a DHCP Server running on the router as well.
This gives each computer a unique IP address wit a lease of x-days.
From the net only your public (mostly dynamic) ip address is shown to others.
Inside you private local net you have private ip addresses like 192.168.x.x/class C.
Easy way to find out your ip addess on your local computer:
open a cmd shell and type "ipconfig /all".
Then you see your IP address and also the gateway (which is your router).
Within a single LAN (which I'm defining here as a section of the net with no network address translation (NAT)), your IP address should be unique.
That's so that traffic can get to the correct machine.
However, it's never that simple. There's a good chance that the IP address the world sees you at is nothing like your local IP address. Your local address is probably 10.x.x.x or 192.x.x.x (from memory), one of a group of private IP ranges. For example, my Ubuntu box here is 10.1.1.2, an address that probably half a million other people on the planet have.
But my packets don't hit the internet with that source address since they go through a NAT router on my desk as well as a large number of other NAT'ting devices in my ISP.
It's this NAT process that allows all those private IP ranges to be usable.
As to how you get your IP addreses, you can set up static addresses (very useful for servers that you don't want changing) but the usual approach for non-server machines is to use a DHCP (dynamic host configuration protocol) server which manages the IP addresses and hands them out as required (on booting your client machine usually).
Typically, the DHCP server wil lock an IP address to a specific Ethernet MAC address for a period of time (in our corporate environment, it's three weeks). That means that, barring a four week holiday with your machine turned off, you should always have the same address.
Keep in mind that you may have more than one network card with separate IP addreses. You may even have a single network card with multiple IP addresses. In that case, you can be said to have more than one real IP address although I'd probably still say that it's the one servicing your default route (the source address your packets go out on by default).
It's a very ... interesting ... field to work in :-)