Can i put 2 severs/websites on 1 static ip?

multi-tasking_guy

Limp Gawd
Joined
Jun 16, 2017
Messages
142
My isp only gives me 1 static ip and i have 2 servers, i put a switch after my modem then connected 2 cables to my servers

is this possible? or would i need a router in front? i want to skip the router

this is my setup

Untitled.png
 
You need a device in front of the switch to set up PAT (port address translation).
 
Use a reverse proxy like NGINX in front (which anyone should be doing anyways) Never present your web servers direct to the internet.

With this you can filtering and use a better firewall than your ISP router likely has, you can also filter your firewall rules and drop bad packets.

What are your servers? Physical boxes or VMs?

Do you need them on 2 different servers?

What are you using to host said websites? IIS,Apache, NGINX?

 
Last edited:
Assuming the modem is in bridge mode, not always a valid assumption with the default ISP setup, then it might work IF the servers are offering up two different services. i.e. Server 1 = web, Server 2 = FTP. If both are trying to be Web servers, then no unless you change one to offer up on a non-standard port such as 8080. But then anyone trying to access your Server 2 would have to append :8080 to the URL address.

BUT, as already mentioned, it is poor practice to connect any server directly to the wilds of the Internet. Bad folks salivate over such silliness.

Also most ISP modems out of the box try to be a sort-of router and will by default offer up a private 192.x.x.x address on the LAN port.
 
What are the services you are serving? Not considering the security issues which have been addressed, if it is web servers, Apache allows virtual servers so that multiple sites can be hosted on one IP address. Other web servers probably have the same feature.
 
With only one public IP and needing to serve both websites on the same http port, essentially there needs to be 1 server that outside clients connect to that can redirect the traffic based on the website name they type in called "host header". Either:

A) both websites are on the same server and apache/IIS/nginx can accept the traffic and redirect to the right website on that server
-or'
B) front end server that performs the same function, except it redirects to your already in place web servers.

B sounds like the easiest for you, you might even load the "front end" on one of your existing servers to save time.
 
Back
Top