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 10 years ago.
Improve this question
I have installed latest Ubuntu (12.04) on my pc, and when I do ifconfig it shows this IP: 192.168.1.22.
I dont want to use internal ip, I want to use it as a server.
However when I visit www.whatismyip.com website it is actually showing my IP 27.82.XXX.XXX
How can I get this IP on my pc, So that I can use my pc as a server.
The 27.82.XXX.XXX IP is actually the global IP of your internet router, not your PC/server. If you want to be able to access your server using that IP, you will need to forward the proper ports from your router to the local IP of your server (192.168.1.22). For example, if you want to use it as a web server, you will probably need to forward ports 80 (HTTP) and/or 443 (HTTPS). Or if you need SSH access, forward port 22. Here is a good guide that explains how to do it.
Also, unless you have a static IP from your internet provider, don't expect that your global IP will stay the same. That's where dynamic DNS comes in. It allows you to assign a hostname that will always point to your server even when the IP changes. I personally prefer dnsdynamic.org because it's simple, free, and unlimited.
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 6 years ago.
Improve this question
I have one Linux machine with many services which needed to be accessed from outside users, each service has one port, how can i make all these service be accessible by one external public IP?
Thank you.
Based on this description ...
A few VMs on Linux server machine and each using Internal IP which wanna each VM service accessible from outside via one public IP.
The solution is to set up the linux server (running the hypervisor) to use iptables, and then configure iptables to forward connection requests to specific ports on the external IP through to some port on the appropriate internal IP.
Here's a more detailed description:
https://www.digitalocean.com/community/tutorials/how-to-forward-ports-through-a-linux-gateway-with-iptables
There many other relevant sources if you Google for "iptables port forwarding".
On your router you will need to enable port forwarding or NAT. For each internal port on your Linux Machine, you will create a port forwarding to the name port number and IP address of the Linux Machine on the router.
For example, if you want outside users to connect to the Linux Machine with IP address 192.168.1.20 via port 80 (web), then on the router you will create a port forward that opens the external port 80 and forwards this to IP Address 192.168.1.20 on port 80 as well. So if someone from the outside wanted to connect to the Linux Machine, they would use your PUBLIC IP Address using port 80.
You don't always have to match the outside port with the internal port but it does make it easier to setup and for applications to recognise ie web browsers that use port 80 by default.
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
I purchased a domain through Amazon Route 53 and am hosting my Node.js/ExpressJS app on an Amazon Linux EC2 Instance server. I can get my site to run on my EC2 server by using the public IP:portNumber or by using the publicDNS:portNumber, but I am struggling to understand how to set up the record sets in the hosted zone section of the Route 53 console to have my website point to www.thedomainipurchased.com:portNumber. I also read somewhere that you can't add the port number onto the public ip like that, so I would like to know how to set up both records to do this. I'm new to DNS, which is why I've had such a hard time although I'm sure to some people this seems very simple so would really appreciate any feedback to be explained in as basic and simple of a way as possible. Record Set Picture here
DNS only provides a way to map names to the IP addresses of hosts. Except under very limited circumstances you can't include a port number. DNS simply isn't designed to do that.
Ports are determined by the protocol involved. If you use a web browser to connect via HTTP then it will default to using port 80. If you use a web browser to connect via HTTPS then it will default to using port 443. When you send e-mail the default port is 25. When you SSH into a server the default port is 22. And so on. Default ports are essentially part of the specification for the global internet.
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 8 years ago.
Improve this question
I would like to know how to make my Linux Server accesible for anyone around the world. I currectly can access it via 192.168.1.22 locally on my network. I would like it to be accesible through and IP or a domain name.
If you are wanting all ports to be accessible then you can make the box a DMZ on your router and set a static IP, then you are done. If you want it to be accessible through SSH which is what I am going to assume, then you need to set a static IP for the box forward the internal IP address and port in your router and then optionally set up DDNS settings if available. At that point you will be able to access the box from any public network. If you need help let me know.
Either get a static IP address from your Internet Service Provider, or use Dynamic DNS to map a domain name to a dynamic IP address.
One well known Dynamic DNS provider is NoIP
http://www.noip.com/free/
In any case, you probably have a NAT "firewall" that blocks all incoming traffic, so you'll need to configure the firewall to allow ports through that you want to server. Typical Linksys / Netgear NAT firewalls / Wifi routers allow you to port forward to a single private IP address.
Finally, you should make sure your ISP allows running a server. Though most of them dont mind, because the upload speed is throttled by design, you still want to check the terms of service.
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 9 years ago.
Improve this question
So I've been scouring the internet for days trying to figure this out and can't figure it out.
I know its going to be an easy one.
So I recently took an old desktop and loaded ubuntu server 12.04 on it. My goal with this project is to create an area to host a few git repositories and maybe a simple webpage.
I've installed both the SSH and Apache2 packages and tried to configure them. Right now I can log in from my laptop using ssh greg#0.0.0.0.0 but only while I am on the same network. Once I leave the house I get a timeout error.
So 2 things I would like to get at right now.
How to configure the SSH to allow me to access the server from outside the network.
Get my host name on the server so logins will be greg#hostname instead of greg#0.0.0
(I've done sudo hostname and changed the etc/hostname file and no results)
Thanks guys.
The timeout external to your home network occurs because the IP you specified will be routed elsewhere on external networks.
As others have indicated, you need to configure port forwarding on your router (external interface) to the SSH server. You can either use the standard port (22) or any alternative port (something above 1024). For the webserver you will need to set the port forwarding from port 80 on the external interface to your server and maybe port 443 if you want to include SSL/TLS connections.
I also recommend using the SSH config file (~/.ssh/config) to make it easier when making either an internal or external connection. Add something like this:
Host serverext
Hostname 1.2.3.4
User greg
Port 22
Host serverint
Hostname 192.168.1.10
User greg
Port 22
Change the Hostname for the serverext config to the IP address of your Internet connection. If you use a non-standard port for the external SSH connections then change the port field for serverext to match that.
Change the Hostname for the serverint config to the internal IP address for that server on your network.
Once this is configured, in conjunction with the port forwarding you will be able to use "ssh serverint" to connect to your server when you're at home and "ssh serverext" to connect to it when you're somewhere else.
It is possible to include advanced configuration options through the SSH configuration file, such as port tunneling and websocket connections. In the past I've done things like that and redirecting SSH connections through SOCKS proxy servers. I've even had it run through Tor, but it is very slow.
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 10 years ago.
Improve this question
AnalogX makes a handy useful Windows utility named Portmapper. It listens on any ports you like and forwards traffic to another IP address. So you can open a range of ports in your router, all mapped to one machine. That machine then forwards each specific port to any address you like within the LAN.
This is a good solution for routers with a limited number of NAT entries available. Just point a range to a single PC and let it do the rest. It can forward port 80 traffic to 192.168.1.101, port 5900 to 192.168.1.102, and port 5901 to 192.168.1.103:5900, etc.
I'm looking for a linux-based replacement. Either a program where I create a config file detailing the port numbers and IPs to forward, or a strategy to use a built-in solution like iptables. Any suggestions on how to do this?
Well you can do that natively in Linux with iptables:
http://www.debuntu.org/how-to-redirecting-network-traffic-a-new-ip-using-iptables
http://ramblings.narrabilis.com/ip-forward-using-iptables-port-and-host-redirect
http://www.revsys.com/writings/quicktips/nat.html