ISP and DNS
1 - Hire a static IP address with your ISP
Your external IP address is not something you can change, it is given to you automatically by your Internet provider. In order to configure our server to have access to the Internet we will need to have a static external IP address, so the first step that we will need to do before starting the router configuration is to contact your ISP (Internet Server Provider) and hire a static IP address, this is usually monthly paid service.
2 - Get a domain name
The second step is optional but recommended. With a static external IP address, you will be able to access your site from the internet, but you will need to write a sequence of numbers in a web browser. If you want to access using a name instead an IP you will need to get a domain name using one of the numerous domain name registers that you can find online, such as GoDaddy, 1&1 Internet, Dotster.com...
Domain names serve to identify Internet resources, such as computers, networks, and services, with a text-based label that is easier to memorize than the numerical addresses used in Internet protocols.
1 - DHCP (Dynamic Host Configuration Protocol)
Reserve an IP address for your server in the DHCP service. What this will do is ensure that your server is always at the same IP address on your internal network, even after a restart of the server or router.
1. Go to your router configuration by typing your router's IP in your web browser navigation bar. This IP is usually 192.168.0.1 but you can check yours by typing ipconfig in the command prompt or in Mac by typing netstat -nr | grep default in Terminal or going to System Preferences > Network.
2. Find the DHCP setting. It can be named "DCHP Reservation", or "Address Reservation"...
3. Find the MAC address of the computer which you want to add to the reservation list. You can find the MAC address by using ipconfig in the Windows command prompt or going to Preferences > Network on macOS and going to Advanced. Remember that the Mac address will be different between WiFi and Ethernet adaptors and they cannot have the same IP reserved so you will need to choose a preferred one.
4. Write the adaptor MAC address into the DHCP address reservation and write the IP that you want to be fixed. Apply the changes.
2 - Setup port forwarding
The second step is setup the port forwarding to the previously reserved server IP address. This will allow us to redirect a communication request from one address and port number combination (external) to another (internal) through a network gateway such as a router or firewall.
To setup a port forwarding:
- Again you need to access the router configuration, as earlier described you need to find your router IP and type it in your browser.
- Each router interface is different, finding the "port forwarding" section should not be difficult, but you can check your router manual to find this section.
- Once in the port forwarding section, you will need to add a new custom entry, again each router will have different fields to fill, but the required information is very similar between models:
- Name → Informative field to describe the service.
- Type → TCP, UDP, or Both.
- Inbound or Start→ First port number.
- Private or End → Second port number (to open a single port type the same port as in the previous field, but if you want to open a range type the last port in the range).
- Finally, you will need to introduce your server IP address that we already made static in the DHCP step and save the changes.
The common ports that we would need are 80 for HTTP and 443 for HTTPS connections.