Telnet to configure a router to mount web and ftp servers

In this post we will show you how you can configure your router to create an apache2 web server and an FTP service

Step 1. Open the ports on the router

mount ftp server

We can carry out this process by telnet or by web, according to our preferences. In any case, we need some starting data:

We need to know the IP address of the router (gateway) and the IP address of the computer on which we want to mount as a web server.

This is the information we need to proceed:

  1. The local IP of our PC (IP address field), which we must indicate because we will use it later (in this case 192.168.1.100)
  2. The subnet mask.
  3. The gateway IP (default gateway field), which is the IP address of the router. In the example 192.168.1.1.

We will explain the process by telnet, since the management of the filters will necessarily have to be done by this means. So telnet to the gateway IP.

  • Start ——- Run ——- telnet 192.168.1.1 (in our case).
  • The router, in this case, will only ask us for a password. Use the router's admin password.
  • We will access the first screen, which is the main router management menu.
  • We will select the NAT configuration.
  • We select 1. Server set 1 (Used only for SUA).
  • And, finally we have the screen where we will open the ports.
  • Rule 1 is to put a PC in default, that is, open all the ports to the PC whose IP we put in that field.
  • We will open ports 21 and 80 to the PC IP 192.168.1.81. To do this, we will put the port number that we want to open in the initial and final port number. In IP Address we place the IP of the PC on which we are going to mount the server (in this case 192.168.1.81).
  • Press Enter until we exit the screen. At this point the ports have been left open.
  • We will go to the main screen using the escape key to proceed with the second part, the filter configuration.

Step 2. Modifying router filters

The router has built-in filters to ensure your security and prevent unwanted access to both the router itself and our network.

install apache2 in telnet

The router, by default, blocks any Internet access to ports 23 (telnet), 21 (ftp), 69 (tftp), and 80 (web).

For our server to work, we need to override the rule that affects port 21 (for the ftp server) or the rule that affects port 80 (for the web server).

The procedure consists of introducing the corresponding rule and changing the characteristic Active = Yes to Active = No. We will place the cursor and use the space bar to change the option. Then we press enter until the filter is registered.

Therefore, we will modify the one that affects port 21 for the ftp server or the one that affects port 80 for the web server.

Once this is done, if we have correctly configured the server (and also the firewall if there is one) any port scanner will find port 21 or 80 open.