search

Loading
Showing posts with label port forwarding. Show all posts
Showing posts with label port forwarding. Show all posts

Sunday, December 8, 2013

Port forwarding port 80 of public static ip to internal machines port 8080 in centos using iptables

I have a centos server acting as router. It has two ethernet ports eth0 and eth1. eth0 is configured with the public static ip got from my ISP. I have my internal machines connected to this centos os router machine using LAN in eth1.

For example, assume that my public static ip given by my ISP is 123.45.567.89 and it is configured in eth0. In eth1 my internal machines are connected through LAN. Internal machines are in the ip range of 192.168.1.0 to 192.168.1.100

I have a web application running on one of my internal machines with IP 192.168.1.10 on port 8080. I can access this web app from my internal network by typing http://192.168.1.10:8080/ in a web browser. But I want to get this application from my public static ip given by ISP by simply typing http://123.45.567.89/ in the web browser. How can I achieve this? By port forwarding. Follow the below steps to achieve this.

Friday, November 23, 2012

How to enable internet connectivity to remote server which is not connected to internet using port forwarding [port forward local port to remote machine using ssh tunneling]

Last time we saw that we can port forward the remote port to local machine and use it for testing the apps in the remote server. The opposite of this is also true. Yes, we can port forward the local port to remote server and use it for internet connectivity in the remote machine.

This trick comes handy if the remote server is behind a firewall or in a VPN and there is no direct connectivity to the internet. So what we will do if we need to update the applications in the server. Or what if we need to install a critical security update to the server? Here again comes the port forwarding to our rescue.