access local server from other networks - networking

I created a localhost server using servlets.
I want to know how to access from other networks(other ip addresses).
what to do for that?
any answers will be helpful for me

you should use public ip address,instead of local ip address to access over the networks.

You can access it by giving IP address of your machine in your application url in place of localhost while accessing it from another machine in the same network.

you can use your ip address instead of localhost.and also need to configure firewall.The firewall can be configured by: choosing the Windows Firewall from the Control Panel, then click on Exceptions -> Add Port and enter name and number: your server, port and leave transport protocol as TCP.
e.g,
http://10.4.0.198:8080/project

Related

Fritzbox public ip address with DS-Lite

I am struggeling to connect to my home server that is connected via a Fritzbox router to the internet. I want to connect to the home server from outside of the home net, as it serves as a NAS and provides HTTP(S) services.
The problem is, that I don't understand how to connect to the server over the internet. My Fritzbox is connected to my internet provider via DS-Lite internet connection. As far as I understood, this means that my Fritzbox has no public IPv4 address and therefore the server is not reachable.
Is it still somehow possible to connect to the server?
Reading your question, I can see that there are multiple steps to solve this.
figure out if your internet provider allows you to have incoming connections
I do not know, what a ds lite connection is. Depending on your connection type, e.g. glass fibre, dsl, mobile and your provider incoming connections might be allowed or not. Also specific ports might be forbidden.
Enable port forwarding for incoming connections to your lan server.
Your fritzbox does not know, where to route the incoming connection to.
Make your lan server ip address static. Go to your fritzbox admin page and create a port forwarding rule and map data incoming on port 80(HTTP) and 443(HTTPS) to the lan server ip address.
You can read further here: https://en.wikipedia.org/wiki/Port_forwarding
Figure out the fritzbox's public ip address by checking out this website from within your lan. https://whatismyipaddress.com/
Connect to your server via http(s)://publicip
setup dynamic dns to have a public domain, which you can use instead of the ip address.
Usually private customer internet connections use dynamic ip addresses. So your ip address changes regularly. This is annoying, because you need to lookup the ip address before you can connect again. To avoid this issue, you can use a dynamic dns provider to give you a domain name, which you can use instead of the public ip address. Your fritzbox should have this kind of functionality already. If not, you can also configure it on your server with a cron job.
You can read further here: https://en.wikipedia.org/wiki/Dynamic_DNS
This provider is easy to use and for free: https://freedns.afraid.org/
use the dynamic dns domain name instead othe public to access your server from anywhere
Be aware, that having open connections to your local network gives attack surface from the public internet. So people might steal or delete data on your server or abuse it in other ways.

Access server in local network through domain

i have problem with access to server with domains.
Test url: testpage.example.com.
Server is in local network with port fowarding (80, 443), configured as web server using caddy server as reverse proxy.
Case 1 (using Asus router):
Connected on local network behind router. Server is in the same network as my computer. Everything works like a charm in and out of my network.
Case 2 (using internet provider router):
Connected on local network behind router. Can't access server with domain. Works with direct IP. Outside network, works as in case 1.
I used same server.
Does anyone know why this problem occured? How can i solve it?
Thanks,
David
Two options I can think of:
You could add a record to whatever DNS server you're using in Case 2.
You could write a short script that runs whenever you change network connections to modify your hosts file accordingly.
This happens when the server you are trying to reach "testpage.example.com" resolves to your router's external IP address. Because your public IP address is the same as server's IP address (even though inside your home network you have different private IP addresses) your requests are lost in the ether.
As a workaround you can resolve the testpage.example.com manually on your local machine.
For Windows c:\windows\system32\etc\hosts
For Linux /etc/hosts
testpage.example.com 192.168.1.102 -> private IP of the machine serving the site.

Access internal resource from external ip

I have a network with a resource with an internal ip of 192.168.1.254 for example. I need to be able to access this resource from the external IP address of 86.126.1.234 let's say. I am off site and need to use VNC to access this computer.
How can I access this resource using just the two IP addresses.
Thanks in advance,
Maksim
192.168. is a non routable ip address.
You need an external facing ip address.
to find out your external ip address you can try
whatsmyipaddress.com
You will probably need to change your router configuration to make your VNC port forwarded to 192.168.1.254.
Or, you if you just need remote control access to your Computer, try using
www.teamviewer.com

Can the internal IP addresses of azure worker role instances be swapped?

Like if one is on 192.168.1.1 and the other on 192.168.1.2, can you configure the machine's to each other's static IP addresses and thereby have them start receiving information for each other's InstanceInputEndpoints (since now the Azure gateway should route the InstanceInputEndpoint to the new owner of the IP address)?
No, you can't do that!
And, as of today (Dec. 2013) you are highly advised to never set static IP Address of your Virtual Machine inside Windows Azure! You should always use default DHCP configuration. If you wand IP Address predictability check out this blog post. You can still use Azure Virtual Network with Web and Worker Roles and have IP Address predictability.
If you use VM you should create several VM and a Networks, define address space you will use. When you create a VM, make sure your VM is using the networks that you create. If you forget to include the vm into the network, you need to recreate the VM.
Example how to change the internal IP using 3 VM:
Server A is connected to the network and get ip 192.168.0.1
Server B 192.168.0.2
Server C 192.168.0.3
shutdown all your server from azure portal so that the status is deallocated then turn it on with this sequence:
Server B
Server C
Server A
The Result will be:
Server A 192.168.0.3
Server B 192.168.0.1
Server C 192.168.0.2
If you turn off the VM from inside the VM, it won't be change the internal IP.
If you remote onto one of your VMs, you will see an XML file at
C:\config
The filename looks something like
[deployment id]_[role name]_[instance number].[version number]
Inside the file you will find all the instances in the deployment with their IP addresses. If you edit the IP address in this file for a particular role instance on a particular VM, that VM will think that the IP address for the instance is the one in the file and will start routing traffic to it.
Warning: I've never tried to do this programmatically. Also, the changes will get wiped out if there is any update to the deployment (either initiated by you or by Azure). And there might be some other horrible side effect.

How Can I Access Locally Hosted IIS WebSite from Remote Computer By My IP Address?

How Can I Access My Locally Hosted IIS WebSite from Remote Computer By My IP Address ?
You have to check you ip here, make sure that you are forwarding port 80 (especially if you're in a locale home network), and then you could access your server by http://<server_ip> e.g. http://192.168.0.6
Note that as long as you don't have a fixed (static) ip, your ip address might change, and you'll have to recheck it.
Another note- The default HTTP port is 80, and by using port 80 you could access your server via browsers without writing the port number. If for any reason you like to switch port, make sure your forward that port number and access your site by http://<server_ip>:<port_number> , e.g. http://192.168.0.6:8080
if you are using some other port. then you can go with http://<ip_address>:<port_no>

Resources